]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/builtin-timechart.c
Merge commit 'v2.6.39-rc3' into for-2.6.39
[karo-tx-linux.git] / tools / perf / builtin-timechart.c
index 746cf03cb05d86a2796c88fca27930ca6e0a8894..aa26f4d66d1020eb075942dc42fdc874d7dfaddc 100644 (file)
@@ -264,9 +264,6 @@ pid_put_sample(int pid, int type, unsigned int cpu, u64 start, u64 end)
                c->start_time = start;
        if (p->start_time == 0 || p->start_time > start)
                p->start_time = start;
-
-       if (cpu > numcpus)
-               numcpus = cpu;
 }
 
 #define MAX_CPUS 4096
@@ -276,21 +273,24 @@ static int cpus_cstate_state[MAX_CPUS];
 static u64 cpus_pstate_start_times[MAX_CPUS];
 static u64 cpus_pstate_state[MAX_CPUS];
 
-static int process_comm_event(event_t *event, struct sample_data *sample __used,
+static int process_comm_event(union perf_event *event,
+                             struct perf_sample *sample __used,
                              struct perf_session *session __used)
 {
        pid_set_comm(event->comm.tid, event->comm.comm);
        return 0;
 }
 
-static int process_fork_event(event_t *event, struct sample_data *sample __used,
+static int process_fork_event(union perf_event *event,
+                             struct perf_sample *sample __used,
                              struct perf_session *session __used)
 {
        pid_fork(event->fork.pid, event->fork.ppid, event->fork.time);
        return 0;
 }
 
-static int process_exit_event(event_t *event, struct sample_data *sample __used,
+static int process_exit_event(union perf_event *event,
+                             struct perf_sample *sample __used,
                              struct perf_session *session __used)
 {
        pid_exit(event->fork.pid, event->fork.time);
@@ -486,8 +486,9 @@ static void sched_switch(int cpu, u64 timestamp, struct trace_entry *te)
 }
 
 
-static int process_sample_event(event_t *event __used,
-                               struct sample_data *sample,
+static int process_sample_event(union perf_event *event __used,
+                               struct perf_sample *sample,
+                               struct perf_evsel *evsel __used,
                                struct perf_session *session)
 {
        struct trace_entry *te;
@@ -506,11 +507,24 @@ static int process_sample_event(event_t *event __used,
                struct power_entry_old *peo;
                peo = (void *)te;
 #endif
+               /*
+                * FIXME: use evsel, its already mapped from id to perf_evsel,
+                * remove perf_header__find_event infrastructure bits.
+                * Mapping all these "power:cpu_idle" strings to the tracepoint
+                * ID and then just comparing against evsel->attr.config.
+                *
+                * e.g.:
+                *
+                * if (evsel->attr.config == power_cpu_idle_id)
+                */
                event_str = perf_header__find_event(te->type);
 
                if (!event_str)
                        return 0;
 
+               if (sample->cpu > numcpus)
+                       numcpus = sample->cpu;
+
                if (strcmp(event_str, "power:cpu_idle") == 0) {
                        struct power_processor_entry *ppe = (void *)te;
                        if (ppe->state == (u32)PWR_EVENT_EXIT)