impulse 2.1

U008 Logging and Tracing 3 - Live data

Attach, View Anaylze and Solve!

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.

Signal Ports

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.

Read from Data Interface, Application or External HW

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.

Combine and Synchronize Multiple Inputs

Multiple signal ports of varying types can be combined into one, synchronizing the received signals.

Stimulate and Handle

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.

Managing Ports

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.

Reading Log4J pattern from TCP

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.

H130 Attach - How to add a port

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).

  1. To add a port you need to have the Signals Ports view visible (Window > Show View > impulse > Signal Ports).;
  2. Click the "Add new Port" toolbar button of the "Signal Ports" view and select the port type. ;
  3. Configure the port settings and press ok.
H131 Attach - How to configure existing ports

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).

  • 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.
H132 Attach - How to open and start a port

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.

  • To open a port you need to have the Signals Ports view visible (Window > Show View > impulse > Signal Ports).
  • 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.
  • To start the port, press the "Run/Stop" in the tool-bar.

Screen Cast: Logging and Tracing 3 - Live data

TCP port

Modes

After creating a new TCP port, a dialogue pops up:

  • In "Normal Client" mode, the adapter tries to connect to the given server and returns with an error if not possible.
  • If "Waiting Client" mode is chosen, the adapter tries continuously to connect to the server without error exit.
  • If "Server" mode is chosen, the adapter creates a TCP server and waits for exactly one client to connect.

Source Configuration

  • Server: Server address or "localhost" (client modes only).
  • Socket: Socket number
  • Write input to file: Select a file to log the input stream.

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.

Resource Adapter

The resource adapter uses a workspace resource as the input stream. The adapter can be combined with other adapters using a multi-adapter port.

File/Pipe Adapter

The File/Pipe adapter uses a filesystem resource as the input stream. The raw data is then processed by a configurable reader. The adapter can be combined with other adapters using a multi-adapter port.

TCP Adapter

The TCP adapter connects to a TCP server and reads its input. The raw data is then processed by a configurable reader. The adapter can be combined with other adapters using a multi-adapter port.

UDP Adapter

The UDP adapter lisents to incoming packets (automatic/ scripted) and reads its input. The raw data is then processed by a configurable reader. The adapter can be combined with other adapters using a multi-adapter port.

Process Adapter

The process adapter starts an application and reads its output (stdout). The raw data is then processed by a configurable reader. The adapter can be combined with other adapters using a multi-adapter port.

Using Ports

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:
  • Connect to external drivers and data sources
  • Prepares all signals
  • Show 'current' data in the value column of the tree
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:
  • Single / 1-shot
  • Multiple / Auto mode
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.

 

Launcher Integration

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.

Start the launcher

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).

Next Tutorial in thes series

U008 Logging and Tracing 4 - Combining multiple sources

In the first two articles it was assumed that all log data comes from one source. 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.
toem

technical software and tooling

Company

Contact Us

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