Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4dd45fe authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarJiri Olsa <jolsa@redhat.com>
Reported-by: default avatarOleg 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent d2f32479
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -573,13 +573,15 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
					 perf_event__synthesize_guest_os, tool);
	}

	if (!opts->target.system_wide)
	if (perf_target__has_task(&opts->target))
		err = perf_event__synthesize_thread_map(tool, evsel_list->threads,
						  process_synthesized_event,
						  machine);
	else
	else if (perf_target__has_cpu(&opts->target))
		err = perf_event__synthesize_threads(tool, process_synthesized_event,
					       machine);
	else /* command specified */
		err = 0;

	if (err != 0)
		goto out_delete_session;