Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux...
authorIngo Molnar <mingo@elte.hu>
Thu, 5 Aug 2010 06:46:15 +0000 (08:46 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 5 Aug 2010 06:46:15 +0000 (08:46 +0200)
kernel/trace/trace_kprobe.c
tools/perf/builtin-top.c
tools/perf/util/event.c
tools/perf/util/event.h

index 1b79d1c15726b03f6a0abfe55b340c7cd9860767..8b27c9849b427905ea9a5ef83864a88526afe405 100644 (file)
@@ -925,14 +925,17 @@ static int create_trace_probe(int argc, char **argv)
                        pr_info("Delete command needs an event name.\n");
                        return -EINVAL;
                }
+               mutex_lock(&probe_lock);
                tp = find_probe_event(event, group);
                if (!tp) {
+                       mutex_unlock(&probe_lock);
                        pr_info("Event %s/%s doesn't exist.\n", group, event);
                        return -ENOENT;
                }
                /* delete an event */
                unregister_trace_probe(tp);
                free_trace_probe(tp);
+               mutex_unlock(&probe_lock);
                return 0;
        }
 
index 1e8e92e317b900fa4765427b80de8bd8c0cce534..b513e40974f46bf45f816d658d78d574762f5b17 100644 (file)
@@ -1082,26 +1082,6 @@ static void event__process_sample(const event_t *self,
        }
 }
 
-static int event__process(event_t *event, struct perf_session *session)
-{
-       switch (event->header.type) {
-       case PERF_RECORD_COMM:
-               event__process_comm(event, session);
-               break;
-       case PERF_RECORD_MMAP:
-               event__process_mmap(event, session);
-               break;
-       case PERF_RECORD_FORK:
-       case PERF_RECORD_EXIT:
-               event__process_task(event, session);
-               break;
-       default:
-               break;
-       }
-
-       return 0;
-}
-
 struct mmap_data {
        int                     counter;
        void                    *base;
index 6b0db5577929111abb006f444343c05c1dc31069..dab9e754a28103b1727d6dee29669aaa2d7f89da 100644 (file)
@@ -151,7 +151,6 @@ static int event__synthesize_mmap_events(pid_t pid, pid_t tgid,
                        continue;
                pbf += n + 3;
                if (*pbf == 'x') { /* vm_exec */
-                       u64 vm_pgoff;
                        char *execname = strchr(bf, '/');
 
                        /* Catch VDSO */
@@ -162,12 +161,7 @@ static int event__synthesize_mmap_events(pid_t pid, pid_t tgid,
                                continue;
 
                        pbf += 3;
-                       n = hex2u64(pbf, &vm_pgoff);
-                       /* pgoff is in bytes, not pages */
-                       if (n >= 0)
-                               ev.mmap.pgoff = vm_pgoff << getpagesize();
-                       else
-                               ev.mmap.pgoff = 0;
+                       n = hex2u64(pbf, &ev.mmap.pgoff);
 
                        size = strlen(execname);
                        execname[size - 1] = '\0'; /* Remove \n */
@@ -554,6 +548,26 @@ int event__process_task(event_t *self, struct perf_session *session)
        return 0;
 }
 
+int event__process(event_t *event, struct perf_session *session)
+{
+       switch (event->header.type) {
+       case PERF_RECORD_COMM:
+               event__process_comm(event, session);
+               break;
+       case PERF_RECORD_MMAP:
+               event__process_mmap(event, session);
+               break;
+       case PERF_RECORD_FORK:
+       case PERF_RECORD_EXIT:
+               event__process_task(event, session);
+               break;
+       default:
+               break;
+       }
+
+       return 0;
+}
+
 void thread__find_addr_map(struct thread *self,
                           struct perf_session *session, u8 cpumode,
                           enum map_type type, pid_t pid, u64 addr,
index 887ee63bbb625a8222d66e9741526f0f63d08fdf..8e790dae702625aa564594bee1dd52618b94f8d8 100644 (file)
@@ -154,6 +154,7 @@ int event__process_comm(event_t *self, struct perf_session *session);
 int event__process_lost(event_t *self, struct perf_session *session);
 int event__process_mmap(event_t *self, struct perf_session *session);
 int event__process_task(event_t *self, struct perf_session *session);
+int event__process(event_t *event, struct perf_session *session);
 
 struct addr_location;
 int event__preprocess_sample(const event_t *self, struct perf_session *session,