diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2021-05-30 22:22:59 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-06-01 10:03:17 -0300 |
commit | 67e50ce0e32580d90f64556a51b7cb2a872697ca (patch) | |
tree | ea3b3867e600877f6f75f894dc21f13ec0b7c794 /tools/perf/util/scripting-engines | |
parent | cac30400a6d8159e2510a4a258db9c4ac6fbbba5 (diff) | |
download | lwn-67e50ce0e32580d90f64556a51b7cb2a872697ca.tar.gz lwn-67e50ce0e32580d90f64556a51b7cb2a872697ca.zip |
perf scripting: Add perf_session to scripting_context
This is preparation for allowing a script to set the itrace options
for the session if they have not already been set.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20210530192308.7382-5-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/scripting-engines')
-rw-r--r-- | tools/perf/util/scripting-engines/trace-event-perl.c | 5 | ||||
-rw-r--r-- | tools/perf/util/scripting-engines/trace-event-python.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index 5bbf00c1179f..32a721b3e9a5 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -473,11 +473,14 @@ static void run_start_sub(void) /* * Start trace script */ -static int perl_start_script(const char *script, int argc, const char **argv) +static int perl_start_script(const char *script, int argc, const char **argv, + struct perf_session *session) { const char **command_line; int i, err = 0; + scripting_context->session = session; + command_line = malloc((argc + 2) * sizeof(const char *)); command_line[0] = ""; command_line[1] = script; diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index d99f71916af7..02d134b6ba8d 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -1746,7 +1746,8 @@ static void _free_command_line(wchar_t **command_line, int num) /* * Start trace script */ -static int python_start_script(const char *script, int argc, const char **argv) +static int python_start_script(const char *script, int argc, const char **argv, + struct perf_session *session) { struct tables *tables = &tables_global; #if PY_MAJOR_VERSION < 3 @@ -1762,6 +1763,7 @@ static int python_start_script(const char *script, int argc, const char **argv) int i, err = 0; FILE *fp; + scripting_context->session = session; #if PY_MAJOR_VERSION < 3 command_line = malloc((argc + 1) * sizeof(const char *)); command_line[0] = script; |