diff options
author | David Ahern <dsahern@gmail.com> | 2012-02-08 11:32:52 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-02-13 19:54:11 -0500 |
commit | b52956c961be3a04182ae7b776623531601e0fb7 (patch) | |
tree | 2f7ebf4a910dc8cd9014ac9df59f7e2441a5b034 /tools/perf/util/evlist.c | |
parent | eca1c3e3f937307331fd1fd5ee5205e57f2131ca (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/evlist.c')
-rw-r--r-- | tools/perf/util/evlist.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index a57a8cfc5d90..5c61dc57d7c7 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -593,15 +593,15 @@ int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, | |||
593 | return perf_evlist__mmap_per_cpu(evlist, prot, mask); | 593 | return perf_evlist__mmap_per_cpu(evlist, prot, mask); |
594 | } | 594 | } |
595 | 595 | ||
596 | int perf_evlist__create_maps(struct perf_evlist *evlist, pid_t target_pid, | 596 | int perf_evlist__create_maps(struct perf_evlist *evlist, const char *target_pid, |
597 | pid_t target_tid, uid_t uid, const char *cpu_list) | 597 | const char *target_tid, uid_t uid, const char *cpu_list) |
598 | { | 598 | { |
599 | evlist->threads = thread_map__new(target_pid, target_tid, uid); | 599 | evlist->threads = thread_map__new_str(target_pid, target_tid, uid); |
600 | 600 | ||
601 | if (evlist->threads == NULL) | 601 | if (evlist->threads == NULL) |
602 | return -1; | 602 | return -1; |
603 | 603 | ||
604 | if (uid != UINT_MAX || (cpu_list == NULL && target_tid != -1)) | 604 | if (uid != UINT_MAX || (cpu_list == NULL && target_tid)) |
605 | evlist->cpus = cpu_map__dummy_new(); | 605 | evlist->cpus = cpu_map__dummy_new(); |
606 | else | 606 | else |
607 | evlist->cpus = cpu_map__new(cpu_list); | 607 | evlist->cpus = cpu_map__new(cpu_list); |
@@ -820,7 +820,7 @@ int perf_evlist__prepare_workload(struct perf_evlist *evlist, | |||
820 | exit(-1); | 820 | exit(-1); |
821 | } | 821 | } |
822 | 822 | ||
823 | if (!opts->system_wide && opts->target_tid == -1 && opts->target_pid == -1) | 823 | if (!opts->system_wide && !opts->target_tid && !opts->target_pid) |
824 | evlist->threads->map[0] = evlist->workload.pid; | 824 | evlist->threads->map[0] = evlist->workload.pid; |
825 | 825 | ||
826 | close(child_ready_pipe[1]); | 826 | close(child_ready_pipe[1]); |