From: Arnaldo Carvalho de Melo Date: Fri, 11 Feb 2011 13:45:54 +0000 (-0200) Subject: Merge remote branch 'acme/perf/urgent' into perf/core X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7c940c18c57e45910f7dd9a4011c4658cacba4b6;p=linux-beck.git Merge remote branch 'acme/perf/urgent' into perf/core Fixups due to rename of event_t routines from event__ to perf_event__ done in perf/core. Conflicts: tools/perf/builtin-record.c tools/perf/builtin-top.c tools/perf/util/event.c tools/perf/util/event.h Signed-off-by: Arnaldo Carvalho de Melo --- 7c940c18c57e45910f7dd9a4011c4658cacba4b6 diff --cc tools/perf/builtin-record.c index 07f8d6d852c2,60cac6f92e8b..12e0e41696d9 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@@ -676,16 -756,13 +676,16 @@@ static int __cmd_record(int argc, cons "Check /proc/modules permission or run as root.\n"); if (perf_guest) - perf_session__process_machines(session, event__synthesize_guest_os); + perf_session__process_machines(session, + perf_event__synthesize_guest_os); if (!system_wide) - perf_event__synthesize_thread(target_tid, - process_synthesized_event, - session); - event__synthesize_thread_map(threads, process_synthesized_event, - session); ++ perf_event__synthesize_thread_map(evsel_list->threads, ++ process_synthesized_event, ++ session); else - event__synthesize_threads(process_synthesized_event, session); + perf_event__synthesize_threads(process_synthesized_event, + session); if (realtime_prio) { struct sched_param param; diff --cc tools/perf/builtin-top.c index 210c736e6db4,5a29d9cd9486..c9fd66d4a082 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@@ -875,18 -1305,19 +875,18 @@@ static int __cmd_top(void if (session == NULL) return -ENOMEM; - if (target_tid != -1) - event__synthesize_thread_map(threads, event__process, session); + if (top.target_tid != -1) - perf_event__synthesize_thread(top.target_tid, perf_event__process, - session); ++ perf_event__synthesize_thread_map(top.evlist->threads, ++ perf_event__process, session); else - event__synthesize_threads(event__process, session); + perf_event__synthesize_threads(perf_event__process, session); - for (i = 0; i < cpus->nr; i++) { - group_fd = -1; - list_for_each_entry(counter, &evsel_list, node) - start_counter(i, counter); - } + start_counters(top.evlist); + first = list_entry(top.evlist->entries.next, struct perf_evsel, node); + perf_session__set_sample_type(session, first->attr.sample_type); /* Wait for a minimal set of events before starting the snapshot */ - poll(&event_array[0], nr_poll, 100); + poll(top.evlist->pollfd, top.evlist->nr_fds, 100); perf_session__mmap_read(session); diff --cc tools/perf/util/event.c index 731265f4ad19,50d0a931497a..fbf5754c8866 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@@ -6,8 -6,8 +6,9 @@@ #include "string.h" #include "strlist.h" #include "thread.h" ++#include "thread_map.h" -static const char *event__name[] = { +static const char *perf_event__names[] = { [0] = "TOTAL", [PERF_RECORD_MMAP] = "MMAP", [PERF_RECORD_LOST] = "LOST", @@@ -265,11 -263,12 +266,12 @@@ static int __event__synthesize_thread(u process, session); } - int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, - struct perf_session *session) -int event__synthesize_thread_map(struct thread_map *threads, - event__handler_t process, - struct perf_session *session) ++int perf_event__synthesize_thread_map(struct thread_map *threads, ++ perf_event__handler_t process, ++ struct perf_session *session) { - event_t *comm_event, *mmap_event; + union perf_event *comm_event, *mmap_event; - int err = -1; + int err = -1, thread; comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); if (comm_event == NULL) diff --cc tools/perf/util/event.h index eecb42273d59,cc7b52f9b492..9c35170fb379 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@@ -130,52 -130,50 +130,54 @@@ union perf_event struct event_type_event event_type; struct tracing_data_event tracing_data; struct build_id_event build_id; -} event_t; +}; -void event__print_totals(void); +void perf_event__print_totals(void); struct perf_session; + struct thread_map; -typedef int (*event__handler_synth_t)(event_t *event, +typedef int (*perf_event__handler_synth_t)(union perf_event *event, + struct perf_session *session); +typedef int (*perf_event__handler_t)(union perf_event *event, + struct perf_sample *sample, struct perf_session *session); -typedef int (*event__handler_t)(event_t *event, struct sample_data *sample, - struct perf_session *session); - -int event__synthesize_thread_map(struct thread_map *threads, - event__handler_t process, - struct perf_session *session); -int event__synthesize_threads(event__handler_t process, - struct perf_session *session); -int event__synthesize_kernel_mmap(event__handler_t process, - struct perf_session *session, - struct machine *machine, - const char *symbol_name); - -int event__synthesize_modules(event__handler_t process, - struct perf_session *session, - struct machine *machine); - -int event__process_comm(event_t *self, struct sample_data *sample, - struct perf_session *session); -int event__process_lost(event_t *self, struct sample_data *sample, - struct perf_session *session); -int event__process_mmap(event_t *self, struct sample_data *sample, - struct perf_session *session); -int event__process_task(event_t *self, struct sample_data *sample, + - int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, - struct perf_session *session); ++int perf_event__synthesize_thread_map(struct thread_map *threads, ++ perf_event__handler_t process, ++ struct perf_session *session); +int perf_event__synthesize_threads(perf_event__handler_t process, + struct perf_session *session); +int perf_event__synthesize_kernel_mmap(perf_event__handler_t process, + struct perf_session *session, + struct machine *machine, + const char *symbol_name); + +int perf_event__synthesize_modules(perf_event__handler_t process, + struct perf_session *session, + struct machine *machine); + +int perf_event__process_comm(union perf_event *event, struct perf_sample *sample, + struct perf_session *session); +int perf_event__process_lost(union perf_event *event, struct perf_sample *sample, + struct perf_session *session); +int perf_event__process_mmap(union perf_event *event, struct perf_sample *sample, + struct perf_session *session); +int perf_event__process_task(union perf_event *event, struct perf_sample *sample, + struct perf_session *session); +int perf_event__process(union perf_event *event, struct perf_sample *sample, struct perf_session *session); -int event__process(event_t *event, struct sample_data *sample, - struct perf_session *session); struct addr_location; -int event__preprocess_sample(const event_t *self, struct perf_session *session, - struct addr_location *al, struct sample_data *data, - symbol_filter_t filter); -int event__parse_sample(const event_t *event, struct perf_session *session, - struct sample_data *sample); +int perf_event__preprocess_sample(const union perf_event *self, + struct perf_session *session, + struct addr_location *al, + struct perf_sample *sample, + symbol_filter_t filter); + +const char *perf_event__name(unsigned int id); -const char *event__get_event_name(unsigned int id); +int perf_event__parse_sample(const union perf_event *event, u64 type, + bool sample_id_all, struct perf_sample *sample); #endif /* __PERF_RECORD_H */