summaryrefslogtreecommitdiff
path: root/overlay/gpu-perf.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-26 14:11:27 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-26 14:34:05 +0100
commit908df374a9b469a8d8accdc504564a1bd79eeab5 (patch)
tree4281c3aa4ca5f70cca1706d7303242864c7ca648 /overlay/gpu-perf.c
parent1e65d5ac2f1c3b80444fd3c12e7bfcaf033a117f (diff)
overlay: Count number of semaphores used by each process
This required me to contract the per-process information considerably, hopefully readability is not sacrificed too much. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'overlay/gpu-perf.c')
-rw-r--r--overlay/gpu-perf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c
index 61e447da..142357cb 100644
--- a/overlay/gpu-perf.c
+++ b/overlay/gpu-perf.c
@@ -249,6 +249,19 @@ static int flip_complete(struct gpu_perf *gp, const void *event)
return 1;
}
+static int ring_sync(struct gpu_perf *gp, const void *event)
+{
+ const struct sample_event *sample = event;
+ struct gpu_perf_comm *comm;
+
+ comm = lookup_comm(gp, sample->pid);
+ if (comm == NULL)
+ return 0;
+
+ comm->nr_sema++;
+ return 1;
+}
+
static int wait_begin(struct gpu_perf *gp, const void *event)
{
const struct sample_event *sample = event;
@@ -300,6 +313,7 @@ void gpu_perf_init(struct gpu_perf *gp, unsigned flags)
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);
+ perf_tracepoint_open(gp, "i915", "i915_gem_ring_sync_to", ring_sync);
if (gp->nr_events == 0) {
gp->error = "i915.ko tracepoints not available";