mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
perf scripting: Add scripting_context__update()
Move scripting_context update to a separate function and add the arguments of ->process_event() to it. This prepares the way for adding more methods to the perf_trace_context module, by providing the context information that they will need. 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-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
6337bd0c91
commit
cac30400a6
4 changed files with 38 additions and 7 deletions
|
@ -897,9 +897,6 @@ static void python_process_tracepoint(struct perf_sample *sample,
|
|||
s = nsecs / NSEC_PER_SEC;
|
||||
ns = nsecs - s * NSEC_PER_SEC;
|
||||
|
||||
scripting_context->event_data = data;
|
||||
scripting_context->pevent = evsel->tp_format->tep;
|
||||
|
||||
context = _PyCapsule_New(scripting_context, NULL, NULL);
|
||||
|
||||
PyTuple_SetItem(t, n++, _PyUnicode_FromString(handler_name));
|
||||
|
@ -1403,6 +1400,8 @@ static void python_process_event(union perf_event *event,
|
|||
{
|
||||
struct tables *tables = &tables_global;
|
||||
|
||||
scripting_context__update(scripting_context, event, sample, evsel, al, addr_al);
|
||||
|
||||
switch (evsel->core.attr.type) {
|
||||
case PERF_TYPE_TRACEPOINT:
|
||||
python_process_tracepoint(sample, evsel, al, addr_al);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue