perf scripting python: Allow for max_stack greater than PERF_MAX_STACK_DEPTH
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 25 Sep 2015 13:15:50 +0000 (16:15 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 28 Sep 2015 20:09:12 +0000 (17:09 -0300)
Use the scripting_max_stack value to allow for values greater than
PERF_MAX_STACK_DEPTH.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1443186956-18718-20-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-script.c
tools/perf/util/scripting-engines/trace-event-python.c
tools/perf/util/trace-event.h

index a65b498df097b0fc23713791ebb6012af07766ce..5c3c02d5af534998c51a81b05b51d6372a9dfb87 100644 (file)
@@ -33,7 +33,7 @@ static bool                   nanosecs;
 static const char              *cpu_list;
 static DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
 
-static unsigned int scripting_max_stack = PERF_MAX_STACK_DEPTH;
+unsigned int scripting_max_stack = PERF_MAX_STACK_DEPTH;
 
 enum perf_output_field {
        PERF_OUTPUT_COMM            = 1U << 0,
index aa9e1257c1ee85d515bb5a90e4c3c8640e24b276..a8e825fca42af9aeab46de300855e5e22ea8ffc0 100644 (file)
@@ -319,7 +319,7 @@ static PyObject *python_process_callchain(struct perf_sample *sample,
 
        if (thread__resolve_callchain(al->thread, evsel,
                                      sample, NULL, NULL,
-                                     PERF_MAX_STACK_DEPTH) != 0) {
+                                     scripting_max_stack) != 0) {
                pr_err("Failed to resolve callchain. Skipping\n");
                goto exit;
        }
index da6cc4cc2a4f48eebfa0e59a3001e9e61d8484ee..b85ee55cca0cc943c75e2ea348b932236ff0618f 100644 (file)
@@ -78,6 +78,8 @@ struct scripting_ops {
        int (*generate_script) (struct pevent *pevent, const char *outfile);
 };
 
+extern unsigned int scripting_max_stack;
+
 int script_spec_register(const char *spec, struct scripting_ops *ops);
 
 void setup_perl_scripting(void);