aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-06-04 07:41:22 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-04 07:41:37 -0400
commitdf97992c6e25ffc66c549c8bc59262dc627c6d17 (patch)
tree5d666762c78320adeb2e15fe362c3b2909e0b66b
parent3aff27ca84fa94311ae99189e54fed8d83b69fc1 (diff)
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 <a.p.zijlstra@chello.nl> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--Documentation/perf_counter/builtin-record.c2
-rw-r--r--Documentation/perf_counter/builtin-report.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c
index efa2eb498e9c..bf59df5bddf3 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)
430 } 430 }
431 431
432 if (!system_wide) { 432 if (!system_wide) {
433 open_counters(-1, target_pid != -1 ? target_pid : 0); 433 open_counters(-1, target_pid != -1 ? target_pid : getpid());
434 } else for (i = 0; i < nr_cpus; i++) 434 } else for (i = 0; i < nr_cpus; i++)
435 open_counters(i, target_pid); 435 open_counters(i, target_pid);
436 436
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c
index 86f23f0991f1..ff6f657476a9 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)
852 852
853 if (thread == NULL || map == NULL) { 853 if (thread == NULL || map == NULL) {
854 dprintf("problem processing PERF_EVENT_MMAP, skipping event.\n"); 854 dprintf("problem processing PERF_EVENT_MMAP, skipping event.\n");
855 return -1; 855 return 0;
856 } 856 }
857 857
858 thread__insert_map(thread, map); 858 thread__insert_map(thread, map);