ARM-software / trappy

This repository has moved to https://gitlab.arm.com/tooling/trappy
Apache License 2.0
60 stars 39 forks source link

Add support for trace event processing using callbacks #254

Closed cobrien7 closed 7 years ago

cobrien7 commented 7 years ago

Some trace analysis tasks are most easily expressed by iterating over events in chronological order. Add a run_custom_analysis() method to the GenericFTrace class that will run user-defined functions on trace events in the order they occurred.

Signed-off-by: Connor O'Brien connoro@google.com

cobrien7 commented 7 years ago

This patch should work exactly the same as https://github.com/ARM-software/lisa/pull/418, except that the new method is added to GenericFTrace instead of the LISA Trace class.

joelagnel commented 7 years ago

Hi Connor, Is it possible to not use the word 'analysis' in the core function? If I understand correctly, trappy is used for data generation and visualization, analysis usage of this will be in LISA. Also this feature may be used for https://github.com/ARM-software/trappy/issues/250. Considering this, I would call it run_event_callbacks

joelagnel commented 7 years ago

CC @cobrien7

derkling commented 7 years ago

I would say that TRAPpy is mainly for data generation... while analysis AND visualisation is mainly in LISA. We know have some plotting methods in TRAPpy which are still there mainly for backward compatibility reasons., but future bits should be better organised according to a schema where everything which is not "generic DF generation and processing" should not be in TRAPpy.

derkling commented 7 years ago

Regarding the function name, what about something like a quite generic process_events?

joelagnel commented 7 years ago

Hmm @derkling I prefer a more explicit name like run_event_callbacks. @cobrien7 could you update this PR with the change?

joelagnel commented 7 years ago

Never mind, so @cobrien7 did change it. @sinkap I guess over to you then.

joelagnel commented 7 years ago

apply_callbacks sounds good to me.

sinkap commented 7 years ago

Done! :+1: