Visualizing Chrome Trace Events | Qt Creator Manual

Qt Creator Manual | Visualizing Chrome Trace Events

Qt Creator Manual 4.11.0

Analyzing Code with Cppcheck ◦ Running Autotests

# Visualizing Chrome Trace Events

Several tracing tools (such as `chrome://about`) can generate information about Chrome trace events in Chrome Trace Format (CTF). You can open CTF files in Qt Creator for viewing. This is especially useful when viewing trace files larger than 100 MB, which are difficult to view with the built-in trace-viewer (`chrome://tracing`) due to its high memory usage.

The visualizer supports all event types used in data that the LTTng tracing framework generates, converted to CTF. However, some of the more advanced event types used, for example, in Android system traces, are not supported. The visualizer silently ignores unsupported event types.

The visualizer supports the following event types:

- Begin, end, duration, and instant events
- Counter events (graphs)
- Metadata events (process and thread name)

## Opening JSON Files

To open JSON files for viewing, select Analyze > Chrome Trace Format Viewer > Load JSON File.

## Visualizing Events

The Timeline view displays a graphical representation of trace events and a condensed view of all recorded events.

Each category in the timeline describes a thread in the application. Move the cursor on an event (1) on a row to view its duration and event category. To display the information only when an event is selected, disable the View Event Information on Mouseover button (2).

The outline (3) summarizes the period for which data was collected. Drag the zoom range (4) or click the outline to move on the outline. To move between events, select the Jump to Previous Event and Jump to Next Event buttons (5).

Select the Show Zoom Slider button (6) to open a slider that you can use to set the zoom level. You can also drag the zoom handles (7). To reset the default zoom level, right-click the timeline to open the context menu, and select Reset Zoom.

### Selecting Event Ranges

You can select an event range (8) to view the time it represents or to zoom into a specific region of the trace. Select the Select Range button (9) to activate the selection tool. Then click in the timeline to specify the beginning of the event range. Drag the selection handle to define the end of the range.

You can use event ranges also to measure delays between two subsequent events. Place a range between the end of the first event and the beginning of the second event. The Duration field displays the delay between the events in milliseconds.

To zoom into an event range, double-click it.

To remove an event range, close the Selection dialog.

## Viewing Statistics

The Statistics view displays the number of samples each function in the timeline was contained in, in total and when on the top of the stack (called `self`). This allows you to examine which functions you need to optimize. A high number of occurrences might indicate that a function is triggered unnecessarily or takes very long to execute.

Analyzing Code with Cppcheck ◦ Running Autotests