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


Groups > linux.kernel > #1232816 > unrolled thread

[PATCH 20/25] perf script: Make scripting_max_stack value allow for synthesized callchains

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 20/25] perf script: Make scripting_max_stack value allow for synthesized callchains Adrian Hunter <adrian.hunter@intel.com> - 2015-09-25 15:30 +0200
    [tip:perf/core] perf script:   Make scripting_max_stack value allow for synthesized callchains tip-bot for Adrian Hunter <tipbot@zytor.com> - 2015-09-29 10:50 +0200

#1232816 — [PATCH 20/25] perf script: Make scripting_max_stack value allow for synthesized callchains

FromAdrian Hunter <adrian.hunter@intel.com>
Date2015-09-25 15:30 +0200
Subject[PATCH 20/25] perf script: Make scripting_max_stack value allow for synthesized callchains
Message-ID<qcBez-2Eq-49@gated-at.bofh.it>
perf script has a setting to set the maximum stack depth when processing
callchains.  The setting defaults to the hard-coded maximum definition
PERF_MAX_STACK_DEPTH which is 127.

It is possible, when processing instruction traces, to synthesize
callchains.  Synthesized callchains do not have the kernel size
limitation and are whatever size the user requests, although validation
presently prevents the user requested a value greater that 1024.  The
default value is 16.

To allow for synthesized callchains, make the scripting_max_stack value
at least the same size as the synthesized callchain size.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/builtin-script.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 5c3c02d5af53..8ce1c6bbfa45 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1748,6 +1748,10 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
 		}
 	}
 
+	if (itrace_synth_opts.callchain &&
+	    itrace_synth_opts.callchain_sz > scripting_max_stack)
+		scripting_max_stack = itrace_synth_opts.callchain_sz;
+
 	/* make sure PERF_EXEC_PATH is set for scripts */
 	perf_set_argv_exec_path(perf_exec_path());
 
-- 
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]


#1234855 — [tip:perf/core] perf script: Make scripting_max_stack value allow for synthesized callchains

Fromtip-bot for Adrian Hunter <tipbot@zytor.com>
Date2015-09-29 10:50 +0200
Subject[tip:perf/core] perf script: Make scripting_max_stack value allow for synthesized callchains
Message-ID<qdYLO-1nH-57@gated-at.bofh.it>
In reply to#1232816
Commit-ID:  3c5b645faee7afbd417f6127694adbd26778a9eb
Gitweb:     http://git.kernel.org/tip/3c5b645faee7afbd417f6127694adbd26778a9eb
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Fri, 25 Sep 2015 16:15:51 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 28 Sep 2015 17:09:41 -0300

perf script: Make scripting_max_stack value allow for synthesized callchains

perf script has a setting to set the maximum stack depth when processing
callchains.  The setting defaults to the hard-coded maximum definition
PERF_MAX_STACK_DEPTH which is 127.

It is possible, when processing instruction traces, to synthesize
callchains.  Synthesized callchains do not have the kernel size
limitation and are whatever size the user requests, although validation
presently prevents the user requested a value greater that 1024.  The
default value is 16.

To allow for synthesized callchains, make the scripting_max_stack value
at least the same size as the synthesized callchain size.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1443186956-18718-21-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-script.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 5c3c02d..8ce1c6b 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1748,6 +1748,10 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused)
 		}
 	}
 
+	if (itrace_synth_opts.callchain &&
+	    itrace_synth_opts.callchain_sz > scripting_max_stack)
+		scripting_max_stack = itrace_synth_opts.callchain_sz;
+
 	/* make sure PERF_EXEC_PATH is set for scripts */
 	perf_set_argv_exec_path(perf_exec_path());
 
--
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