ARM-software / trappy

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

grammar: apply filters to data accesses #211

Closed JaviMerino closed 8 years ago

JaviMerino commented 8 years ago

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

sinkap commented 8 years ago

Will review this later today. But thanks for adding this.

mdigiorgio commented 8 years ago

LGTM I tested it with schedtune smoke test. :+1: