Open derkling opened 7 years ago
The approach @bjackman suggested was already briefly discussed with @JaviMerino and @credp, and it actually I think it can make much sense... I just not implemented it to push out what I had so far and trigger the discussion. Especially in view of @joelagnel PR #241 ... we need to avoid overlapping features and I was wondering if what I'm proposing here should be better implemented using client callbacks.
What do you think? Do you think it can still be valuable for the SysTrace
parser to support directly this additional parsing logic?
Still investigating @joelagnel's PR but I think SysTrace
should parse it directly.
Sorry for the late review on this. I agree with the discussed approach of using generate_data_dict from the tracer in question. So probably the tracer should pass this function as a callback to the 'class Base' event objects?
@derkling also yes I think there is overlap with #241 but for slightly different purpose, we should definitely use that mechanism, and I think its also good because it might make support for #241 easier. At the moment I am dedicated to solving this systrace parsing problem because we need it for automated trace analysis so lets work together on this and get it done.
I agree with the discussed approach of using generate_data_dict from the tracer in question. So probably the tracer should pass this function as a callback to the 'class Base' event objects?
Why a callback? Can't it just be an override?
Some examples of a custom parser I wrote recently (https://github.com/ARM-software/trappy/pull/271), if it provides any inspiration.
The Android run-time can inject interesting function profiling events from user-space which unfortunately are not formatted using the
key=value
pairs required by TRAPpy.The format string it uses is expected by other tools, e.g. systrace, thus changing the formatting at the source can be much more complex than dealing with in in TRAPpy. Since TRAPpy learnt to parse systrace events, we can try to improve its skills by properly parsing these custom events too.
The basic idea is to add a simple call-back based mechanism which allows a specific parser (i.e.
SysTrace
) to reformat a data string into a TRAPpy compliant format before processing it the usual way.This is an initial prototype which I share to get feedback on the overall approach before going further to develop more complex functionalities. Thus, I've not yet added a test for this feature, however a simple example trace can contain these events:
As additional goals, not yet provided by this prototype, it would be nice to: