diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-12-21 13:53:27 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-12-21 13:56:04 +0000 |
commit | eb799b29947a9030aca7d808e97190635636c8de (patch) | |
tree | 5bfe850617a83bee0893a05f14dab0608a251bff /overlay | |
parent | 0be9766952333dc54a0c568bc487660c0caf5edf (diff) |
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>
Diffstat (limited to 'overlay')
-rw-r--r-- | overlay/gpu-perf.c | 3 | ||||
-rw-r--r-- | overlay/gpu-perf.h | 2 | ||||
-rw-r--r-- | overlay/overlay.c | 22 |
3 files changed, 23 insertions, 4 deletions
diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c index 1d35da50..42ac44d5 100644 --- a/overlay/gpu-perf.c +++ b/overlay/gpu-perf.c @@ -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; diff --git a/overlay/gpu-perf.h b/overlay/gpu-perf.h index 23eba2fa..3e363fb7 100644 --- a/overlay/gpu-perf.h +++ b/overlay/gpu-perf.h @@ -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; diff --git a/overlay/overlay.c b/overlay/overlay.c index e61587f0..36154668 100644 --- a/overlay/overlay.c +++ b/overlay/overlay.c @@ -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); |