diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-04-01 12:29:25 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-04-02 12:18:41 -0400 |
commit | f9d5d549d2c2934be84b0bc7e5e034834459f591 (patch) | |
tree | bb6b9d6a430ac4933575bdc1e3912cf0553dc681 /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | 79628f2cfe0f488b23e5dc99a4a9a599032fa653 (diff) |
perf scripting: No need to pass thread twice to the scripting callbacks
It is already in the addr_location, so remove the redundant 'thread'
parameter from the callback signatures.
Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1427906210-10519-3-git-send-email-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
-rw-r--r-- | tools/perf/util/scripting-engines/trace-event-python.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 2ec5dfb5a456..de8df1d5e1bd 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c | |||
@@ -381,7 +381,6 @@ exit: | |||
381 | 381 | ||
382 | static void python_process_tracepoint(struct perf_sample *sample, | 382 | static void python_process_tracepoint(struct perf_sample *sample, |
383 | struct perf_evsel *evsel, | 383 | struct perf_evsel *evsel, |
384 | struct thread *thread, | ||
385 | struct addr_location *al) | 384 | struct addr_location *al) |
386 | { | 385 | { |
387 | struct event_format *event = evsel->tp_format; | 386 | struct event_format *event = evsel->tp_format; |
@@ -395,7 +394,7 @@ static void python_process_tracepoint(struct perf_sample *sample, | |||
395 | int cpu = sample->cpu; | 394 | int cpu = sample->cpu; |
396 | void *data = sample->raw_data; | 395 | void *data = sample->raw_data; |
397 | unsigned long long nsecs = sample->time; | 396 | unsigned long long nsecs = sample->time; |
398 | const char *comm = thread__comm_str(thread); | 397 | const char *comm = thread__comm_str(al->thread); |
399 | 398 | ||
400 | t = PyTuple_New(MAX_FIELDS); | 399 | t = PyTuple_New(MAX_FIELDS); |
401 | if (!t) | 400 | if (!t) |
@@ -766,7 +765,6 @@ static int python_process_call_return(struct call_return *cr, void *data) | |||
766 | 765 | ||
767 | static void python_process_general_event(struct perf_sample *sample, | 766 | static void python_process_general_event(struct perf_sample *sample, |
768 | struct perf_evsel *evsel, | 767 | struct perf_evsel *evsel, |
769 | struct thread *thread, | ||
770 | struct addr_location *al) | 768 | struct addr_location *al) |
771 | { | 769 | { |
772 | PyObject *handler, *t, *dict, *callchain, *dict_sample; | 770 | PyObject *handler, *t, *dict, *callchain, *dict_sample; |
@@ -816,7 +814,7 @@ static void python_process_general_event(struct perf_sample *sample, | |||
816 | pydict_set_item_string_decref(dict, "raw_buf", PyString_FromStringAndSize( | 814 | pydict_set_item_string_decref(dict, "raw_buf", PyString_FromStringAndSize( |
817 | (const char *)sample->raw_data, sample->raw_size)); | 815 | (const char *)sample->raw_data, sample->raw_size)); |
818 | pydict_set_item_string_decref(dict, "comm", | 816 | pydict_set_item_string_decref(dict, "comm", |
819 | PyString_FromString(thread__comm_str(thread))); | 817 | PyString_FromString(thread__comm_str(al->thread))); |
820 | if (al->map) { | 818 | if (al->map) { |
821 | pydict_set_item_string_decref(dict, "dso", | 819 | pydict_set_item_string_decref(dict, "dso", |
822 | PyString_FromString(al->map->dso->name)); | 820 | PyString_FromString(al->map->dso->name)); |
@@ -843,22 +841,21 @@ exit: | |||
843 | static void python_process_event(union perf_event *event, | 841 | static void python_process_event(union perf_event *event, |
844 | struct perf_sample *sample, | 842 | struct perf_sample *sample, |
845 | struct perf_evsel *evsel, | 843 | struct perf_evsel *evsel, |
846 | struct thread *thread, | ||
847 | struct addr_location *al) | 844 | struct addr_location *al) |
848 | { | 845 | { |
849 | struct tables *tables = &tables_global; | 846 | struct tables *tables = &tables_global; |
850 | 847 | ||
851 | switch (evsel->attr.type) { | 848 | switch (evsel->attr.type) { |
852 | case PERF_TYPE_TRACEPOINT: | 849 | case PERF_TYPE_TRACEPOINT: |
853 | python_process_tracepoint(sample, evsel, thread, al); | 850 | python_process_tracepoint(sample, evsel, al); |
854 | break; | 851 | break; |
855 | /* Reserve for future process_hw/sw/raw APIs */ | 852 | /* Reserve for future process_hw/sw/raw APIs */ |
856 | default: | 853 | default: |
857 | if (tables->db_export_mode) | 854 | if (tables->db_export_mode) |
858 | db_export__sample(&tables->dbe, event, sample, evsel, | 855 | db_export__sample(&tables->dbe, event, sample, evsel, |
859 | thread, al); | 856 | al->thread, al); |
860 | else | 857 | else |
861 | python_process_general_event(sample, evsel, thread, al); | 858 | python_process_general_event(sample, evsel, al); |
862 | } | 859 | } |
863 | } | 860 | } |
864 | 861 | ||