Host-Based Analysis & Graphical View Tool
TRACEX® is Express Logic’s host-based analysis tool that provides developers with a graphical view of real-time system events and enables them to visualize and better understand the behavior of their real-time systems. With TRACEX, developers can see clearly the occurrence of system events like interrupts and context switches that occur out of view of standard debugging tools. The ability to identify and study these events, and to pinpoint the timing of their occurrence in the context of the overall system’s operation enables developers to resolve programming problems by finding unexpected behavior and letting them investigate specific areas further. Download a 30-Day Free Trial of TRACEX
Trace information is stored in a buffer on the target system, with the buffer location and size determined by the application at run-time. TRACEX can process any buffer constructed in the proper manner, not only from THREADX, but from any application or RTOS. The trace information may be uploaded to the host for analysis at any time – either post mortem or upon a breakpoint. THREADX implements a circular buffer, which enables the most recent “N” events to be available for inspection in the event of system malfunction or other significant event.
TRACEX built-in system analysis
Please see below for more details on the built-in system analysis reports.
Trace data collected By THREADX® RTOS
- thread context switches
- system interrupts
- application-specific events
- all THREADX API calls
- all NETX API calls
- all FILEX API calls
- all USBX API calls
- Application-Defined Icons and information
Events are logged under program control, with time-stamping and active thread identification so they can be displayed later in the proper time sequence, and associated with the appropriate thread. Event logging may be stopped and restarted by the application program dynamically, for example, when an area of interest is encountered. This avoids cluttering the database and using up target memory when the system is performing correctly.
TRACEX is like a software logic analyzer
on a horizontal axis representing time, with the various application threads and system routines to which the events are related listed along the vertical axis. TRACEX creates a “software logic analyzer” on the host, making system events plainly visible. Events are represented by color coded icons, located at the point of occurrence along the horizontal timeline, to the right of the relevant thread or system routine. When an event icon is selected, the corresponding information for that event is displayed, as well as the information for the two previous and two subsequent events. This provides quick, single-click access to the most immediate information about the event and its immediately surrounding events. TRACEX provides a “Summary” display that shows all system events on a single horizontal line to simplify analysis of systems with many threads.
Sequential view mode
This is the default mode. In this mode, events are shown immediately following each other–regardless of the elapsed time between them. Note also the ruler above the display area. It shows the relative event number from the beginning of the trace. This mode is the default mode and is especially useful in getting a good overview of what is going on in the system.
In this mode, events are shown in a time relative manner–with a solid green bar being used to show execution between events. This mode is especially useful to see where the bulk of processing is taking place in the system, which can help developers tune their system for greater performance and/or responsiveness.
Time view mode
as derived from the time stamp instrumented in the event trace logging inside of THREADX. If the time-stamps are too close (low frequency timer), the events will run together. Conversely, if the time-stamps are too far apart (high frequency timer), then the events will be too far apart. Choosing the right frequency time stamp is an important consideration in making the time relative view meaningful.
TRACEX also provides a single summary line that includes all events on the same line. The summary line contains a summary of the context as well as the corresponding event summary underneath. This makes it easy to see an overview of a complex system. The summary bar is especially beneficial in systems that have a great number of threads. Without such a summary line, the user would have to follow complex system interactions using the vertical scroll bar to follow the context of execution.
System summary line
Events that occur in a particular context are displayed on the horizontal line to the right of that context. In this way, the user can easily ascertain which context the event occurred as well as follow that context line to see all the events that occurred in a particular context.
The first two context entries are always the “Interrupt” and “Initialize/Idle” contexts. The “Interrupt” context represents all system events made from Interrupt Service Routines (ISRs). The “Initialize/Idle” context represents two contexts in THREADX. Events that occur during tx_application_define, are “Initialize” events and are displayed on the “Initialize/Idle” context. If the system is idle and thus no events are occurring, the green bar representing ”Running” in the time view is drawn on the ”Initialize/Idle” context.
Methods of navigation
If “Event” is selected, navigation is done on the next/previous event. If “Context” is selected, navigation is done on the next/previous event on the same context. If “Object” is selected, navigation is done on the next/previous event of the current object, e.g., events associated with a specific queue. If “Switches” is selected, navigation is done on the next/previous context switch. If “Same ID” is selected, navigation is done on the next/previous event for the same event ID.
Event information display
These include 6 internal THREADX events, 2 ISR events (enter and exit), 14 internal FILEX events, 42 internal NETX events, and one user-defined event. The remaining events correspond directly to THREADX, FILEX, and NETX API services.
Regardless of whether sequential or time display mode is selected, a mouse-over on any event in the display area results in detailed event information displayed near the event. The mouse-over of event 494 in the demonstration demo_threadx.trx trace file is shown here:
Each event displayed contains standard information about Context and both the Relative Time and Time Stamp. The Context field shows what context the event took place in. There are exactly four contexts: thread, idle, ISR, and initialization. When an event takes place in a thread context, the thread name and its priority at that time is gathered and displayed as shown above. The Relative Time shows the relative number of timer ticks from the beginning of the trace. The Raw Time Stamp displays the raw time source of the event. Finally, all event-specific information is displayed. This information is detailed throughout the remainder of this chapter.
Zooming in and out
or zoom out as desired. Zooming out to 100% is useful to see the entire trace in the current display view, while zooming in is useful in conditions where the events overlap due to the resolution of the time stamp source.
When zoomed out at 100% – showing the entire trace within the current display page – it is easy to see all the context execution captured in the trace as well as the general events occurring within those contexts. Notice that “thread 1“ and “thread 2“ execute most often. The blue coloring for their events also suggests that these threads are making queue service calls (queue events are blue in color). To examine individual events, you can Zoom-In to a level of “magnification” that expands the display to show an area of interest in greater detail, as shown below.
Delta ticks between events
The delta number of ticks between the events will show up in the upper right-hand corner of the display.
The delta ticks show that 501 ticks have elapsed between event 494 and event 496. This could also be calculated manually by looking at the relative time stamps in each event and subtracting, but using the GUI is easy and instantaneous.
that is currently owned by a lower-priority thread. This condition is termed “deterministic,” since the system was setup to operate in this manner. In order to inform the user, TRACEX shows “deterministic” priority inversion ranges as a light salmon color.
TRACEX also displays “un-deterministic” priority inversions. These priority inversions differ from the “deterministic” priority inversions in that another thread of a different priority level has executed in the middle of what was a “deterministic” priority inversion, thereby making the time within the priority inversion somewhat “un-deterministic.” This condition is often unknown to the user and can be very serious. In order to alert the user of this condition, TRACEX shows “un-deterministic” priority inversions as a brighter salmon color.
Thread stack usage
Raw trace dump