diff options
| author | Ingo Molnar <mingo@kernel.org> | 2017-03-15 14:27:27 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2017-03-15 14:27:27 -0400 |
| commit | ffa86c2f1a8862cf58c873f6f14d4b2c3250fb48 (patch) | |
| tree | 9e15f9494d9a70bd0d2295311f0c56a04113070c /include | |
| parent | 84e5b549214f2160c12318aac549de85f600c79a (diff) | |
| parent | 5f6bee34707973ea7879a7857fd63ddccc92fff3 (diff) | |
Merge tag 'perf-core-for-mingo-4.12-20170314' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
New features:
- Add PERF_RECORD_NAMESPACES so that the kernel can record information
required to associate samples to namespaces, helping in container
problem characterization.
Now the 'perf record has a --namespace' option to ask for such info,
and when present, it can be used, initially, via a new sort order,
'cgroup_id', allowing histogram entry bucketization by a (device, inode)
based cgroup identifier (Hari Bathini)
- Add --next option to 'perf sched timehist', showing what is the next
thread to run (Brendan Gregg)
Fixes:
- Fix segfault with basic block 'cycles' sort dimension (Changbin Du)
- Add c2c to command-list.txt, making it appear in the 'perf help'
output (Changbin Du)
- Fix zeroing of 'abs_path' variable in the perf hists browser switch
file code (Changbin Du)
- Hide tips messages when -q/--quiet is given to 'perf report' (Namhyung Kim)
Infrastructure changes:
- Use ref_reloc_sym + offset to setup kretprobes (Naveen Rao)
- Ignore generated files pmu-events/{jevents,pmu-events.c} for git (Changbin Du)
Documentation changes:
- Document +field style argument support for --field option (Changbin Du)
- Clarify 'perf c2c --stats' help message (Namhyung Kim)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/perf_event.h | 2 | ||||
| -rw-r--r-- | include/uapi/linux/perf_event.h | 32 |
2 files changed, 33 insertions, 1 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 000fdb211c7d..f19a82362851 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -1112,6 +1112,7 @@ extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks | |||
| 1112 | 1112 | ||
| 1113 | extern void perf_event_exec(void); | 1113 | extern void perf_event_exec(void); |
| 1114 | extern void perf_event_comm(struct task_struct *tsk, bool exec); | 1114 | extern void perf_event_comm(struct task_struct *tsk, bool exec); |
| 1115 | extern void perf_event_namespaces(struct task_struct *tsk); | ||
| 1115 | extern void perf_event_fork(struct task_struct *tsk); | 1116 | extern void perf_event_fork(struct task_struct *tsk); |
| 1116 | 1117 | ||
| 1117 | /* Callchains */ | 1118 | /* Callchains */ |
| @@ -1315,6 +1316,7 @@ static inline int perf_unregister_guest_info_callbacks | |||
| 1315 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 1316 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
| 1316 | static inline void perf_event_exec(void) { } | 1317 | static inline void perf_event_exec(void) { } |
| 1317 | static inline void perf_event_comm(struct task_struct *tsk, bool exec) { } | 1318 | static inline void perf_event_comm(struct task_struct *tsk, bool exec) { } |
| 1319 | static inline void perf_event_namespaces(struct task_struct *tsk) { } | ||
| 1318 | static inline void perf_event_fork(struct task_struct *tsk) { } | 1320 | static inline void perf_event_fork(struct task_struct *tsk) { } |
| 1319 | static inline void perf_event_init(void) { } | 1321 | static inline void perf_event_init(void) { } |
| 1320 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 1322 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index c66a485a24ac..bec0aad0e15c 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h | |||
| @@ -344,7 +344,8 @@ struct perf_event_attr { | |||
| 344 | use_clockid : 1, /* use @clockid for time fields */ | 344 | use_clockid : 1, /* use @clockid for time fields */ |
| 345 | context_switch : 1, /* context switch data */ | 345 | context_switch : 1, /* context switch data */ |
| 346 | write_backward : 1, /* Write ring buffer from end to beginning */ | 346 | write_backward : 1, /* Write ring buffer from end to beginning */ |
| 347 | __reserved_1 : 36; | 347 | namespaces : 1, /* include namespaces data */ |
| 348 | __reserved_1 : 35; | ||
| 348 | 349 | ||
| 349 | union { | 350 | union { |
| 350 | __u32 wakeup_events; /* wakeup every n events */ | 351 | __u32 wakeup_events; /* wakeup every n events */ |
| @@ -610,6 +611,23 @@ struct perf_event_header { | |||
| 610 | __u16 size; | 611 | __u16 size; |
| 611 | }; | 612 | }; |
| 612 | 613 | ||
| 614 | struct perf_ns_link_info { | ||
| 615 | __u64 dev; | ||
| 616 | __u64 ino; | ||
| 617 | }; | ||
| 618 | |||
| 619 | enum { | ||
| 620 | NET_NS_INDEX = 0, | ||
| 621 | UTS_NS_INDEX = 1, | ||
| 622 | IPC_NS_INDEX = 2, | ||
| 623 | PID_NS_INDEX = 3, | ||
| 624 | USER_NS_INDEX = 4, | ||
| 625 | MNT_NS_INDEX = 5, | ||
| 626 | CGROUP_NS_INDEX = 6, | ||
| 627 | |||
| 628 | NR_NAMESPACES, /* number of available namespaces */ | ||
| 629 | }; | ||
| 630 | |||
| 613 | enum perf_event_type { | 631 | enum perf_event_type { |
| 614 | 632 | ||
| 615 | /* | 633 | /* |
| @@ -862,6 +880,18 @@ enum perf_event_type { | |||
| 862 | */ | 880 | */ |
| 863 | PERF_RECORD_SWITCH_CPU_WIDE = 15, | 881 | PERF_RECORD_SWITCH_CPU_WIDE = 15, |
| 864 | 882 | ||
| 883 | /* | ||
| 884 | * struct { | ||
| 885 | * struct perf_event_header header; | ||
| 886 | * u32 pid; | ||
| 887 | * u32 tid; | ||
| 888 | * u64 nr_namespaces; | ||
| 889 | * { u64 dev, inode; } [nr_namespaces]; | ||
| 890 | * struct sample_id sample_id; | ||
| 891 | * }; | ||
| 892 | */ | ||
| 893 | PERF_RECORD_NAMESPACES = 16, | ||
| 894 | |||
| 865 | PERF_RECORD_MAX, /* non-ABI */ | 895 | PERF_RECORD_MAX, /* non-ABI */ |
| 866 | }; | 896 | }; |
| 867 | 897 | ||
