diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-03-23 10:55:24 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-03-23 11:11:03 -0400 |
commit | a3dff304ca50cbfbe3f0e76ee49c439990932ed5 (patch) | |
tree | 5a6aed2c2ce8a44b23a5b8ab67113249a0378832 /tools/perf/builtin-script.c | |
parent | c2740a87ca989ca42b0c078e021654e247a08311 (diff) |
perf script: Remove lots of unused arguments
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 4bc92070363b..3770c3dffe5e 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -405,9 +405,7 @@ out: | |||
405 | return 0; | 405 | return 0; |
406 | } | 406 | } |
407 | 407 | ||
408 | static void print_sample_iregs(union perf_event *event __maybe_unused, | 408 | static void print_sample_iregs(struct perf_sample *sample, |
409 | struct perf_sample *sample, | ||
410 | struct thread *thread __maybe_unused, | ||
411 | struct perf_event_attr *attr) | 409 | struct perf_event_attr *attr) |
412 | { | 410 | { |
413 | struct regs_dump *regs = &sample->intr_regs; | 411 | struct regs_dump *regs = &sample->intr_regs; |
@@ -476,10 +474,7 @@ mispred_str(struct branch_entry *br) | |||
476 | return br->flags.predicted ? 'P' : 'M'; | 474 | return br->flags.predicted ? 'P' : 'M'; |
477 | } | 475 | } |
478 | 476 | ||
479 | static void print_sample_brstack(union perf_event *event __maybe_unused, | 477 | static void print_sample_brstack(struct perf_sample *sample) |
480 | struct perf_sample *sample, | ||
481 | struct thread *thread __maybe_unused, | ||
482 | struct perf_event_attr *attr __maybe_unused) | ||
483 | { | 478 | { |
484 | struct branch_stack *br = sample->branch_stack; | 479 | struct branch_stack *br = sample->branch_stack; |
485 | u64 i; | 480 | u64 i; |
@@ -498,10 +493,8 @@ static void print_sample_brstack(union perf_event *event __maybe_unused, | |||
498 | } | 493 | } |
499 | } | 494 | } |
500 | 495 | ||
501 | static void print_sample_brstacksym(union perf_event *event __maybe_unused, | 496 | static void print_sample_brstacksym(struct perf_sample *sample, |
502 | struct perf_sample *sample, | 497 | struct thread *thread) |
503 | struct thread *thread __maybe_unused, | ||
504 | struct perf_event_attr *attr __maybe_unused) | ||
505 | { | 498 | { |
506 | struct branch_stack *br = sample->branch_stack; | 499 | struct branch_stack *br = sample->branch_stack; |
507 | struct addr_location alf, alt; | 500 | struct addr_location alf, alt; |
@@ -537,8 +530,7 @@ static void print_sample_brstacksym(union perf_event *event __maybe_unused, | |||
537 | } | 530 | } |
538 | 531 | ||
539 | 532 | ||
540 | static void print_sample_addr(union perf_event *event __maybe_unused, | 533 | static void print_sample_addr(struct perf_sample *sample, |
541 | struct perf_sample *sample, | ||
542 | struct thread *thread, | 534 | struct thread *thread, |
543 | struct perf_event_attr *attr) | 535 | struct perf_event_attr *attr) |
544 | { | 536 | { |
@@ -566,8 +558,7 @@ static void print_sample_addr(union perf_event *event __maybe_unused, | |||
566 | } | 558 | } |
567 | } | 559 | } |
568 | 560 | ||
569 | static void print_sample_bts(union perf_event *event, | 561 | static void print_sample_bts(struct perf_sample *sample, |
570 | struct perf_sample *sample, | ||
571 | struct perf_evsel *evsel, | 562 | struct perf_evsel *evsel, |
572 | struct thread *thread, | 563 | struct thread *thread, |
573 | struct addr_location *al) | 564 | struct addr_location *al) |
@@ -597,7 +588,7 @@ static void print_sample_bts(union perf_event *event, | |||
597 | ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) && | 588 | ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) && |
598 | !output[attr->type].user_set)) { | 589 | !output[attr->type].user_set)) { |
599 | printf(" => "); | 590 | printf(" => "); |
600 | print_sample_addr(event, sample, thread, attr); | 591 | print_sample_addr(sample, thread, attr); |
601 | } | 592 | } |
602 | 593 | ||
603 | if (print_srcline_last) | 594 | if (print_srcline_last) |
@@ -746,7 +737,7 @@ static size_t data_src__printf(u64 data_src) | |||
746 | return printf("%-*s", maxlen, out); | 737 | return printf("%-*s", maxlen, out); |
747 | } | 738 | } |
748 | 739 | ||
749 | static void process_event(struct perf_script *script, union perf_event *event, | 740 | static void process_event(struct perf_script *script, |
750 | struct perf_sample *sample, struct perf_evsel *evsel, | 741 | struct perf_sample *sample, struct perf_evsel *evsel, |
751 | struct addr_location *al) | 742 | struct addr_location *al) |
752 | { | 743 | { |
@@ -775,7 +766,7 @@ static void process_event(struct perf_script *script, union perf_event *event, | |||
775 | print_sample_flags(sample->flags); | 766 | print_sample_flags(sample->flags); |
776 | 767 | ||
777 | if (is_bts_event(attr)) { | 768 | if (is_bts_event(attr)) { |
778 | print_sample_bts(event, sample, evsel, thread, al); | 769 | print_sample_bts(sample, evsel, thread, al); |
779 | return; | 770 | return; |
780 | } | 771 | } |
781 | 772 | ||
@@ -783,7 +774,7 @@ static void process_event(struct perf_script *script, union perf_event *event, | |||
783 | event_format__print(evsel->tp_format, sample->cpu, | 774 | event_format__print(evsel->tp_format, sample->cpu, |
784 | sample->raw_data, sample->raw_size); | 775 | sample->raw_data, sample->raw_size); |
785 | if (PRINT_FIELD(ADDR)) | 776 | if (PRINT_FIELD(ADDR)) |
786 | print_sample_addr(event, sample, thread, attr); | 777 | print_sample_addr(sample, thread, attr); |
787 | 778 | ||
788 | if (PRINT_FIELD(DATA_SRC)) | 779 | if (PRINT_FIELD(DATA_SRC)) |
789 | data_src__printf(sample->data_src); | 780 | data_src__printf(sample->data_src); |
@@ -803,12 +794,12 @@ static void process_event(struct perf_script *script, union perf_event *event, | |||
803 | } | 794 | } |
804 | 795 | ||
805 | if (PRINT_FIELD(IREGS)) | 796 | if (PRINT_FIELD(IREGS)) |
806 | print_sample_iregs(event, sample, thread, attr); | 797 | print_sample_iregs(sample, attr); |
807 | 798 | ||
808 | if (PRINT_FIELD(BRSTACK)) | 799 | if (PRINT_FIELD(BRSTACK)) |
809 | print_sample_brstack(event, sample, thread, attr); | 800 | print_sample_brstack(sample); |
810 | else if (PRINT_FIELD(BRSTACKSYM)) | 801 | else if (PRINT_FIELD(BRSTACKSYM)) |
811 | print_sample_brstacksym(event, sample, thread, attr); | 802 | print_sample_brstacksym(sample, thread); |
812 | 803 | ||
813 | if (perf_evsel__is_bpf_output(evsel) && PRINT_FIELD(BPF_OUTPUT)) | 804 | if (perf_evsel__is_bpf_output(evsel) && PRINT_FIELD(BPF_OUTPUT)) |
814 | print_sample_bpf_output(sample); | 805 | print_sample_bpf_output(sample); |
@@ -919,7 +910,7 @@ static int process_sample_event(struct perf_tool *tool, | |||
919 | if (scripting_ops) | 910 | if (scripting_ops) |
920 | scripting_ops->process_event(event, sample, evsel, &al); | 911 | scripting_ops->process_event(event, sample, evsel, &al); |
921 | else | 912 | else |
922 | process_event(scr, event, sample, evsel, &al); | 913 | process_event(scr, sample, evsel, &al); |
923 | 914 | ||
924 | out_put: | 915 | out_put: |
925 | addr_location__put(&al); | 916 | addr_location__put(&al); |