perf script: Make scripting_max_stack value allow for synthesized callchains
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 25 Sep 2015 13:15:51 +0000 (16:15 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 28 Sep 2015 20:09:41 +0000 (17:09 -0300)
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

index 5c3c02d5af534998c51a81b05b51d6372a9dfb87..8ce1c6bbfa45cf9c98bfa47cf24714a3d4bf290f 100644 (file)
@@ -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());