aboutsummaryrefslogtreecommitdiff
path: root/tests/test_ftrace.py
AgeCommit message (Collapse)Author
2017-09-18Merge pull request #268 from valschneider/get_duration-fixBrendan Jackman
bare_trace: Fix get_duration() for window use
2017-09-18tests/test_ftrace: Add window duration testsValentin Schneider
2017-08-17bare_trace: fix signature of generate_data_dictMichele Di Giorgio
Classes that implement the generate_data_dict method have an additional argument to the signature. This leads to errors in case the base class method is called with the additional argument. This patch also adds two tests for FTrace and SysTrace parsing.
2017-06-29Add support for trace event processing using callbacksConnor O'Brien
Some trace analysis tasks are most easily expressed by iterating over events in chronological order. Add an apply_callbacks() 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> Reviewed-by: KP Singh <kpsingh@google.com>
2017-06-27trappy/test: fix tests for removal of raw.txt trace parsingChris Redpath
tests/test_ftrace.py: Stop creating and checking for existence of <trace>.raw.txt files. tests/test_sched.py: Stop creating raw.txt file. tests/raw_trace.raw.txt: Remove the file as it is no longer needed. The raw-formatted events are moved into raw_trace.txt tests/raw_trace.txt: Replace the formatted sched_switch events with raw formatted events, like we get when parsing a trace file. tests/trace_empty.txt: Remove the default sched_ events we would expect to parse in raw format - since we want to have events here which we are not looking for. Signed-off-by: Chris Redpath <chris.redpath@arm.com> Reviewed-by: KP Singh <kpsingh@google.com>
2017-06-27trappy/Parsing: Split trace class init into two phasesChris Redpath
This patch set is to modify the parsing step so that we don't need to build a raw and a formatted trace file. To do that, we need to know which events should have raw output and which should use their default formatting. The events indicate which are which, but currently we generate the trace files before we populate the events. Splitting the initialisation into two parts means that we can populate the events so that a later patch can create the text trace with each event either formatted or raw as required. Signed-off-by: Chris Redpath <chris.redpath@arm.com> Reviewed-by: KP Singh <kpsingh@google.com>
2017-06-15trappy/tests: Fix test for checking invalid lineJoel Fernandes
Due to the recent patches to skip invalid lines using a regex, this test case fails. Fix it by appending the invalid line to the end of the test trace. Signed-off-by: Joel Fernandes <joelaf@google.com> Reviewed-by: KP Singh <kpsingh@google.com>
2017-05-13ftrace: Improve error messages when failing to parse traceBrendan Jackman
2017-01-04Update ARM Ltd. copyright to 2017Brendan Jackman
2016-03-08tests: avoid matplotlib warning when running the testsuiteJavi Merino
When you try to plot a dataframe with only one index, matplotlib complains: ---8<--- /usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py:2787: UserWarning: Attempting to set identical left==right re sults in singular transformations; automatically expanding. left=0.0, right=0.0 'left=%s, right=%s') % (left, right)) ---8<--- Change the timestamp of the second event to make it more realistic and make sure that the dataframe that is plotted has more than one row.
2016-01-05trappy: partially revert 8da875103915Javi Merino
In 8da875103915 ("ftrace: fix error with only one actor") we made ftrace.plot_allfreqs() treat the case when there's only one actor a special case that ignored the requirement of the "ax" parameter being an array. The documentation of plot_allfreqs() is correct: if ax is not None, it must be an array of the same size as map_label. Revert the change to ftrace.py and fix the test to match what the documentation says.
2016-01-05trappy: update copyright to 2016Javi Merino
2016-01-05Merge pull request #119 from JaviMerino/unregister_eventsKapileshwar Singh
Unregister events
2015-12-27ftrace: fix error with only one actorLeo Yan
When system has only one actor and call method trappy.summary_plots, it will report failure "zip argument #1 must support iteration". This failure is cause by parsing allfreqs plots. Python always pass by value, so when there have only one actor the axis will pass by value and it's not a array type anymore. So finally zip will report it cannot support iteration. So in this case convert axis to array type. Signed-off-by: Leo Yan <leo.yan@linaro.org>
2015-12-22tests: unregister dynamically created classes in the testsJavi Merino
The classes registered dynamically in the tests persist across the execution of the testsuite. That makes the testsuite sometimes fail if a test has added a class to the sched scope and test_ftrace_has_all_classes_scope_sched() run concurrently. Unregister the dynamic events when the tests that register them finish.
2015-12-22dynamic: ensure dynamic methods refer to ftraceJavi Merino
Now that we can have traces coming from sources other than ftrace, rename register_dynamic() and register_class() to register_dynamic_ftrace() and register_ftrace_parser() to make it clear that they are only available for traces coming from ftrace.
2015-12-22bare_trace: abstract some of the basic FTrace functionality to a generic ↵Javi Merino
BareTrace class Part of the functionality in FTrace is generic. In order to make the rest of trappy less dependent on FTrace, move the generic parts to a new BareTrace class and inherit from it.
2015-12-22ftrace: Learn again to normalize the time against an arbitrary basetimeJavi Merino
In the past ftrace.normalize_time() accepted an arbitrary basetime parameter. This was lost in c79eccd5370e ("run: drop get_basetime() method") but the documentation of normalize_time() still talks about the basetime parameter. Recover it.
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.