diff options
author | Thomas Renninger <trenn@suse.de> | 2011-02-27 16:36:46 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-02-28 02:56:15 -0500 |
commit | 54b08f5f90feebc9756d96e0c7bf2fdffe4af7c3 (patch) | |
tree | 1187a88a0bd3250b2093086e961403e2cb767b25 /tools/perf/builtin-timechart.c | |
parent | e853072055a01d8b3c4dc89d231649189454c4f1 (diff) |
perf timechart: Fix max number of cpus
Currently numcpus is determined in pid_put_sample which is only
called on sched_switch/sched_wakeup sample processing.
On a machine with a lot cpus I often saw the last cpu missing.
Check for (max) numcpus on every event happening and in the
beginning. -> fixes the issue for me.
Signed-off-by: Thomas Renninger <trenn@suse.de>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: lenb@kernel.org
LKML-Reference: <1298842606-55712-6-git-send-email-trenn@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-timechart.c')
-rw-r--r-- | tools/perf/builtin-timechart.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 746cf03cb05d..0ace786e83e0 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -264,9 +264,6 @@ pid_put_sample(int pid, int type, unsigned int cpu, u64 start, u64 end) | |||
264 | c->start_time = start; | 264 | c->start_time = start; |
265 | if (p->start_time == 0 || p->start_time > start) | 265 | if (p->start_time == 0 || p->start_time > start) |
266 | p->start_time = start; | 266 | p->start_time = start; |
267 | |||
268 | if (cpu > numcpus) | ||
269 | numcpus = cpu; | ||
270 | } | 267 | } |
271 | 268 | ||
272 | #define MAX_CPUS 4096 | 269 | #define MAX_CPUS 4096 |
@@ -511,6 +508,9 @@ static int process_sample_event(event_t *event __used, | |||
511 | if (!event_str) | 508 | if (!event_str) |
512 | return 0; | 509 | return 0; |
513 | 510 | ||
511 | if (sample->cpu > numcpus) | ||
512 | numcpus = sample->cpu; | ||
513 | |||
514 | if (strcmp(event_str, "power:cpu_idle") == 0) { | 514 | if (strcmp(event_str, "power:cpu_idle") == 0) { |
515 | struct power_processor_entry *ppe = (void *)te; | 515 | struct power_processor_entry *ppe = (void *)te; |
516 | if (ppe->state == (u32)PWR_EVENT_EXIT) | 516 | if (ppe->state == (u32)PWR_EVENT_EXIT) |