aboutsummaryrefslogtreecommitdiff
path: root/tests/test_stats_grammar.py
AgeCommit message (Collapse)Author
2017-01-10stats/grammar: Raise helpful error when asked to parse absent eventsBrendan Jackman
If you use the Parser to access events that Trappy understands, but that are not present in the trace, you currently get an inscrutable exception when trying to access `.loc[ self._window[0]:]` on the empty DataFrame in _get_data_frame. Ideally attempting to parse absent events would just return an empty DataFrame, but then we don't know what columns it should have. So instead let's just raise a more helpful error saying that the event is not present.
2017-01-04Update ARM Ltd. copyright to 2017Brendan Jackman
2016-07-13grammar: apply filters to data accessesJavi Merino
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
2016-02-25Merge pull request #144 from JaviMerino/parse_windowKapileshwar Singh
Teach the Parser to apply a window to data accesses
2016-02-24grammar: apply a window to data accessesJavi Merino
Parser() operations happen across the whole trace. While it is possible to filter traces before feeding them to Parser (e.g. trappy.FTrace(window=(1, 2))) the truth is that sometimes you need to parse the trace to know the window in which you want to apply the test. Instead of forcing the user to reload the trace after calculating the window, let Parser() know that it should operate on a small window of trace instead.
2016-02-24grammar: add missing multiplication and exponentiation operatorsJavi Merino
The grammar misses three basic python operators: **, // and %. Add them so that we can use them in tests.
2016-02-24tests: use BareTrace in grammar tests with numeric testsJavi Merino
Some tests only check the numeric operators and don't use the trace at all. Simplify the test by using BareTrace instead of FTrace.
2016-01-05trappy: update copyright to 2016Javi Merino
2015-12-22ftrace: rename Run to FTraceJavi Merino
Run is a very generic and inappropriate name for an object that parses the result of ftrace into a form consumable by python. Rename it to FTrace in preparation for its generalization.
2015-12-10tests: Test if grammar works with parsed eventsKapileshwar Singh
Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
2015-11-28tests: Add test for event_name usage in grammarKapileshwar Singh
Test the grammar API when when the signal is specified as follows: event_name:column Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
2015-11-24stats: Use super indexing for grammarKapileshwar Singh
The current index does not unify indices from different DataFrames in a statement it just picks up the index of the first object to be referenced and reindexes the DataFrames encountered later in the statement using the first encountered index. This can lead to significant data loss if the initial dataframe has a small or non overlapping index. In this patch, we unify the indices before the reindexing happens. Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
2015-09-09tests: check_names is not present in 0.16.0Javi Merino
Bump the check to 0.16.1
2015-09-09tests: Use LooseVersion for pandasJavi Merino
pandas follow a versioning scheme that upsets StrictVersion. For example, the current pandas in Debian Sid is: >>> pandas.__version__ '0.16.2.dev' If we pass this to StrictVersion it raises a ValueError. Use LooseVersion instead. As the docstring for LooseVersion puts it: "Version numbering for anarchists and software realists"
2015-09-07tests: Dont assert dataframe index namesKapileshwar Singh
The parser pivots data and creates nested columns and thus the original column names may not be retained Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
2015-08-17stats: Fix tests for pivots in grammarKapileshwar Singh
Pivoting of the grammar aggregated data requires a reference of the returned data from the parser's solver. This needs to be referenced against a pivot value. Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
2015-08-13trappy: rename to trappyJavi Merino
Change-Id: I7e0e34c9f5565e34629683bb29ab25cf5e737088
2015-08-13cr2: change copyright to Apache 2Javi Merino
Change-Id: Ie505af7efb7526f94b1cc9e37195cbd2e0451b9d
2015-08-13stats: Allow forwarding of classes to grammar parserKapileshwar Singh
Allow the user to pass dynamically registered classes to the parser or alias the existing classes for readability Change-Id: Ieeecae92c5f6f77cc8660fac7bd048e85a6576c9 Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
2015-08-13stats: Introducing Stats GrammarKapileshwar Singh
A grammar that simplifies expressing conditions on trace data Change-Id: Ieef36283e275a3a96ab29e198dc597a840dc0996 Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>