RL01 Pattern Log Reader


Outline

With the pattern log reader, you can read line based logs containing multiple line patterns. With the help of regular expressions, all relevant information can be extracted and read into struct signals. This article will help you configure and use the reader.

Platforms:
32/64bit 32/64bit 32/64bit
Requirements:
  • None
Known limitations:
  • File size limited by virtual memory and temporary storage
Status:
  • Stable
Operations:
  • Load
  • Stream
Parameters:
  • None
Configuration:
  • A Pattern Log reader configuration is required. The configuration defines the structure of the Log file (regular expression, data types and names, domain, ...).


Video

Screen Cast: Using Pattern Log Reader



About pattern logs

In most cases, developers have text log outputs. In the good case, all log line share the same format, but often there is a strange mix of multiple line pattern due to historical reasons.

Up to a certain level, impulse can parse these mixed logs and present and analyze them in a uniform way.
To achieve this, the user can define a set of pattern. Each pattern describes the format and content of one line type.

Here a typical log example:
 

NOTE     [212 745 133.974 ns] in top.mDist_dsp_access.r2_op : getX4LegChangeDone happened
WARNING  [212 745 133.974 ns] in top.mDist_dsp_access.r4_op : getX4LegChangeDone
ISR at 214435176
ERROR    [214 435 176.000 ns] in top.mDist_dsp_wait : Kernel changed state to: OUTPUT
# Leg ok - wait for next
NOTE00000[216 735 876.000 ns] in top.F4.generics : Calculated load 47%


Usage

The reader can be used to open workspace resources and together with ports (direct connection to the target using TCP, Serial, J-Link, ...).



Configuration

The Pattern Log Reader requires a configuration (Pattern Log Configuration) to work. Each configuration contains a set of log pattern. Click the Add button to add a new "Pattern Log Configuration" and fill in the following parameters:

  • Char Set: Select the char set that is used by the log file.
  • Domain Base: Select the domain base. This represents is smallest domain change (e.g. 1 ms).
  • Match pattern: This settings define one of your pattern as the one used to match with a given file. If the given pattern matches the first line of the file, the configuration is used to read the file.

Press "Add" and select "Log Pattern" to create a new pattern.

You can define multiple pattern (e.g. you may have different log styles from different units). When reading, it takes the first pattern that matches. Use the buttons on the right side to re-order your patterns.

The log pattern dialogue shows the following parameters:

  • Pattern: Define the regular expression for the lines. Use the context proposals (press control-space). For more information about java regular expressions see http://docs.oracle.com/javase/tutorial/essential/regex/
  • Test Lines: You may add a few lines of your log file. Press "Test" to validate against your expression.

First step is done. Now you need to define what to do with the extracted attributes.

  • Select the action.
    1. Ignore : Just skip the line
    2. Create new log sample
    3. Append to previous sample: The information will be added to the previous event (e.g. from previous line).
  • Select the member names. You can select a predefined member or enter a custom one.
  • For custom members you can define the signal type and a descriptor.
  • Define the domain value (time-stamp):
    1. Date: you need to define the date format. Use content proposals and http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html.
    2. Float execution time: Parse a float value, optionally let it to parse the time unit from the file or assign a unit.
    3. Integer execution time: Parse an integer value, optionally let it to parse the time unit from the file or assign a unit.
  • Define the naming:
    1. Default name : All log events get into one signal with the name "log".
    2. Name from group value : The given value is taken to define the signal name. The log events will be stored into different signals.
    3. Hierarchy from group value : Similar to the previous one. The difference is that the value is split up (hierarchy separator) and the signal is embedded into a hierarchy of logs.

Now you are ready with the reader configuration. Please have in mind that the standard file extension for pattern logs is ".log". To change ,please use the Preferences -> General -> Content Types -> (Element/Record/Pattern Log Record).



Parse errors

The reader will provide a parse error message if the input can not be read. The message usually contains the error position, the reason for the failure and a stack trace.

If you can not resolve the problem (e.g. obvious format error in the input file), please send this message together with the input file to "This email address is being protected from spambots. You need JavaScript enabled to view it.".

	Reader: de.toem.impulse.serializer.xyz 
	Error at position: 4800
	Text at position: "o !.
	Up
	Uq
	Ur"
	Message: Invalid character
	Type: class de.toem.impulse.serializer.ParseException
	Stack trace: 
	
	de.toem.impulse.serializer.xyz.xyzReader.parse(XYZReader.java:459)
	de.toem.impulse.serializer.xyz.xyzReader.parse(xyzReader.java:363)
	de.toem.impulse.serializer.xyz.xyzReader.read(xyzReader.java:269)
	de.toem.impulse.serializer.xyz.xyzReader.read(xyzReader.java:237)
	de.toem.pattern.element.Element$1.execute(Element.java:1063)
	de.toem.eclipse.hooks.actives.EclipseActives$3.run(EclipseActives.java:73)

toem

technical software and tooling

Company

Contact Us

This email address is being protected from spambots. You need JavaScript enabled to view it.