perf script: Move filter_cpu() earlier
[linux-2.6-microblaze.git] / tools / perf / builtin-script.c
index 57488d6..08a2b5d 100644 (file)
@@ -2191,6 +2191,9 @@ static int process_sample_event(struct perf_tool *tool,
                return 0;
        }
 
+       if (filter_cpu(sample))
+               return 0;
+
        if (machine__resolve(machine, &al, sample) < 0) {
                pr_err("problem processing %d event, skipping it.\n",
                       event->header.type);
@@ -2200,9 +2203,6 @@ static int process_sample_event(struct perf_tool *tool,
        if (al.filtered)
                goto out_put;
 
-       if (filter_cpu(sample))
-               goto out_put;
-
        if (scripting_ops) {
                struct addr_location *addr_al_ptr = NULL;
                struct addr_location addr_al;