aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2016-03-07 18:38:01 +0000
committerMichele Di Giorgio <michele.digiorgio@arm.com>2016-03-07 18:44:47 +0000
commit612384c42c3f00725f555265b5ba2f92de2c1e99 (patch)
tree082f56e6949d97a183c6b4181ef76c8d8f5fd35b
parentcb53daadd0e199791871c1d261b160b6ea02030d (diff)
downloadtrappy-612384c42c3f00725f555265b5ba2f92de2c1e99.tar.gz
ftrace: match comm names that have a '[' as part of their name
990f925224107 ("run: update special fields regexp to parse task names with a space") fixed parsing task names that had spaces by assuming that no task would have a "[" as part of their name. The day has come that we have found a task with a "[". Set the regexp to match anything up to 16 characters. The kernel seems to limit the task name to 16 characters so this should be safe from now on (until we find another task that breaks the regexp, that is).
-rw-r--r--tests/test_base.py1
-rw-r--r--trappy/ftrace.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_base.py b/tests/test_base.py
index 4184158..0dafb92 100644
--- a/tests/test_base.py
+++ b/tests/test_base.py
@@ -105,6 +105,7 @@ class TestBase(utils_tests.SetupDirectory):
1003.456789 : { 'task': 'AsyncTask #1', 'pid': 3123, 'cpu': 003 },
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 },
}
in_data = """"""
diff --git a/trappy/ftrace.py b/trappy/ftrace.py
index 559df0f..548dd17 100644
--- a/trappy/ftrace.py
+++ b/trappy/ftrace.py
@@ -311,7 +311,7 @@ class FTrace(BareTrace):
return True
return False
- special_fields_regexp = re.compile(r"^\s+([^\[]+)-(\d+)\s+\[(\d+)\]\s+([0-9]+\.[0-9]+):")
+ special_fields_regexp = re.compile(r"^\s+(.{,16})-(\d+)\s+\[(\d+)\]\s+([0-9]+\.[0-9]+):")
start_match = re.compile(r"[A-Za-z0-9_]+=")
for line in ifilter(contains_unique_word, fin):