sources/perf: Capture DRM vblank events as a mark.

This should be useful to visualize system-wide events in the CPU
timeline, especially once we add some more events.

We may want to define some modes eventually, as not all captures will
care about GPU visualization.  However, it's pretty low overhead (60Hz
* number of monitors), so maybe we can just filter it out at
visualization time.

We do a bit more setup work than necessary here (looking up the config
number for the tracepoint per CPU, rather than looking it up once at
startup), but I suspect I'll want to refactor the init anyway once we
add more tracepoint markers.
This commit is contained in:
Eric Anholt
2018-05-16 09:37:42 +01:00
committed by Christian Hergert
parent 925dadce82
commit ac11f0f941
2 changed files with 188 additions and 1 deletions

View File

@ -115,7 +115,7 @@ _perf_event_open (struct perf_event_attr *attr,
assert (attr != NULL);
/* Quick sanity check */
if (attr->sample_period < 100000)
if (attr->sample_period < 100000 && attr->type != PERF_TYPE_TRACEPOINT)
return -EINVAL;
return syscall (__NR_perf_event_open, attr, pid, cpu, group_fd, flags);