Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1232813 > unrolled thread

[PATCH 09/25] perf report: Adjust sample type validation for synthesized branch stacks

Started byAdrian Hunter <adrian.hunter@intel.com>
First post2015-09-25 15:30 +0200
Last post2015-09-29 10:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 09/25] perf report: Adjust sample type validation for synthesized branch stacks Adrian Hunter <adrian.hunter@intel.com> - 2015-09-25 15:30 +0200
    [tip:perf/core] perf report:   Adjust sample type validation for synthesized branch stacks tip-bot for Adrian Hunter <tipbot@zytor.com> - 2015-09-29 10:50 +0200

#1232813 — [PATCH 09/25] perf report: Adjust sample type validation for synthesized branch stacks

FromAdrian Hunter <adrian.hunter@intel.com>
Date2015-09-25 15:30 +0200
Subject[PATCH 09/25] perf report: Adjust sample type validation for synthesized branch stacks
Message-ID<qcBey-2Eq-45@gated-at.bofh.it>
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>
---
 tools/perf/builtin-report.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0d53b485a87b..7af35af5a5e5 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -220,6 +220,9 @@ static int report__setup_sample_type(struct report *rep)
 	     !session->itrace_synth_opts->set))
 		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 (sort__has_parent) {
 			ui__error("Selected --sort parent, but no "
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1234829 — [tip:perf/core] perf report: Adjust sample type validation for synthesized branch stacks

Fromtip-bot for Adrian Hunter <tipbot@zytor.com>
Date2015-09-29 10:50 +0200
Subject[tip:perf/core] perf report: Adjust sample type validation for synthesized branch stacks
Message-ID<qdYLL-1nH-1@gated-at.bofh.it>
In reply to#1232813
Commit-ID:  c7eced63f2f67bd06ceb2269062416db9d81d29d
Gitweb:     http://git.kernel.org/tip/c7eced63f2f67bd06ceb2269062416db9d81d29d
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Fri, 25 Sep 2015 16:15:40 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 28 Sep 2015 16:54:21 -0300

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>
---
 tools/perf/builtin-report.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0d53b48..7af35af 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -220,6 +220,9 @@ static int report__setup_sample_type(struct report *rep)
 	     !session->itrace_synth_opts->set))
 		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 (sort__has_parent) {
 			ui__error("Selected --sort parent, but no "
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web