Messages in this thread Patch in this message |  | | Date | Wed, 6 Feb 2013 20:42:58 +0100 | From | Oleg Nesterov <> | Subject | [PATCH 1/1] perf/tools: Fix "perf record -C... workload" behaviour |
| |
Test-case:
# perf record -e probe_libc:syscall -C0 true true: Terminated
The child process is killed by perf_record__sig_exit(). This is because perf_evlist__prepare_workload() doesn't initialize threads->map[] and then perf_event__synthesize_mmap_events() (silently!) fails. This patch seems to fix the problem, but perhaps we should also move 'pr_err("Couldn't run the workload!\n")' down to 'out_delete_session:', so that the problems like this would be more understandable.
Signed-off-by: Oleg Nesterov <oleg@redhat.com> --- tools/perf/util/evlist.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 7052934..8b3f6ef 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -783,7 +783,7 @@ int perf_evlist__prepare_workload(struct perf_evlist *evlist, exit(-1); } - if (perf_target__none(&opts->target)) + if (!perf_target__has_task(&opts->target)) evlist->threads->map[0] = evlist->workload.pid; close(child_ready_pipe[1]); -- 1.5.5.1
|  |