diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-29 10:02:00 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-29 13:25:20 -0500 |
commit | 8d50e5b4171a69cf48ca94a1e7c14033d0b4771d (patch) | |
tree | 6ebf659f92f0770917c7f47c24449ebfe048ce61 /tools/perf/util | |
parent | 93fc64f14472ae24fd640bf3834a178f59142842 (diff) |
perf tools: Rename 'struct sample_data' to 'struct perf_sample'
Making the namespace more uniform.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/build-id.c | 4 | ||||
-rw-r--r-- | tools/perf/util/event.c | 16 | ||||
-rw-r--r-- | tools/perf/util/event.h | 18 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 4 | ||||
-rw-r--r-- | tools/perf/util/session.c | 26 | ||||
-rw-r--r-- | tools/perf/util/session.h | 4 |
6 files changed, 36 insertions, 36 deletions
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c index deffb8c96071..b184a7fa0843 100644 --- a/tools/perf/util/build-id.c +++ b/tools/perf/util/build-id.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include "debug.h" | 15 | #include "debug.h" |
16 | 16 | ||
17 | static int build_id__mark_dso_hit(event_t *event, | 17 | static int build_id__mark_dso_hit(event_t *event, |
18 | struct sample_data *sample __used, | 18 | struct perf_sample *sample __used, |
19 | struct perf_session *session) | 19 | struct perf_session *session) |
20 | { | 20 | { |
21 | struct addr_location al; | 21 | struct addr_location al; |
@@ -37,7 +37,7 @@ static int build_id__mark_dso_hit(event_t *event, | |||
37 | return 0; | 37 | return 0; |
38 | } | 38 | } |
39 | 39 | ||
40 | static int event__exit_del_thread(event_t *self, struct sample_data *sample __used, | 40 | static int event__exit_del_thread(event_t *self, struct perf_sample *sample __used, |
41 | struct perf_session *session) | 41 | struct perf_session *session) |
42 | { | 42 | { |
43 | struct thread *thread = perf_session__findnew(session, self->fork.tid); | 43 | struct thread *thread = perf_session__findnew(session, self->fork.tid); |
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index b9d4ac87f9f7..5c886fbd50ce 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -34,7 +34,7 @@ const char *event__get_event_name(unsigned int id) | |||
34 | return event__name[id]; | 34 | return event__name[id]; |
35 | } | 35 | } |
36 | 36 | ||
37 | static struct sample_data synth_sample = { | 37 | static struct perf_sample synth_sample = { |
38 | .pid = -1, | 38 | .pid = -1, |
39 | .tid = -1, | 39 | .tid = -1, |
40 | .time = -1, | 40 | .time = -1, |
@@ -440,7 +440,7 @@ static int thread__set_comm_adjust(struct thread *self, const char *comm, | |||
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
442 | 442 | ||
443 | int event__process_comm(event_t *self, struct sample_data *sample __used, | 443 | int event__process_comm(event_t *self, struct perf_sample *sample __used, |
444 | struct perf_session *session) | 444 | struct perf_session *session) |
445 | { | 445 | { |
446 | struct thread *thread = perf_session__findnew(session, self->comm.tid); | 446 | struct thread *thread = perf_session__findnew(session, self->comm.tid); |
@@ -456,7 +456,7 @@ int event__process_comm(event_t *self, struct sample_data *sample __used, | |||
456 | return 0; | 456 | return 0; |
457 | } | 457 | } |
458 | 458 | ||
459 | int event__process_lost(event_t *self, struct sample_data *sample __used, | 459 | int event__process_lost(event_t *self, struct perf_sample *sample __used, |
460 | struct perf_session *session) | 460 | struct perf_session *session) |
461 | { | 461 | { |
462 | dump_printf(": id:%" PRIu64 ": lost:%" PRIu64 "\n", | 462 | dump_printf(": id:%" PRIu64 ": lost:%" PRIu64 "\n", |
@@ -567,7 +567,7 @@ out_problem: | |||
567 | return -1; | 567 | return -1; |
568 | } | 568 | } |
569 | 569 | ||
570 | int event__process_mmap(event_t *self, struct sample_data *sample __used, | 570 | int event__process_mmap(event_t *self, struct perf_sample *sample __used, |
571 | struct perf_session *session) | 571 | struct perf_session *session) |
572 | { | 572 | { |
573 | struct machine *machine; | 573 | struct machine *machine; |
@@ -609,7 +609,7 @@ out_problem: | |||
609 | return 0; | 609 | return 0; |
610 | } | 610 | } |
611 | 611 | ||
612 | int event__process_task(event_t *self, struct sample_data *sample __used, | 612 | int event__process_task(event_t *self, struct perf_sample *sample __used, |
613 | struct perf_session *session) | 613 | struct perf_session *session) |
614 | { | 614 | { |
615 | struct thread *thread = perf_session__findnew(session, self->fork.tid); | 615 | struct thread *thread = perf_session__findnew(session, self->fork.tid); |
@@ -632,7 +632,7 @@ int event__process_task(event_t *self, struct sample_data *sample __used, | |||
632 | return 0; | 632 | return 0; |
633 | } | 633 | } |
634 | 634 | ||
635 | int event__process(event_t *event, struct sample_data *sample, | 635 | int event__process(event_t *event, struct perf_sample *sample, |
636 | struct perf_session *session) | 636 | struct perf_session *session) |
637 | { | 637 | { |
638 | switch (event->header.type) { | 638 | switch (event->header.type) { |
@@ -757,7 +757,7 @@ static void dso__calc_col_width(struct dso *self, struct hists *hists) | |||
757 | } | 757 | } |
758 | 758 | ||
759 | int event__preprocess_sample(const event_t *self, struct perf_session *session, | 759 | int event__preprocess_sample(const event_t *self, struct perf_session *session, |
760 | struct addr_location *al, struct sample_data *data, | 760 | struct addr_location *al, struct perf_sample *sample, |
761 | symbol_filter_t filter) | 761 | symbol_filter_t filter) |
762 | { | 762 | { |
763 | u8 cpumode = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | 763 | u8 cpumode = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; |
@@ -788,7 +788,7 @@ int event__preprocess_sample(const event_t *self, struct perf_session *session, | |||
788 | al->map ? al->map->dso->long_name : | 788 | al->map ? al->map->dso->long_name : |
789 | al->level == 'H' ? "[hypervisor]" : "<not found>"); | 789 | al->level == 'H' ? "[hypervisor]" : "<not found>"); |
790 | al->sym = NULL; | 790 | al->sym = NULL; |
791 | al->cpu = data->cpu; | 791 | al->cpu = sample->cpu; |
792 | 792 | ||
793 | if (al->map) { | 793 | if (al->map) { |
794 | if (symbol_conf.dso_list && | 794 | if (symbol_conf.dso_list && |
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index d79e4edd82f9..84fd71ffd619 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h | |||
@@ -61,7 +61,7 @@ struct sample_event { | |||
61 | u64 array[]; | 61 | u64 array[]; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | struct sample_data { | 64 | struct perf_sample { |
65 | u64 ip; | 65 | u64 ip; |
66 | u32 pid, tid; | 66 | u32 pid, tid; |
67 | u64 time; | 67 | u64 time; |
@@ -138,7 +138,7 @@ struct perf_session; | |||
138 | 138 | ||
139 | typedef int (*event__handler_synth_t)(event_t *event, | 139 | typedef int (*event__handler_synth_t)(event_t *event, |
140 | struct perf_session *session); | 140 | struct perf_session *session); |
141 | typedef int (*event__handler_t)(event_t *event, struct sample_data *sample, | 141 | typedef int (*event__handler_t)(event_t *event, struct perf_sample *sample, |
142 | struct perf_session *session); | 142 | struct perf_session *session); |
143 | 143 | ||
144 | int event__synthesize_thread(pid_t pid, event__handler_t process, | 144 | int event__synthesize_thread(pid_t pid, event__handler_t process, |
@@ -154,25 +154,25 @@ int event__synthesize_modules(event__handler_t process, | |||
154 | struct perf_session *session, | 154 | struct perf_session *session, |
155 | struct machine *machine); | 155 | struct machine *machine); |
156 | 156 | ||
157 | int event__process_comm(event_t *self, struct sample_data *sample, | 157 | int event__process_comm(event_t *event, struct perf_sample *sample, |
158 | struct perf_session *session); | 158 | struct perf_session *session); |
159 | int event__process_lost(event_t *self, struct sample_data *sample, | 159 | int event__process_lost(event_t *event, struct perf_sample *sample, |
160 | struct perf_session *session); | 160 | struct perf_session *session); |
161 | int event__process_mmap(event_t *self, struct sample_data *sample, | 161 | int event__process_mmap(event_t *event, struct perf_sample *sample, |
162 | struct perf_session *session); | 162 | struct perf_session *session); |
163 | int event__process_task(event_t *self, struct sample_data *sample, | 163 | int event__process_task(event_t *event, struct perf_sample *sample, |
164 | struct perf_session *session); | 164 | struct perf_session *session); |
165 | int event__process(event_t *event, struct sample_data *sample, | 165 | int event__process(event_t *event, struct perf_sample *sample, |
166 | struct perf_session *session); | 166 | struct perf_session *session); |
167 | 167 | ||
168 | struct addr_location; | 168 | struct addr_location; |
169 | int event__preprocess_sample(const event_t *self, struct perf_session *session, | 169 | int event__preprocess_sample(const event_t *self, struct perf_session *session, |
170 | struct addr_location *al, struct sample_data *data, | 170 | struct addr_location *al, struct perf_sample *sample, |
171 | symbol_filter_t filter); | 171 | symbol_filter_t filter); |
172 | 172 | ||
173 | const char *event__get_event_name(unsigned int id); | 173 | const char *event__get_event_name(unsigned int id); |
174 | 174 | ||
175 | int event__parse_sample(const event_t *event, u64 type, bool sample_id_all, | 175 | int event__parse_sample(const event_t *event, u64 type, bool sample_id_all, |
176 | struct sample_data *sample); | 176 | struct perf_sample *sample); |
177 | 177 | ||
178 | #endif /* __PERF_RECORD_H */ | 178 | #endif /* __PERF_RECORD_H */ |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index f98b3e585039..a13488511880 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -368,7 +368,7 @@ out_unmap: | |||
368 | } | 368 | } |
369 | 369 | ||
370 | static int event__parse_id_sample(const event_t *event, u64 type, | 370 | static int event__parse_id_sample(const event_t *event, u64 type, |
371 | struct sample_data *sample) | 371 | struct perf_sample *sample) |
372 | { | 372 | { |
373 | const u64 *array = event->sample.array; | 373 | const u64 *array = event->sample.array; |
374 | 374 | ||
@@ -406,7 +406,7 @@ static int event__parse_id_sample(const event_t *event, u64 type, | |||
406 | } | 406 | } |
407 | 407 | ||
408 | int event__parse_sample(const event_t *event, u64 type, bool sample_id_all, | 408 | int event__parse_sample(const event_t *event, u64 type, bool sample_id_all, |
409 | struct sample_data *data) | 409 | struct perf_sample *data) |
410 | { | 410 | { |
411 | const u64 *array; | 411 | const u64 *array; |
412 | 412 | ||
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index e6a07408669e..ee0b61102571 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -67,7 +67,7 @@ out_close: | |||
67 | 67 | ||
68 | static void perf_session__id_header_size(struct perf_session *session) | 68 | static void perf_session__id_header_size(struct perf_session *session) |
69 | { | 69 | { |
70 | struct sample_data *data; | 70 | struct perf_sample *data; |
71 | u64 sample_type = session->sample_type; | 71 | u64 sample_type = session->sample_type; |
72 | u16 size = 0; | 72 | u16 size = 0; |
73 | 73 | ||
@@ -299,7 +299,7 @@ static int process_event_synth_stub(event_t *event __used, | |||
299 | } | 299 | } |
300 | 300 | ||
301 | static int process_event_stub(event_t *event __used, | 301 | static int process_event_stub(event_t *event __used, |
302 | struct sample_data *sample __used, | 302 | struct perf_sample *sample __used, |
303 | struct perf_session *session __used) | 303 | struct perf_session *session __used) |
304 | { | 304 | { |
305 | dump_printf(": unhandled!\n"); | 305 | dump_printf(": unhandled!\n"); |
@@ -475,7 +475,7 @@ static void perf_session_free_sample_buffers(struct perf_session *session) | |||
475 | 475 | ||
476 | static int perf_session_deliver_event(struct perf_session *session, | 476 | static int perf_session_deliver_event(struct perf_session *session, |
477 | event_t *event, | 477 | event_t *event, |
478 | struct sample_data *sample, | 478 | struct perf_sample *sample, |
479 | struct perf_event_ops *ops, | 479 | struct perf_event_ops *ops, |
480 | u64 file_offset); | 480 | u64 file_offset); |
481 | 481 | ||
@@ -485,7 +485,7 @@ static void flush_sample_queue(struct perf_session *s, | |||
485 | struct ordered_samples *os = &s->ordered_samples; | 485 | struct ordered_samples *os = &s->ordered_samples; |
486 | struct list_head *head = &os->samples; | 486 | struct list_head *head = &os->samples; |
487 | struct sample_queue *tmp, *iter; | 487 | struct sample_queue *tmp, *iter; |
488 | struct sample_data sample; | 488 | struct perf_sample sample; |
489 | u64 limit = os->next_flush; | 489 | u64 limit = os->next_flush; |
490 | u64 last_ts = os->last_sample ? os->last_sample->timestamp : 0ULL; | 490 | u64 last_ts = os->last_sample ? os->last_sample->timestamp : 0ULL; |
491 | 491 | ||
@@ -610,11 +610,11 @@ static void __queue_event(struct sample_queue *new, struct perf_session *s) | |||
610 | #define MAX_SAMPLE_BUFFER (64 * 1024 / sizeof(struct sample_queue)) | 610 | #define MAX_SAMPLE_BUFFER (64 * 1024 / sizeof(struct sample_queue)) |
611 | 611 | ||
612 | static int perf_session_queue_event(struct perf_session *s, event_t *event, | 612 | static int perf_session_queue_event(struct perf_session *s, event_t *event, |
613 | struct sample_data *data, u64 file_offset) | 613 | struct perf_sample *sample, u64 file_offset) |
614 | { | 614 | { |
615 | struct ordered_samples *os = &s->ordered_samples; | 615 | struct ordered_samples *os = &s->ordered_samples; |
616 | struct list_head *sc = &os->sample_cache; | 616 | struct list_head *sc = &os->sample_cache; |
617 | u64 timestamp = data->time; | 617 | u64 timestamp = sample->time; |
618 | struct sample_queue *new; | 618 | struct sample_queue *new; |
619 | 619 | ||
620 | if (!timestamp || timestamp == ~0ULL) | 620 | if (!timestamp || timestamp == ~0ULL) |
@@ -650,7 +650,7 @@ static int perf_session_queue_event(struct perf_session *s, event_t *event, | |||
650 | return 0; | 650 | return 0; |
651 | } | 651 | } |
652 | 652 | ||
653 | static void callchain__printf(struct sample_data *sample) | 653 | static void callchain__printf(struct perf_sample *sample) |
654 | { | 654 | { |
655 | unsigned int i; | 655 | unsigned int i; |
656 | 656 | ||
@@ -663,7 +663,7 @@ static void callchain__printf(struct sample_data *sample) | |||
663 | 663 | ||
664 | static void perf_session__print_tstamp(struct perf_session *session, | 664 | static void perf_session__print_tstamp(struct perf_session *session, |
665 | event_t *event, | 665 | event_t *event, |
666 | struct sample_data *sample) | 666 | struct perf_sample *sample) |
667 | { | 667 | { |
668 | if (event->header.type != PERF_RECORD_SAMPLE && | 668 | if (event->header.type != PERF_RECORD_SAMPLE && |
669 | !session->sample_id_all) { | 669 | !session->sample_id_all) { |
@@ -679,7 +679,7 @@ static void perf_session__print_tstamp(struct perf_session *session, | |||
679 | } | 679 | } |
680 | 680 | ||
681 | static void dump_event(struct perf_session *session, event_t *event, | 681 | static void dump_event(struct perf_session *session, event_t *event, |
682 | u64 file_offset, struct sample_data *sample) | 682 | u64 file_offset, struct perf_sample *sample) |
683 | { | 683 | { |
684 | if (!dump_trace) | 684 | if (!dump_trace) |
685 | return; | 685 | return; |
@@ -697,7 +697,7 @@ static void dump_event(struct perf_session *session, event_t *event, | |||
697 | } | 697 | } |
698 | 698 | ||
699 | static void dump_sample(struct perf_session *session, event_t *event, | 699 | static void dump_sample(struct perf_session *session, event_t *event, |
700 | struct sample_data *sample) | 700 | struct perf_sample *sample) |
701 | { | 701 | { |
702 | if (!dump_trace) | 702 | if (!dump_trace) |
703 | return; | 703 | return; |
@@ -712,7 +712,7 @@ static void dump_sample(struct perf_session *session, event_t *event, | |||
712 | 712 | ||
713 | static int perf_session_deliver_event(struct perf_session *session, | 713 | static int perf_session_deliver_event(struct perf_session *session, |
714 | event_t *event, | 714 | event_t *event, |
715 | struct sample_data *sample, | 715 | struct perf_sample *sample, |
716 | struct perf_event_ops *ops, | 716 | struct perf_event_ops *ops, |
717 | u64 file_offset) | 717 | u64 file_offset) |
718 | { | 718 | { |
@@ -745,7 +745,7 @@ static int perf_session_deliver_event(struct perf_session *session, | |||
745 | } | 745 | } |
746 | 746 | ||
747 | static int perf_session__preprocess_sample(struct perf_session *session, | 747 | static int perf_session__preprocess_sample(struct perf_session *session, |
748 | event_t *event, struct sample_data *sample) | 748 | event_t *event, struct perf_sample *sample) |
749 | { | 749 | { |
750 | if (event->header.type != PERF_RECORD_SAMPLE || | 750 | if (event->header.type != PERF_RECORD_SAMPLE || |
751 | !(session->sample_type & PERF_SAMPLE_CALLCHAIN)) | 751 | !(session->sample_type & PERF_SAMPLE_CALLCHAIN)) |
@@ -789,7 +789,7 @@ static int perf_session__process_event(struct perf_session *session, | |||
789 | struct perf_event_ops *ops, | 789 | struct perf_event_ops *ops, |
790 | u64 file_offset) | 790 | u64 file_offset) |
791 | { | 791 | { |
792 | struct sample_data sample; | 792 | struct perf_sample sample; |
793 | int ret; | 793 | int ret; |
794 | 794 | ||
795 | if (session->header.needs_swap && event__swap_ops[event->header.type]) | 795 | if (session->header.needs_swap && event__swap_ops[event->header.type]) |
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 78239767011e..365bf533a396 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -57,7 +57,7 @@ struct perf_session { | |||
57 | 57 | ||
58 | struct perf_event_ops; | 58 | struct perf_event_ops; |
59 | 59 | ||
60 | typedef int (*event_op)(event_t *self, struct sample_data *sample, | 60 | typedef int (*event_op)(event_t *self, struct perf_sample *sample, |
61 | struct perf_session *session); | 61 | struct perf_session *session); |
62 | typedef int (*event_synth_op)(event_t *self, struct perf_session *session); | 62 | typedef int (*event_synth_op)(event_t *self, struct perf_session *session); |
63 | typedef int (*event_op2)(event_t *self, struct perf_session *session, | 63 | typedef int (*event_op2)(event_t *self, struct perf_session *session, |
@@ -158,7 +158,7 @@ size_t perf_session__fprintf_nr_events(struct perf_session *self, FILE *fp) | |||
158 | 158 | ||
159 | static inline int perf_session__parse_sample(struct perf_session *session, | 159 | static inline int perf_session__parse_sample(struct perf_session *session, |
160 | const event_t *event, | 160 | const event_t *event, |
161 | struct sample_data *sample) | 161 | struct perf_sample *sample) |
162 | { | 162 | { |
163 | return event__parse_sample(event, session->sample_type, | 163 | return event__parse_sample(event, session->sample_type, |
164 | session->sample_id_all, sample); | 164 | session->sample_id_all, sample); |