History

perf/core: Add PERF_RECORD_CGROUP event

To support cgroup tracking, add CGROUP event to save a link between cgroup path and id number. This is needed since cgroups can go away when userspace tries to read the cgroup info (from the id) later. The attr.cgroup bit was also added to enable cgroup tracking from userspace. This event will be generated when a new cgroup becomes active. Userspace might need to synthesize those events for existing cgroups. Committer testing: From the resulting kernel, using /sys/kernel/btf/vmlinux: $ pahole perf_event_attr | grep -w cgroup -B5 -A1 __u64 write_backward:1; /* 40:27 8 */ __u64 namespaces:1; /* 40:28 8 */ __u64 ksymbol:1; /* 40:29 8 */ __u64 bpf_event:1; /* 40:30 8 */ __u64 aux_output:1; /* 40:31 8 */ __u64 cgroup:1; /* 40:32 8 */ __u64 __reserved_1:31; /* 40:33 8 */ $

Namhyung Kim committed 6 years ago

Commit 96aaab61 parent 26567ed2 files · +123 −1Browse files

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

Unified · Split

include/uapi/linux/perf_event.h+12−1
@@ -381,7 +381,8 @@ struct perf_event_attr { · 380 unmodified lines
381381 ksymbol : 1, /* include ksymbol events */
382382 bpf_event : 1, /* include bpf events */
383383 aux_output : 1, /* generate AUX records instead of events */
384− __reserved_1 : 32;
384+ cgroup : 1, /* include cgroup events */
385+ __reserved_1 : 31;
385386
386387 union {
387388 __u32 wakeup_events; /* wakeup every n events */
@@ -1012,6 +1013,16 @@ enum perf_event_type { · 624 unmodified lines
10121013 */
10131014 PERF_RECORD_BPF_EVENT = 18,
10141015
1016+ /*
1017+ * struct {
1018+ * struct perf_event_header header;
1019+ * u64 id;
1020+ * char path[];
1021+ * struct sample_id sample_id;
1022+ * };
1023+ */
1024+ PERF_RECORD_CGROUP = 19,
1025+
10151026 PERF_RECORD_MAX, /* non-ABI */
10161027 };
10171028

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