perf tools: Check more combinations of PID/TID, UID and CPU switches
[linux-2.6-microblaze.git] / tools / perf / util / usage.c
index 0a1a885..228f0a5 100644 (file)
@@ -132,4 +132,18 @@ void perf_target__validate(struct perf_target *target)
                sleep(1);
                target->uid_str = NULL;
        }
+
+       /* UID and CPU are mutually exclusive */
+       if (target->uid_str && target->cpu_list) {
+               ui__warning("UID switch overriding CPU\n");
+               sleep(1);
+               target->cpu_list = NULL;
+       }
+
+       /* PID/UID and SYSTEM are mutually exclusive */
+       if ((target->tid || target->uid_str) && target->system_wide) {
+               ui__warning("PID/TID/UID switch overriding CPU\n");
+               sleep(1);
+               target->system_wide = false;
+       }
 }