lkml.org 
[lkml]   [2017]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: perf script: Question: Python trace processing script contains the tid of the process in the common_pid attribute
Em Wed, Jul 05, 2017 at 04:51:26PM -0700, Arun Kalyanasundaram escreveu:
> Arnaldo:
> So, I think what you are suggesting is, we should check the signature
> of the hook to determine if it has an additional attribute and only
> then should we provide the dict. May be something like this:
>
> PyObject* custom_dict = PyObject_GetAttrString(handler, "other_fields_dict");
> if (custom_dict)
> //Add dict to PyTuple
>
> Do you think this would be a better approach?

I think that we should provide as much as possible the common info about
a sample at all the sample processing routines, be it the initial,
tracepoint specific one, the one for non-tracepoint samples and the
trace_unhandled one.

So scripts not using this optional argument will work with older
versions of the perf tool as well as with new ones that support it.

One could say that to use a script that wants this optional argument, a
new enough version of the tool is required.

So yeah, I think this is a better approach. The details of how to best
do this method signature signing need to be figured out, of course.

Thanks for working on this!

- Arnaldo

\
 
 \ /
  Last update: 2017-07-07 17:19    [W:0.044 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site