]> Pileus Git - ~andy/linux/blobdiff - tools/perf/builtin-sched.c
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
[~andy/linux] / tools / perf / builtin-sched.c
index 8d58d9e07a7bd8274049578ca4ab6940f9597a0e..80209df6cfe8df3267050c8bb64f5974748a8ce7 100644 (file)
@@ -21,8 +21,6 @@
 
 static char                    const *input_name = "perf.data";
 
-static u64                     sample_type;
-
 static char                    default_sort_order[] = "avg, max, switch, runtime";
 static char                    *sort_order = default_sort_order;
 
@@ -1613,7 +1611,7 @@ static int process_sample_event(event_t *event, struct perf_session *session)
        struct sample_data data;
        struct thread *thread;
 
-       if (!(sample_type & PERF_SAMPLE_RAW))
+       if (!(session->sample_type & PERF_SAMPLE_RAW))
                return 0;
 
        memset(&data, 0, sizeof(data));
@@ -1621,7 +1619,7 @@ static int process_sample_event(event_t *event, struct perf_session *session)
        data.cpu = -1;
        data.period = -1;
 
-       event__parse_sample(event, sample_type, &data);
+       event__parse_sample(event, session->sample_type, &data);
 
        dump_printf("(IP, %d): %d/%d: %p period: %Ld\n",
                event->header.misc,
@@ -1655,11 +1653,9 @@ static int process_lost_event(event_t *event __used,
        return 0;
 }
 
-static int sample_type_check(u64 type)
+static int sample_type_check(struct perf_session *session __used)
 {
-       sample_type = type;
-
-       if (!(sample_type & PERF_SAMPLE_RAW)) {
+       if (!(session->sample_type & PERF_SAMPLE_RAW)) {
                fprintf(stderr,
                        "No trace sample to read. Did you call perf record "
                        "without -R?");
@@ -1680,7 +1676,6 @@ static int read_events(void)
 {
        int err;
        struct perf_session *session = perf_session__new(input_name, O_RDONLY, 0);
-
        if (session == NULL)
                return -ENOMEM;
 
@@ -1916,7 +1911,7 @@ int cmd_sched(int argc, const char **argv, const char *prefix __used)
        if (!strcmp(argv[0], "trace"))
                return cmd_trace(argc, argv, prefix);
 
-       symbol__init(0);
+       symbol__init();
        if (!strncmp(argv[0], "rec", 3)) {
                return __cmd_record(argc, argv);
        } else if (!strncmp(argv[0], "lat", 3)) {