Skip to content

grammar: apply filters to data accesses

Javi Merino requested to merge github/fork/JaviMerino/issue_145 into master

Parser() operations happens across the whole event. While it is possible to filter the events and add them back to the trace object with .add_parsed_event(), it is a kludge that we could remove by bringing the concept of filters from the plotters to here.

With this change, we can simplify this:

ftrace = trappy.FTrace(trace_fname)

sbt_dfr = ftrace.sched_boost_task.data_frame
boost_task_rtapp = sbt_dfr[sbt_dfr.comm == rta_task_name]
ftrace.add_parsed_event("boost_task_rtapp", boost_task_rtapp)

analyzer = Analyzer(ftrace, {})
analyzer.assertStatement("blah")

To:

ftrace = trappy.FTrace(trace_fname)
analyzer = Analyzer(ftrace, filters={"comm": "rta_task_name"})
analyzer.assertStatement("blah")

This fixes #145 (closed)

Merge request reports