summaryrefslogtreecommitdiff
path: root/tools/perf/util/usage.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2012-02-08 09:32:52 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-02-13 22:54:11 -0200
commitb52956c961be3a04182ae7b776623531601e0fb7 (patch)
tree2f7ebf4a910dc8cd9014ac9df59f7e2441a5b034 /tools/perf/util/usage.c
parenteca1c3e3f937307331fd1fd5ee5205e57f2131ca (diff)
perf tools: Allow multiple threads or processes in record, stat, top
Allow a user to collect events for multiple threads or processes using a comma separated list. e.g., collect data on a VM and its vhost thread: perf top -p 21483,21485 perf stat -p 21483,21485 -ddd perf record -p 21483,21485 or monitoring vcpu threads perf top -t 21488,21489 perf stat -t 21488,21489 -ddd perf record -t 21488,21489 Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1328718772-16688-1-git-send-email-dsahern@gmail.com Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/usage.c')
-rw-r--r--tools/perf/util/usage.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c
index d0c013934f30..52bb07c6442a 100644
--- a/tools/perf/util/usage.c
+++ b/tools/perf/util/usage.c
@@ -83,7 +83,7 @@ void warning(const char *warn, ...)
va_end(params);
}
-uid_t parse_target_uid(const char *str, pid_t tid, pid_t pid)
+uid_t parse_target_uid(const char *str, const char *tid, const char *pid)
{
struct passwd pwd, *result;
char buf[1024];
@@ -91,8 +91,8 @@ uid_t parse_target_uid(const char *str, pid_t tid, pid_t pid)
if (str == NULL)
return UINT_MAX;
- /* CPU and PID are mutually exclusive */
- if (tid > 0 || pid > 0) {
+ /* UID and PID are mutually exclusive */
+ if (tid || pid) {
ui__warning("PID/TID switch overriding UID\n");
sleep(1);
return UINT_MAX;