diff options
author | Ingo Molnar <mingo@kernel.org> | 2018-06-26 02:37:57 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-06-26 02:37:57 -0400 |
commit | 79598041079827a22b33dd3edcb0dd827b70e204 (patch) | |
tree | 6335808b7d51fe4a0e7502a4459a3dc7ba39aa30 /tools/perf/builtin-script.c | |
parent | 6f0d349d922ba44e4348a17a78ea51b7135965b1 (diff) | |
parent | 92ead7ee30c80f8852d28735cbcb9d79bc85f715 (diff) |
Merge tag 'perf-urgent-for-mingo-4.18-20180625' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
perf bench: (Jiri Olsa):
- Fix NUMA report output code handling of less than 1s runtimes.
perf script: (Ravi Bangoria)
- Add missing output fields in a 'perf script -h' hint.
- Fix crash because of missing evsel->priv.
- Fix crash caused by accessing feat_ops[HEADER_LAST_FEATURE], which
is just a end of features header marker.
perf stat: (Thomas Richter)
- Remove duplicate event counting
perf test:
- Wire parsing error handling in 'parse events' test (Jiri Olsa)
- Fix 'session topology' test on s/390 (Thomas Richter)
eBPF: (Yonghong Song)
- Fix a clang 7.0 compilation error when building perf linking
with libclang
intel-pt: (Adrian Hunter)
- Fix packet decoding of CYC packets.
Copies of kernel files: (Arnaldo Carvalho de Melo)
- Synchronize drm/drm.h UAPI
- Update x86's syscall_64.tbl, adding support for 'io_pgetevents' and 'rseq'
in 'perf trace'.
- Update powerpc uapi/asm/unistd.h, adding support for the 'rseq' syscall.
- Update if_link.h and bpf.h, no effect on tool features.
PowerPC: (Sandipan Das)
- Fix crash if callchain is empty.
s/390: (Thomas Richter)
- Support random socked_id assignment in the perf header.
- Support s390 random socket_id assignment in perf.data file.
- Make PMU alias definitions taken from sysfs and JSON files comparable
by normalizing them wrt spaces and newlines.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index a31d7082188e..568ddfac3213 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -1834,6 +1834,7 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, | |||
1834 | struct perf_evlist *evlist; | 1834 | struct perf_evlist *evlist; |
1835 | struct perf_evsel *evsel, *pos; | 1835 | struct perf_evsel *evsel, *pos; |
1836 | int err; | 1836 | int err; |
1837 | static struct perf_evsel_script *es; | ||
1837 | 1838 | ||
1838 | err = perf_event__process_attr(tool, event, pevlist); | 1839 | err = perf_event__process_attr(tool, event, pevlist); |
1839 | if (err) | 1840 | if (err) |
@@ -1842,6 +1843,19 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, | |||
1842 | evlist = *pevlist; | 1843 | evlist = *pevlist; |
1843 | evsel = perf_evlist__last(*pevlist); | 1844 | evsel = perf_evlist__last(*pevlist); |
1844 | 1845 | ||
1846 | if (!evsel->priv) { | ||
1847 | if (scr->per_event_dump) { | ||
1848 | evsel->priv = perf_evsel_script__new(evsel, | ||
1849 | scr->session->data); | ||
1850 | } else { | ||
1851 | es = zalloc(sizeof(*es)); | ||
1852 | if (!es) | ||
1853 | return -ENOMEM; | ||
1854 | es->fp = stdout; | ||
1855 | evsel->priv = es; | ||
1856 | } | ||
1857 | } | ||
1858 | |||
1845 | if (evsel->attr.type >= PERF_TYPE_MAX && | 1859 | if (evsel->attr.type >= PERF_TYPE_MAX && |
1846 | evsel->attr.type != PERF_TYPE_SYNTH) | 1860 | evsel->attr.type != PERF_TYPE_SYNTH) |
1847 | return 0; | 1861 | return 0; |
@@ -3030,6 +3044,15 @@ int process_cpu_map_event(struct perf_tool *tool __maybe_unused, | |||
3030 | return set_maps(script); | 3044 | return set_maps(script); |
3031 | } | 3045 | } |
3032 | 3046 | ||
3047 | static int process_feature_event(struct perf_tool *tool, | ||
3048 | union perf_event *event, | ||
3049 | struct perf_session *session) | ||
3050 | { | ||
3051 | if (event->feat.feat_id < HEADER_LAST_FEATURE) | ||
3052 | return perf_event__process_feature(tool, event, session); | ||
3053 | return 0; | ||
3054 | } | ||
3055 | |||
3033 | #ifdef HAVE_AUXTRACE_SUPPORT | 3056 | #ifdef HAVE_AUXTRACE_SUPPORT |
3034 | static int perf_script__process_auxtrace_info(struct perf_tool *tool, | 3057 | static int perf_script__process_auxtrace_info(struct perf_tool *tool, |
3035 | union perf_event *event, | 3058 | union perf_event *event, |
@@ -3074,7 +3097,7 @@ int cmd_script(int argc, const char **argv) | |||
3074 | .attr = process_attr, | 3097 | .attr = process_attr, |
3075 | .event_update = perf_event__process_event_update, | 3098 | .event_update = perf_event__process_event_update, |
3076 | .tracing_data = perf_event__process_tracing_data, | 3099 | .tracing_data = perf_event__process_tracing_data, |
3077 | .feature = perf_event__process_feature, | 3100 | .feature = process_feature_event, |
3078 | .build_id = perf_event__process_build_id, | 3101 | .build_id = perf_event__process_build_id, |
3079 | .id_index = perf_event__process_id_index, | 3102 | .id_index = perf_event__process_id_index, |
3080 | .auxtrace_info = perf_script__process_auxtrace_info, | 3103 | .auxtrace_info = perf_script__process_auxtrace_info, |
@@ -3125,8 +3148,9 @@ int cmd_script(int argc, const char **argv) | |||
3125 | "+field to add and -field to remove." | 3148 | "+field to add and -field to remove." |
3126 | "Valid types: hw,sw,trace,raw,synth. " | 3149 | "Valid types: hw,sw,trace,raw,synth. " |
3127 | "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso," | 3150 | "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso," |
3128 | "addr,symoff,period,iregs,uregs,brstack,brstacksym,flags," | 3151 | "addr,symoff,srcline,period,iregs,uregs,brstack," |
3129 | "bpf-output,callindent,insn,insnlen,brstackinsn,synth,phys_addr", | 3152 | "brstacksym,flags,bpf-output,brstackinsn,brstackoff," |
3153 | "callindent,insn,insnlen,synth,phys_addr,metric,misc", | ||
3130 | parse_output_fields), | 3154 | parse_output_fields), |
3131 | OPT_BOOLEAN('a', "all-cpus", &system_wide, | 3155 | OPT_BOOLEAN('a', "all-cpus", &system_wide, |
3132 | "system-wide collection from all CPUs"), | 3156 | "system-wide collection from all CPUs"), |