lisa.trace.CustomFieldsTxtEventParser#
- class lisa.trace.CustomFieldsTxtEventParser(event, fields_regex, fields, raw)[source]#
Bases:
TxtEventParserSubclass of
TxtEventParserto be used for funky formats.When the format of the textual event does not respect at all the raw
trace-cmdformat, and if raw format cannot be used (e.g. because ofconst char*fields), this class provides a way out. For example, this event can be parsed with this class, but would be impossible to be parse usingTxtEventParser:# non-raw format lacks a field delimiter for the "reason" kworker/u16:6-262 [003] 177.417147: ipi_raise: target_mask=00000000,00000020 (Function call interrupts) # raw format, even less usable because of the const char* pointer not being resolved kworker/u16:6-262 [003] 177.417147: ipi_raise: target_cpus=ARRAY[20, 00, 00, 00, 00, 00, 00, 00] reason=0xffffff8c0774fe6b
Note
Use
TxtEventParserif possible, since it provides a more optimized fields regex than what you are likely to come up with, and can deal with missing fields.- Parameters:
event (str) – Name of the event.
fields_regex (str) – Regex to parse the fields part of the event occurence. Regex groups are used to delimit fields, e.g.
r"field1=(?P<field1>[0-9]+)"would recognize"field1=42"as afield1column.fields (dict(str, object)) – Mapping of field names (group names in the regex) to dtype to use in the
pandas.DataFrame. This is passed tolisa.datautils.series_convert()so the accepted values are a bit wider thanpandasdtypes.raw (bool) – If
True, the event will be parsed as raw bytrace-cmd. If you haveconst char*fields, this must beFalsein order to get the string instead of the pointer.
Attributes
PARSER_REGEX_TERMINALSinheritedSnippets of regex to be used in building more complex regexes in textual trace parsers.
Properties
bytes_regexinherited
Attributes#
- CustomFieldsTxtEventParser.PARSER_REGEX_TERMINALS = {'blank': ' +', 'floating': '\\d+\\.\\d+', 'identifier': '\\w+', 'integer': '\\d+'}#
Inherited attribute, see
lisa.trace.EventParserBase.PARSER_REGEX_TERMINALSSnippets of regex to be used in building more complex regexes in textual trace parsers.
Properties#
- property CustomFieldsTxtEventParser.bytes_regex#
Inherited property, see
lisa.trace.TxtEventParser.bytes_regex