aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/Documentation/perf-script.txt5
-rw-r--r--tools/perf/builtin-script.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index 3613b0a1aff2..7f61eaaf9ab8 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -188,6 +188,11 @@ OPTIONS
188 CPUs are specified with -: 0-2. Default is to report samples on all 188 CPUs are specified with -: 0-2. Default is to report samples on all
189 CPUs. 189 CPUs.
190 190
191-c::
192--comms=::
193 Only display events for these comms. CSV that understands
194 file://filename entries.
195
191-I:: 196-I::
192--show-info:: 197--show-info::
193 Display extended information about the perf.data file. This adds 198 Display extended information about the perf.data file. This adds
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 7731a09e975c..619d6dcaa1d9 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -441,6 +441,7 @@ static int process_sample_event(struct perf_tool *tool __used,
441 struct perf_evsel *evsel, 441 struct perf_evsel *evsel,
442 struct machine *machine) 442 struct machine *machine)
443{ 443{
444 struct addr_location al;
444 struct thread *thread = machine__findnew_thread(machine, event->ip.pid); 445 struct thread *thread = machine__findnew_thread(machine, event->ip.pid);
445 446
446 if (thread == NULL) { 447 if (thread == NULL) {
@@ -460,6 +461,15 @@ static int process_sample_event(struct perf_tool *tool __used,
460 return 0; 461 return 0;
461 } 462 }
462 463
464 if (perf_event__preprocess_sample(event, machine, &al, sample, 0) < 0) {
465 pr_err("problem processing %d event, skipping it.\n",
466 event->header.type);
467 return -1;
468 }
469
470 if (al.filtered)
471 return 0;
472
463 if (cpu_list && !test_bit(sample->cpu, cpu_bitmap)) 473 if (cpu_list && !test_bit(sample->cpu, cpu_bitmap))
464 return 0; 474 return 0;
465 475
@@ -1086,6 +1096,8 @@ static const struct option options[] = {
1086 "comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr", 1096 "comma separated output fields prepend with 'type:'. Valid types: hw,sw,trace,raw. Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,addr",
1087 parse_output_fields), 1097 parse_output_fields),
1088 OPT_STRING('C', "cpu", &cpu_list, "cpu", "list of cpus to profile"), 1098 OPT_STRING('C', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
1099 OPT_STRING('c', "comms", &symbol_conf.comm_list_str, "comm[,comm...]",
1100 "only display events for these comms"),
1089 OPT_BOOLEAN('I', "show-info", &show_full_info, 1101 OPT_BOOLEAN('I', "show-info", &show_full_info,
1090 "display extended information from perf.data file"), 1102 "display extended information from perf.data file"),
1091 OPT_END() 1103 OPT_END()