From: Ingo Molnar Date: Thu, 4 Jun 2009 11:41:22 +0000 (+0200) Subject: perf record/report: Fix PID/COMM handling X-Git-Tag: v2.6.31-rc1~383^2~83 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df97992c6e25ffc66c549c8bc59262dc627c6d17;p=platform%2Fkernel%2Flinux-3.10.git perf record/report: Fix PID/COMM handling Fix two bugs causing lost comm mappings: - initial PID is not 0 but getpid() - when we are unable to handle an mmap event, dont assume the event itself is broken - try to parse the stream. This way we wont lose comm events. Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Corey Ashford Cc: Marcelo Tosatti Cc: Arnaldo Carvalho de Melo Cc: Thomas Gleixner LKML-Reference: Signed-off-by: Ingo Molnar --- diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c index efa2eb4..bf59df5 100644 --- a/Documentation/perf_counter/builtin-record.c +++ b/Documentation/perf_counter/builtin-record.c @@ -430,7 +430,7 @@ static int __cmd_record(int argc, const char **argv) } if (!system_wide) { - open_counters(-1, target_pid != -1 ? target_pid : 0); + open_counters(-1, target_pid != -1 ? target_pid : getpid()); } else for (i = 0; i < nr_cpus; i++) open_counters(i, target_pid); diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c index 86f23f0..ff6f657 100644 --- a/Documentation/perf_counter/builtin-report.c +++ b/Documentation/perf_counter/builtin-report.c @@ -852,7 +852,7 @@ process_mmap_event(event_t *event, unsigned long offset, unsigned long head) if (thread == NULL || map == NULL) { dprintf("problem processing PERF_EVENT_MMAP, skipping event.\n"); - return -1; + return 0; } thread__insert_map(thread, map);