mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-24 00:06:09 +00:00
overlay: Hide kworker threads in overview
The kworker threads are used for flip handling and other non-userspace driver tasks. They are non-blocking and so do not impact upon how userspace performs, but they do obscure that information in the overview. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
0be9766952
commit
eb799b2994
@ -266,6 +266,7 @@ static int wait_begin(struct gpu_perf *gp, const void *event)
|
||||
return 0;
|
||||
|
||||
wait->comm = comm;
|
||||
wait->comm->active = true;
|
||||
wait->seqno = sample->raw[2];
|
||||
wait->time = sample->time;
|
||||
wait->next = gp->wait[sample->raw[1]];
|
||||
@ -284,6 +285,8 @@ static int wait_end(struct gpu_perf *gp, const void *event)
|
||||
continue;
|
||||
|
||||
wait->comm->wait_time += sample->time - wait->time;
|
||||
wait->comm->active = false;
|
||||
|
||||
*prev = wait->next;
|
||||
free(wait);
|
||||
return 1;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#define GPU_PERF_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define MAX_RINGS 4
|
||||
|
||||
@ -48,6 +49,7 @@ struct gpu_perf {
|
||||
struct gpu_perf_comm *next;
|
||||
char name[256];
|
||||
pid_t pid;
|
||||
bool active;
|
||||
int nr_requests[4];
|
||||
void *user_data;
|
||||
|
||||
|
@ -362,6 +362,12 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf *
|
||||
for (comm = gp->gpu_perf.comm; comm; comm = comm->next) {
|
||||
int total;
|
||||
|
||||
if (comm->name[0] == '\0')
|
||||
continue;
|
||||
|
||||
if (strncmp(comm->name, "kworker", 7) == 0)
|
||||
continue;
|
||||
|
||||
if (comm->user_data == NULL) {
|
||||
comm->user_data = malloc(sizeof(struct chart));
|
||||
if (comm->user_data == NULL)
|
||||
@ -387,11 +393,18 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf *
|
||||
}
|
||||
|
||||
range[0] = range[1] = 0;
|
||||
for (comm = gp->gpu_perf.comm; comm; comm = comm->next)
|
||||
for (comm = gp->gpu_perf.comm; comm; comm = comm->next) {
|
||||
if (comm->user_data == NULL)
|
||||
continue;
|
||||
|
||||
chart_get_range(comm->user_data, range);
|
||||
}
|
||||
|
||||
y2 = y1 = y;
|
||||
for (comm = gp->gpu_perf.comm; comm; comm = comm->next) {
|
||||
if (comm->user_data == NULL)
|
||||
continue;
|
||||
|
||||
chart_set_range(comm->user_data, range[0], range[1]);
|
||||
chart_draw(comm->user_data, ctx->cr);
|
||||
y2 += 14;
|
||||
@ -414,7 +427,7 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf *
|
||||
for (prev = &gp->gpu_perf.comm; (comm = *prev) != NULL; ) {
|
||||
int need_comma = 0, len;
|
||||
|
||||
if (comm->name[0] == '\0')
|
||||
if (comm->user_data == NULL)
|
||||
goto skip_comm;
|
||||
|
||||
len = sprintf(buf, "%s:", comm->name);
|
||||
@ -467,8 +480,9 @@ static void show_gpu_perf(struct overlay_context *ctx, struct overlay_gpu_perf *
|
||||
|
||||
skip_comm:
|
||||
memset(comm->nr_requests, 0, sizeof(comm->nr_requests));
|
||||
if (comm->show < ctx->time - IDLE_TIME ||
|
||||
strcmp(comm->name, get_comm(comm->pid, buf, sizeof(buf)))) {
|
||||
if (!comm->active &&
|
||||
(comm->show < ctx->time - IDLE_TIME ||
|
||||
strcmp(comm->name, get_comm(comm->pid, buf, sizeof(buf))))) {
|
||||
*prev = comm->next;
|
||||
if (comm->user_data) {
|
||||
chart_fini(comm->user_data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user