Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,26 @@ public void testParseIrqRaise() {
assertEquals("RCU", field.getContent().getFieldValue(String.class, "action"));
}

/**
* Testing of parse line with a line that starts with parentheses
*/
@Test
public void testParseStartsWithParentheses() {
String line = "(udev-worker)-299 [000] d.h1. 73.294605: sched_stat_runtime: comm=systemd-udevd pid=299 runtime=65790 [ns] vruntime=6269486605 [ns]";

GenericFtraceField field = GenericFtraceField.parseLine(line);

assertNotNull(field);
assertEquals(4, field.getContent().getFields().size());
assertEquals((Integer) 0, field.getCpu());
assertEquals((Integer) 299, field.getPid());
assertEquals("sched_stat_runtime", field.getName());

assertEquals("systemd-udevd", field.getContent().getFieldValue(String.class, "comm"));
assertEquals((Long) 65790L, field.getContent().getFieldValue(Long.class, "runtime"));
assertEquals((Long) 6269486605L, field.getContent().getFieldValue(Long.class, "vruntime"));
}

/**
* Testing of parse line with odd comm names
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public interface IGenericFtraceConstants {
* Pattern to match the rest of the event (event name, event fields), like:
* sched_switch: prev_comm=kworker/u16:6 prev_pid=214 prev_prio=120 prev_state=R+ ==> next_comm=swapper/2 next_pid=0 next_prio=120
*/
"(?<name>\\w+)(?<separator>:\\s+|\\(|\\s+->\\s+)(?<data>[^\\)]*)(\\))?" //$NON-NLS-1$
"(?<name>\\w+)(?<separator>:\\s+|\\(|\\s+->\\s+)(?<data>.*)$" //$NON-NLS-1$
);
/**
* comm group in {@link IGenericFtraceConstants#FTRACE_PATTERN}
Expand Down
Loading