In the first two articles it was assumed that all log data comes from one file. But the fact is that complex systems with multiple domains/cores usually have more than a single log! - e.g. a hardware log (systemC), firmware traces from multiple cores and DSPs and application logs.
This article explains how to combine log and trace data from multiple sources. We use the Log4J input from the previous article (systemA) and combine it with CSV data (systemB). Both sources provide a ms time-stamp. But unfortunately the start point differs :-(.
The CSV Data and Log Reader is a configurable reader for all typical kinds of CSV (Comma-Separated Values) based data and log formats. CSV is a common data exchange format that is widely supported by consumer, business, and scientific applications. With easy to use dialogs you can define configurations (separators, first line, labels, data types,...) for your specific formats. This article will help you configure and use the reader.
The systemB input contains a ms time-stamp, a message and 2 float signals.
1588251996590;" ACPI: PCI Interrupt Link [LNKF";-0.7264048716430498;1.0569470760874955 1588251996590;" node 0: [mem 0x0000000000001000-0x000000000009bfff";-0.7264048716430498;1.0569470760874955 1588251996592;" xhci_hcd 0000:00:14.0: Host supports USB 3.0 SuperSpeed";0.9272212259680832;2.4757980243910085
The Multi Adapter Port and its derivatives "Multi Resource Port" and "Multi File/Pipe Port" combine multiple adapters into one port. You can present and analyze signals from multiple inputs inside of one view. The Multi Resource Port makes it possible to combine several resource adapters. A common resource root can be defined and used as a base in all adapters.
A Signals Port can be opened by the impulse Viewer like a normal file. Instead of extracting the signal data from the file, it is read from an external source (e.g. TCP, a debug adapter or a bus interface).
Ports can be managed most easily with the "Signal Ports" view: (Window > Show View > impulse > Signal Ports). Alternatively you can also use the preferences (Preferences ->impulse > Ports).
The port may read the signal data in one go or spread over a period of time (on-line). impulse allows the analysis of signal data while new data is still arriving.
The CSV Reader requires a configuration (CSV Configuration) to work. A configuration contains information about the char set, the delimiter, labels and and the actual data fields. Press "Add" and select "CSV Configuration" to create a new reader configuration:
Select member names and types for all columns that shall create a signal.
There may be CSV logs without a domain value. In this case you may want to use:
Unfortunately the time-stamps are not synchronous. The dependency of the two logs shall be done by a log sample with the message "EISA bus registered". At the point of this sample, the system shall start with a delay of 10ms.
To synchronize systemB, open the adapter and check "Enable Sync", then click on "Edit in eclipse script editor" to open the editor and copy/paste the script below.
The system will call the synchronisation script continuously while reading the input until the method isync.setSynced(position) is called. The script first request a pointer to a given signal. If the signal is available, it tries to move the pointer to the valid position. If successful it calculates the delta and calls isync.setSynced.
// base: root cell of type ICell (usually a record cell) // insertPoint: root cell of this port of type PortScope // isync: sync interface of type IPortSync // console: console output of type MessageConsoleStream var log2 /*:ISamplePointer:*/ = isync.getPointer('systemA\\de.toem.impulse.test.secondary.Log2'); if (log2 != null) { var checked = 0; var synced = false; while (log2.hasNext() && checked < 100) { var msg = log2.stringValueOf("Message"); if (msg != null && msg.equals("EISA bus registered")) { isync.setSynced(log2.getPosition().add(DomainValue.valueOf("10ms"))); synced = true; console.println("Synced: " + reset.getPosition()); break; } checked++; log2.goNext(); } if (!synced) console.println("Sync not found!"); } else console.println("Signal not found!");
The console shows the output:
Sync not found! Sync message at: 752ms