Merge remote branch 'acme/perf/urgent' into perf/core
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 11 Feb 2011 13:45:54 +0000 (11:45 -0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 11 Feb 2011 13:45:54 +0000 (11:45 -0200)
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 <acme@redhat.com>
1  2 
tools/perf/builtin-record.c
tools/perf/builtin-top.c
tools/perf/util/event.c
tools/perf/util/event.h

index 07f8d6d852c296fe7dc5dd83ca44f2d6bbfb0c93,60cac6f92e8b8d17bf165a6a592c6653f6141a96..12e0e41696d98e95368e242c77007d87a7f3826a
@@@ -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;
index 210c736e6db4bd89c4b508acf457f0d0ab978d1e,5a29d9cd948621a9e357c27a156baa3bff8b5556..c9fd66d4a08242ba80f9f5357fd78e2acfa1f551
@@@ -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);
  
index 731265f4ad19bd7558ee1d36975e6a52702ba5a3,50d0a931497abbdc0151ca4b0a3a040b88c1b036..fbf5754c8866cefee3fcd326741a210b5fdc186c
@@@ -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)
index eecb42273d59dd6ccae41f774ca6d91766d58ec6,cc7b52f9b49265cf4097a3154568fb850f55cc60..9c35170fb379599713a6458c07023ccba8da2b2b
@@@ -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 */