Age | Commit message (Collapse) | Author |
|
bare_trace: Fix get_duration() for window use
|
|
|
|
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.
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
Unregister events
|
|
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>
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|