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. Also it would be convenient, if we could see and analyse the log while simulation/debugging is ongoing. We could re-load any-time we are stepping - but live data from a an interface, port, socket should be nicer !
This article explains how to get log data from a TCP connection (or any other stream port), next article will handle the combination of multiple sources.
Instead of creating a file, signal ports can read the data directly from streams such as TCP, pipes, applications, interfaces or debug adapters. If more than one signal source is present (e.g., log data from a serial interface and trace over TCP), these signals can be merged and synchronized.
With the expandable concept of signal ports any signal source can be connected. This can be simple data connections with a configurable reader, external libraries or complex hardware interfaces.
Multiple signal ports of varying types can be combined into one, synchronizing the received signals.
By using scripts, connected devices or applications can be stimulated and their events processed. This could be for example a CAN bus message or a byte sequence via TCP.
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).
Add a port
Click the "Add new Port" toolbar button of the "Signal Ports" view and select the port type. Configure the port settings and press ok.
Configure existing ports
Press the "Edit Port" button of the "Signal Ports" view or use the context menu of the port/adapter element. If you have already opened the port in a viewer, press the "Edit Port" button in the viewers toolbar.
Open a port
Opening a port means opening the viewer with the signal content of the port. Press the "Open Port" button of the "Signal Ports" view or double-click the port item.
In this example we have an application that sends Log4J pattern ( [%p] %r %c %M - %m%n) logs through a TCP interface with port 5000.
[TRACE] 601 de.toem.impulse.test.primary.Log1 log - No Local Variables are initialized for Method [_GTF [DEBUG] 720 de.toem.impulse.test.secondary.Log3 log - get Sinus Wave -0.978360377194022 [DEBUG] 722 de.toem.impulse.test.primary.Log1 log - rcu: [DEBUG] 725 de.toem.impulse.test.primary.Log1 log - Switched APIC routing to cluster x2apic. [DEBUG] 727 de.toem.impulse.test.secondary.Log3 log - get Sinus Wave -0.9558040445515831
To create an initial Log4J 1.2 log pattern, press "Add" and select "Log Pattern for Log4j 1.2".
Unfortunately there is no 100% pattern conversion possible. We have to modify the resulting pattern slightly.
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.
After creating a new TCP port, a dialogue pops up:
You may specify a file "Write input to file" to store the raw input for debugging purpose.
To open impulse, just double-click on the port. You will see impulse with a slightly different look.
After opening the viewer, the user will find some additional icons in the toolbar of the viewer. They are used to control the data stream from the port and update from within the viewer.
Icon | Function | Description |
(or symbol of port) | Edit Port | Opens the port editor |
Connect | Enables the user to connect to a port without starting aquisition. Depending on the port design, the port may:
|
|
Run/Stop | Connects to the port and starts acquisition. To end streaming press again. | |
Single / Multiple | For scope like ports, this button selects if the acquisition process is:
|
|
Enable/Disable Updating | If the port generates a floating diagram, this button allows the user to start/stop updating the diagram. To stop the diagram you may also click into the plot area. |
An eclipse launch configuration is a description of how to launch a program. The program itself may be a Java program, another Eclipse instance in the form of a runtime workbench, a C program, or something else. The impulse launch integration enables users to bind an impulse port to a launch configuration.
The port will be opened in an impulse viewer (if its not already open) when the launch is started. Depending on the mode settings, this might be in debug or run-mode only, or always.
Now we have everything together. As soon as the launcher is started, the application starts running and establishes the TCP server.
impulse is started with a small delay of 600ms - then the server should be active (alternatively you can configure the TCP port to wait).