History

perf: Add PERF_EVENT_IOC_ID ioctl to return event ID

The only way to get the event ID is by reading the event fd, followed by parsing the ID value out of the returned data. While this is ok for current read format used by perf tool, it is not ok when we use PERF_FORMAT_GROUP format. With this format the data are returned for the whole group and there's no way to find out what ID belongs to our fd (if we are not group leader event). Adding a simple ioctl that returns event primary ID for given fd.

Jiri Olsa committed 14 years ago

Commit cf4957f1 parent 93786a52 files · +10 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/perf_event.h+1−0
@@ -321,6 +321,7 @@ struct perf_event_attr { · 320 unmodified lines
321#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)321#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
322#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)322#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
323#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)323#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
324#define PERF_EVENT_IOC_ID _IOR('$', 7, u64 *)
324 325
325enum perf_event_ioc_flags {326enum perf_event_ioc_flags {
326 PERF_IOC_FLAG_GROUP = 1U << 0,327 PERF_IOC_FLAG_GROUP = 1U << 0,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t