lkml.org 
[lkml]   [2015]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 19/25] perf scripting python: Allow for max_stack greater than PERF_MAX_STACK_DEPTH
    Date
    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>
    ---
    tools/perf/builtin-script.c | 2 +-
    tools/perf/util/scripting-engines/trace-event-python.c | 2 +-
    tools/perf/util/trace-event.h | 2 ++
    3 files changed, 4 insertions(+), 2 deletions(-)

    diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
    index a65b498df097..5c3c02d5af53 100644
    --- a/tools/perf/builtin-script.c
    +++ b/tools/perf/builtin-script.c
    @@ -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,
    diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
    index aa9e1257c1ee..a8e825fca42a 100644
    --- a/tools/perf/util/scripting-engines/trace-event-python.c
    +++ b/tools/perf/util/scripting-engines/trace-event-python.c
    @@ -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;
    }
    diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
    index da6cc4cc2a4f..b85ee55cca0c 100644
    --- a/tools/perf/util/trace-event.h
    +++ b/tools/perf/util/trace-event.h
    @@ -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);
    --
    1.9.1


    \
     
     \ /
      Last update: 2015-09-25 15:41    [W:4.708 / U:0.068 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site