mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-24 08:16:10 +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;
|
return 0;
|
||||||
|
|
||||||
wait->comm = comm;
|
wait->comm = comm;
|
||||||
|
wait->comm->active = true;
|
||||||
wait->seqno = sample->raw[2];
|
wait->seqno = sample->raw[2];
|
||||||
wait->time = sample->time;
|
wait->time = sample->time;
|
||||||
wait->next = gp->wait[sample->raw[1]];
|
wait->next = gp->wait[sample->raw[1]];
|
||||||
@ -284,6 +285,8 @@ static int wait_end(struct gpu_perf *gp, const void *event)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
wait->comm->wait_time += sample->time - wait->time;
|
wait->comm->wait_time += sample->time - wait->time;
|
||||||
|
wait->comm->active = false;
|
||||||
|
|
||||||
*prev = wait->next;
|
*prev = wait->next;
|
||||||
free(wait);
|
free(wait);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#define GPU_PERF_H
|
#define GPU_PERF_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
#define MAX_RINGS 4
|
#define MAX_RINGS 4
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ struct gpu_perf {
|
|||||||
struct gpu_perf_comm *next;
|
struct gpu_perf_comm *next;
|
||||||
char name[256];
|
char name[256];
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
bool active;
|
||||||
int nr_requests[4];
|
int nr_requests[4];
|
||||||
void *user_data;
|
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) {
|
for (comm = gp->gpu_perf.comm; comm; comm = comm->next) {
|
||||||
int total;
|
int total;
|
||||||
|
|
||||||
|
if (comm->name[0] == '\0')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (strncmp(comm->name, "kworker", 7) == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (comm->user_data == NULL) {
|
if (comm->user_data == NULL) {
|
||||||
comm->user_data = malloc(sizeof(struct chart));
|
comm->user_data = malloc(sizeof(struct chart));
|
||||||
if (comm->user_data == NULL)
|
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;
|
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);
|
chart_get_range(comm->user_data, range);
|
||||||
|
}
|
||||||
|
|
||||||
y2 = y1 = y;
|
y2 = y1 = y;
|
||||||
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_set_range(comm->user_data, range[0], range[1]);
|
chart_set_range(comm->user_data, range[0], range[1]);
|
||||||
chart_draw(comm->user_data, ctx->cr);
|
chart_draw(comm->user_data, ctx->cr);
|
||||||
y2 += 14;
|
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; ) {
|
for (prev = &gp->gpu_perf.comm; (comm = *prev) != NULL; ) {
|
||||||
int need_comma = 0, len;
|
int need_comma = 0, len;
|
||||||
|
|
||||||
if (comm->name[0] == '\0')
|
if (comm->user_data == NULL)
|
||||||
goto skip_comm;
|
goto skip_comm;
|
||||||
|
|
||||||
len = sprintf(buf, "%s:", comm->name);
|
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:
|
skip_comm:
|
||||||
memset(comm->nr_requests, 0, sizeof(comm->nr_requests));
|
memset(comm->nr_requests, 0, sizeof(comm->nr_requests));
|
||||||
if (comm->show < ctx->time - IDLE_TIME ||
|
if (!comm->active &&
|
||||||
strcmp(comm->name, get_comm(comm->pid, buf, sizeof(buf)))) {
|
(comm->show < ctx->time - IDLE_TIME ||
|
||||||
|
strcmp(comm->name, get_comm(comm->pid, buf, sizeof(buf))))) {
|
||||||
*prev = comm->next;
|
*prev = comm->next;
|
||||||
if (comm->user_data) {
|
if (comm->user_data) {
|
||||||
chart_fini(comm->user_data);
|
chart_fini(comm->user_data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user