Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf record: Fix -C option

Currently the -C option does not work for record command, because of the
targets mismatch when synthesizing threads.

Fixing this by using proper target interface for the synthesize
decision.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Reported-by: Oleg Nesterov <oleg@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1361785972-7431-2-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
e4dd45fe d2f32479

+4 -2
+4 -2
tools/perf/builtin-record.c
··· 573 573 perf_event__synthesize_guest_os, tool); 574 574 } 575 575 576 - if (!opts->target.system_wide) 576 + if (perf_target__has_task(&opts->target)) 577 577 err = perf_event__synthesize_thread_map(tool, evsel_list->threads, 578 578 process_synthesized_event, 579 579 machine); 580 - else 580 + else if (perf_target__has_cpu(&opts->target)) 581 581 err = perf_event__synthesize_threads(tool, process_synthesized_event, 582 582 machine); 583 + else /* command specified */ 584 + err = 0; 583 585 584 586 if (err != 0) 585 587 goto out_delete_session;