diff options
author | Patrick Bellasi <patrick.bellasi@arm.com> | 2016-03-28 16:55:46 +0100 |
---|---|---|
committer | Patrick Bellasi <patrick.bellasi@arm.com> | 2016-03-28 16:55:46 +0100 |
commit | 8a3fdcd2ea43b4e49330f21af433f5be214b7b5a (patch) | |
tree | c3222f7440fce4434e27149cb153f114135b05ee /tests/test_base.py | |
parent | cdae1b21d707108002b691c9bbc6da8b4d806668 (diff) | |
download | trappy-8a3fdcd2ea43b4e49330f21af433f5be214b7b5a.tar.gz |
ftrace: improve special fields matching
612384c (ftrace: match comm names that have a '[' as part of their name)
fixed parsing of special fields to match also names with contains a '['
by forcing a task name to match up to 16 chars.
This regexp seems to not be robust enough for systrace collected traces.
Indeed, not only names can contains the '[' char but, in general, they can
also be longer than 16 chars.
What happen is that, while the linux kernel truncates a task name (comm) to
16 chars, the systrace tool tries its best to "fix" that by fixing truncated
names. Specifically, this is done by the "atrace" agent, e.g.
https://github.com/catapult-project/catapult/blob/0d71be6/systrace/systrace/agents/atrace_agent.py#L583
Thus, in traces collected via systrace/atrace, not only names can contain
the '[' character but they can also be longer than 16 chars.
This patch uses a more generic reg-exp, which is a refinemend of the one
proposed in PR #90, which finally should allow to match task names of any
length and set of used characters.
A meaningless but challenging task name has been added in the test to
proof the patch and ensure a more robust coverage of this "sensible" code.
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Diffstat (limited to 'tests/test_base.py')
-rw-r--r-- | tests/test_base.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_base.py b/tests/test_base.py index 0dafb92..af3ec69 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -106,6 +106,8 @@ class TestBase(utils_tests.SetupDirectory): 1004.456789 : { 'task': 'kworker/1:1H', 'pid': 4123, 'cpu': 004 }, 1005.456789 : { 'task': 'jbd2/sda2-8', 'pid': 5123, 'cpu': 005 }, 1006.456789 : { 'task': 'IntentService[', 'pid': 6123, 'cpu': 005 }, + 1006.456789 : { 'task': r'/system/bin/.s$_?.u- \a]}c\./ef[.12]*[[l]in]ger', + 'pid': 1234, 'cpu': 666 }, } in_data = """""" |