소스 검색

perf report: Adjust sample type validation for synthesized branch stacks

perf report looks at event sample types to determine if branch stacks
have been sampled.  Adjust the validation to know about instruction
tracing options.

This change allows the use of the -b option which otherwise would
complain with an error like:

	Error:
	Selected -b but no branch data. Did you call perf record without -b?
	# To display the perf.data header info,
	# please use --header/--header-only options.
	#

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1443186956-18718-10-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Adrian Hunter 10 년 전
부모
커밋
c7eced63f2
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      tools/perf/builtin-report.c

+ 3 - 0
tools/perf/builtin-report.c

@@ -220,6 +220,9 @@ static int report__setup_sample_type(struct report *rep)
 	     !session->itrace_synth_opts->set))
 	     !session->itrace_synth_opts->set))
 		sample_type |= PERF_SAMPLE_CALLCHAIN;
 		sample_type |= PERF_SAMPLE_CALLCHAIN;
 
 
+	if (session->itrace_synth_opts->last_branch)
+		sample_type |= PERF_SAMPLE_BRANCH_STACK;
+
 	if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) {
 	if (!is_pipe && !(sample_type & PERF_SAMPLE_CALLCHAIN)) {
 		if (sort__has_parent) {
 		if (sort__has_parent) {
 			ui__error("Selected --sort parent, but no "
 			ui__error("Selected --sort parent, but no "