sources/perf: Include the sample identifier in PERF_RECORD_SAMPLE.

If we want to start watching other perf events, we need a way to look
up what perf event we got when a PERF_RECORD_SAMPLE comes in.  The
sample identifier is what does that.
This commit is contained in:
Eric Anholt
2018-05-16 09:37:41 +01:00
committed by Christian Hergert
parent 83b75e6528
commit 925dadce82
2 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,7 @@ typedef struct
typedef struct
{
struct perf_event_header header;
guint64 identifier;
guint64 ip;
guint32 pid;
guint32 tid;

View File

@ -291,6 +291,7 @@ sp_perf_source_start_pid (SpPerfSource *self,
attr.sample_type = PERF_SAMPLE_IP
| PERF_SAMPLE_TID
| PERF_SAMPLE_IDENTIFIER
| PERF_SAMPLE_CALLCHAIN
| PERF_SAMPLE_TIME;
attr.wakeup_events = N_WAKEUP_EVENTS;