diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-19 15:20:06 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-19 15:38:27 -0500 |
commit | cc22e575a6fddbe3183ac14c28e2f792704995c5 (patch) | |
tree | 2ab6533499cfc1e12bcadb0eb7c4cbf51d50ecda /tools/perf/builtin-script.c | |
parent | 8b640cc4c56cee14bfe5cfb4dbb372ac66d5ec6b (diff) |
perf symbols: Add 'machine' member to struct addr_location
The addr_location struct should fully qualify an address, and to do that
it should have in it the machine where the thread was found.
Thus all functions that receive an addr_location now don't need to also
receive a 'machine', those functions just need to access al->machine
instead, just like it does with the other parts of an address location:
al->thread, al->map, etc.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-o51iiee7vyq4r3k362uvuylg@git.kernel.org
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 | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index f8ab125aac48..62ef190c4320 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -423,7 +423,6 @@ static void print_sample_addr(union perf_event *event, | |||
423 | static void print_sample_bts(union perf_event *event, | 423 | static void print_sample_bts(union perf_event *event, |
424 | struct perf_sample *sample, | 424 | struct perf_sample *sample, |
425 | struct perf_evsel *evsel, | 425 | struct perf_evsel *evsel, |
426 | struct machine *machine, | ||
427 | struct thread *thread, | 426 | struct thread *thread, |
428 | struct addr_location *al) | 427 | struct addr_location *al) |
429 | { | 428 | { |
@@ -435,7 +434,7 @@ static void print_sample_bts(union perf_event *event, | |||
435 | printf(" "); | 434 | printf(" "); |
436 | else | 435 | else |
437 | printf("\n"); | 436 | printf("\n"); |
438 | perf_evsel__print_ip(evsel, sample, machine, al, | 437 | perf_evsel__print_ip(evsel, sample, al, |
439 | output[attr->type].print_ip_opts, | 438 | output[attr->type].print_ip_opts, |
440 | PERF_MAX_STACK_DEPTH); | 439 | PERF_MAX_STACK_DEPTH); |
441 | } | 440 | } |
@@ -446,14 +445,13 @@ static void print_sample_bts(union perf_event *event, | |||
446 | if (PRINT_FIELD(ADDR) || | 445 | if (PRINT_FIELD(ADDR) || |
447 | ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) && | 446 | ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) && |
448 | !output[attr->type].user_set)) | 447 | !output[attr->type].user_set)) |
449 | print_sample_addr(event, sample, machine, thread, attr); | 448 | print_sample_addr(event, sample, al->machine, thread, attr); |
450 | 449 | ||
451 | printf("\n"); | 450 | printf("\n"); |
452 | } | 451 | } |
453 | 452 | ||
454 | static void process_event(union perf_event *event, struct perf_sample *sample, | 453 | static void process_event(union perf_event *event, struct perf_sample *sample, |
455 | struct perf_evsel *evsel, struct machine *machine, | 454 | struct perf_evsel *evsel, struct thread *thread, |
456 | struct thread *thread, | ||
457 | struct addr_location *al) | 455 | struct addr_location *al) |
458 | { | 456 | { |
459 | struct perf_event_attr *attr = &evsel->attr; | 457 | struct perf_event_attr *attr = &evsel->attr; |
@@ -469,7 +467,7 @@ static void process_event(union perf_event *event, struct perf_sample *sample, | |||
469 | } | 467 | } |
470 | 468 | ||
471 | if (is_bts_event(attr)) { | 469 | if (is_bts_event(attr)) { |
472 | print_sample_bts(event, sample, evsel, machine, thread, al); | 470 | print_sample_bts(event, sample, evsel, thread, al); |
473 | return; | 471 | return; |
474 | } | 472 | } |
475 | 473 | ||
@@ -477,7 +475,7 @@ static void process_event(union perf_event *event, struct perf_sample *sample, | |||
477 | event_format__print(evsel->tp_format, sample->cpu, | 475 | event_format__print(evsel->tp_format, sample->cpu, |
478 | sample->raw_data, sample->raw_size); | 476 | sample->raw_data, sample->raw_size); |
479 | if (PRINT_FIELD(ADDR)) | 477 | if (PRINT_FIELD(ADDR)) |
480 | print_sample_addr(event, sample, machine, thread, attr); | 478 | print_sample_addr(event, sample, al->machine, thread, attr); |
481 | 479 | ||
482 | if (PRINT_FIELD(IP)) { | 480 | if (PRINT_FIELD(IP)) { |
483 | if (!symbol_conf.use_callchain) | 481 | if (!symbol_conf.use_callchain) |
@@ -485,7 +483,7 @@ static void process_event(union perf_event *event, struct perf_sample *sample, | |||
485 | else | 483 | else |
486 | printf("\n"); | 484 | printf("\n"); |
487 | 485 | ||
488 | perf_evsel__print_ip(evsel, sample, machine, al, | 486 | perf_evsel__print_ip(evsel, sample, al, |
489 | output[attr->type].print_ip_opts, | 487 | output[attr->type].print_ip_opts, |
490 | PERF_MAX_STACK_DEPTH); | 488 | PERF_MAX_STACK_DEPTH); |
491 | } | 489 | } |
@@ -574,7 +572,7 @@ static int process_sample_event(struct perf_tool *tool __maybe_unused, | |||
574 | if (cpu_list && !test_bit(sample->cpu, cpu_bitmap)) | 572 | if (cpu_list && !test_bit(sample->cpu, cpu_bitmap)) |
575 | return 0; | 573 | return 0; |
576 | 574 | ||
577 | scripting_ops->process_event(event, sample, evsel, machine, thread, &al); | 575 | scripting_ops->process_event(event, sample, evsel, thread, &al); |
578 | 576 | ||
579 | evsel->hists.stats.total_period += sample->period; | 577 | evsel->hists.stats.total_period += sample->period; |
580 | return 0; | 578 | return 0; |