summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-22 01:30:02 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-22 03:25:02 +0100
commitb20a6b827924bfaf0bf92a1eae818385f90dfbea (patch)
treeffbb5dbdd32021cfc48f5fe8f159c1d546e1d445
parent4572067c88276c6f72e33e6b204527f8a7ba4481 (diff)
overlay: Remove busy estimation
Too inaccurate to be useful. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--overlay/gpu-perf.c57
-rw-r--r--overlay/gpu-perf.h5
2 files changed, 6 insertions, 56 deletions
diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c
index bbebc5a8..d5e461c6 100644
--- a/overlay/gpu-perf.c
+++ b/overlay/gpu-perf.c
@@ -241,51 +241,6 @@ static int request_add(struct gpu_perf *gp, const void *event)
return 1;
}
-static int busy_start(struct gpu_perf *gp, const void *event)
-{
- const struct sample_event *sample = event;
- struct gpu_perf_comm *comm;
- struct gpu_perf_time *busy;
-
- comm = lookup_comm(gp, sample->pid);
- if (comm == NULL)
- return 0;
-
- busy = malloc(sizeof(*busy));
- if (busy == NULL)
- return 0;
-
- busy->ring = sample->raw[1];
- busy->seqno = sample->raw[2];
- busy->time = sample->time;
- busy->comm = comm;
- busy->next = gp->busy;
- gp->busy = busy;
-
- return 0;
-}
-
-static int busy_end(struct gpu_perf *gp, const void *event)
-{
- const struct sample_event *sample = event;
- struct gpu_perf_time *busy, **prev;
-
- for (prev = &gp->busy; (busy = *prev) != NULL; prev = &busy->next) {
- if (busy->ring != sample->raw[1])
- continue;
-
- if (busy->seqno != sample->raw[2])
- continue;
-
- busy->comm->busy_time += sample->time - busy->time;
- *prev = busy->next;
- free(busy);
- return 1;
- }
-
- return 0;
-}
-
static int flip_complete(struct gpu_perf *gp, const void *event)
{
const struct sample_event *sample = event;
@@ -309,11 +264,10 @@ static int wait_begin(struct gpu_perf *gp, const void *event)
return 0;
wait->comm = comm;
- wait->ring = sample->raw[1];
wait->seqno = sample->raw[2];
wait->time = sample->time;
- wait->next = gp->wait;
- gp->wait = wait;
+ wait->next = gp->wait[sample->raw[1]];
+ gp->wait[sample->raw[1]] = wait;
return 0;
}
@@ -323,10 +277,7 @@ static int wait_end(struct gpu_perf *gp, const void *event)
const struct sample_event *sample = event;
struct gpu_perf_time *wait, **prev;
- for (prev = &gp->wait; (wait = *prev) != NULL; prev = &wait->next) {
- if (wait->ring != sample->raw[1])
- continue;
-
+ for (prev = &gp->wait[sample->raw[1]]; (wait = *prev) != NULL; prev = &wait->next) {
if (wait->seqno != sample->raw[2])
continue;
@@ -346,8 +297,6 @@ void gpu_perf_init(struct gpu_perf *gp, unsigned flags)
gp->page_size = getpagesize();
perf_tracepoint_open(gp, "i915", "i915_gem_request_add", request_add);
- if (perf_tracepoint_open(gp, "i915", "i915_gem_ring_complete", busy_end) == 0)
- perf_tracepoint_open(gp, "i915", "i915_gem_ring_dispatch", busy_start);
if (perf_tracepoint_open(gp, "i915", "i915_gem_request_wait_begin", wait_begin) == 0)
perf_tracepoint_open(gp, "i915", "i915_gem_request_wait_end", wait_end);
perf_tracepoint_open(gp, "i915", "i915_flip_complete", flip_complete);
diff --git a/overlay/gpu-perf.h b/overlay/gpu-perf.h
index 56c783d6..3b91bd59 100644
--- a/overlay/gpu-perf.h
+++ b/overlay/gpu-perf.h
@@ -27,6 +27,8 @@
#include <stdint.h>
+#define MAX_RINGS 4
+
struct gpu_perf {
int page_size;
int nr_cpus;
@@ -52,10 +54,9 @@ struct gpu_perf {
struct gpu_perf_time {
struct gpu_perf_time *next;
struct gpu_perf_comm *comm;
- int ring;
uint32_t seqno;
uint64_t time;
- } *wait, *busy;
+ } *wait[MAX_RINGS];
};
void gpu_perf_init(struct gpu_perf *gp, unsigned flags);