SourcePoint Intel Help

Table of Contents

Trace Configuration

The Configure button in the Trace window opens the Trace Configuration dialog box. ย This dialog is used to configure trace capture settings. ย Changes in this dialog take effect on the next trace capture. ย 

Emulator Tab

LBR Tab

BTS Tab

AET Tab

Intel PT Tab

Intel PT_Memory_Tab

Trace_Hub Tab

Emulator Tab

Emulator Configuration Tab

The emulator tab configures settings specific to emulator. ย It will only be displayed if you have an emulator with hardware trace support (e.g., LX-1000).

Trace buffer depth section

Physical depth. ย Displays the amount of trace RAM installed in the emulator. ย This is a read-only field.

Logical depth. ย Sets the logical trace depth. ย This makes it look like the trace buffer is actually much smaller than it really is. ย One advantage of this is trace cycle numbers can be 5 or 6 digits instead of 10. ย Another is that searching the entire trace is much faster.

Note: ย This setting has no effect on the actual recording of trace. If you record a full trace buffer (e.g., 2 Gb), and have a logical trace depth of 64k, there is still 2 Gb of trace data in the emulator. ย This setting can be changed to different values without having to record new trace data.

LBR Tab

LBR Configuration Tab

Processors to trace section

These controls specify which processors will be traced.

None. ย Disables LBR trace.

All. ย Enables LBR tracing on all processors.

List. ย Enables LBR processor tracing on selected processors. ย Use commas to list processors (e.g., P2, P4, P6). ย Use a hyphen to specify a range of processors (e.g., P0-P4). ย Press the Browse button to the right to graphically specify processors.

ย 

BTS tab

BTS Configuration Tab

Processors to trace section

These controls specify which processors will be traced.

None. ย Disables BTS trace.

All. ย Enables BTS tracing on all processors.

List. ย Enables BTS processor tracing on selected processors. ย Use commas to list processors (e.g., P2, P4, P6). ย Use a hyphen to specify a range of processors (e.g., P0-P4). ย Press the Browse button to the right to graphically specify processors.

Debug Store Location section

When โ€Use processor settingsโ€ is selected, SourcePoint takes care of controlling the BTS (starting and stopping it), but does not define the location of the BTS. ย This is useful when an operating system (or EFI code) is in charge of allocating space for the BTS.

When โ€Use SourcePoint settingsโ€ is selected, SourcePoint not only takes care of controlling the BTS, but also creates the BTS. ย 

Note: ย The BTS is actually one component of a larger memory structure called the Debug Store.

The Base address field specifies the linear base address of the Debug Store. ย This field is enabled when Use SourcePoint settings is enabled.

The Length field specifies the length of the Debug Store. ย This field is enabled when Use SourcePoint settings is enabled. ย The actual size of the BTS is the length of the Data Store minus 0x60 bytes.

Debug Store Format section

When Auto-detect is selected, SourcePoint will attempt to automatically determine the debug store format. ย This works in 99% of the cases. ย If the Trace view is not displaying correct disassembly try forcing this setting to either 32-bit (12 byte BTMs), or 64-bit (24 byte BTMS)

Trace Capture Mode section

When โ€overwriteโ€ is selected, SourcePoint clears the BTS prior to each data capture. ย When โ€appendโ€ is selected, new trace data is appended to existing trace data. ย The default setting is overwrite.

AET Trace tab

AET Configuration Tab

Processors to trace section

These controls specify which processors will be traced.

None. ย Disables Event trace.

All. ย Enables Event tracing on all processors.

List. ย Enables Event processor tracing on selected processors. ย Use commas to list processors (e.g., P2, P4, P6). ย Use a hyphen to specify a range of processors (e.g., P0-P4). ย Press the Browse button to the right to graphically specify processors.

Note: ย If AET is routed through the trace hub, then the trace hub must be enabled in the Trace_Hub Configuration tab.

Event sharing section

These controls specify whether all tracing processors will trace the same events, or whether each processor is tracing itโ€™s own events.

When โ€Apply events to all processors is selectedโ€, the events selected in the "Processors to trace" group box will be traced on all processors.

When โ€Apply events toโ€ is selected, each tracing processor has itโ€™s own set of events. ย The drop down list to the right is used to select a processor. ย You must select each individual processor, and then select the events you want to trace for that processor

Events to trace section

The list of events varies by processor type. ย Not all of these events will be available. ย Each event has an Enabled check box for enabling recording of that event type, and an LBR checkbox. ย The LBR checkbox controls whether the LBR stack is recorded with each event. ย This allows for the display of instruction trace leading up to the event.

HW/SW interrupt. ย Trace hardware and software interrupts, and also trace STI and CLI instructions. ย The disassembled instruction where the interrupt occurred, and the vector number are displayed.

IRET. ย Trace IRET instructions. ย The disassembled instruction is displayed.

Exception. ย Trace all exceptions. ย The disassembled instruction that caused the exception, along with the vector number and the value of CR2 are displayed.

RDMSR / WRMSR. ย Trace all MSR reads and writes. ย The MSR register number and value are displayed.

Power Management. ย Trace power state changes.

Port In / Out. ย Trace all I/O reads and writes. ย The I/O port number and data value are displayed.

Code breakpoint. ย Trace code accesses that match hardware (processor) breakpoints in the Breakpoint view.

Note: ย When this event is enabled, all hardware breakpoints work in conjunction with Event trace, and no longer behave as regular breakpoints.

Data breakpoint. ย Trace data accesses that match hardware (processor) breakpoints in the Breakpoint view. ย 

Note: ย When this event is enabled, all hardware breakpoints work in conjunction with Event trace, and no longer behave as regular breakpoints.

BTM. ย Trace BTM events. ย This allows for full disassembly of all instructions. ย Because of the overhead associated with emitting the event data, this can slow execution down quite a bit. ย ย BTS trace is a much more efficient way for tracing instructions. ย 

It is also possible to only trace BTM events for a specific range of code. ย To specify this range, press the Advanced button, and specify the range. ย See Advanced Configuration below.

Note: If BTS trace or Intel PT is enabled, then they take precedence over BTM event trace, and no BTM events will occur. ย LBR tracing is not allowed on BTM events.

SMI / NMI / RSM. ย Trace all SMI, NMI, RSM, INIT and SIPI (Startup IPI) events. ย The disassembled instruction last executed before the event occurred is shown. ย For SIPI events, the SIPI vector is also shown.

MONITOR / MWAIT. ย Trace all MONITOR and MWAIT instructions. ย The disassembled instruction is shown. ย For MONITOR the value of EAX is also displayed. ย For MWAIT the values of EAX and ECX are also displayed.

WBINVD. ย Trace all WBINVD and CLFLUSH (Cache Line Flush) events. ย The disassembled instruction last executed before the event occurred is shown. ย For CLFLUSH events, the address is also shown.

SYSENTER / EXIT. ย Trace all SYSENTER, SYSEXIT, SYSCALL and SYSRET events. ย The disassembled instruction is shown. ย For SYSENTER events, the system call vector is also shown. ย For SYSEXIT events, the return values of ESP and ESP are also shown.

PCICONFIG Read / Write. ย Trace all PCI Configuration reads and writes. ย The Bus number, Device number, Function number and Register number, along with the data access value, are displayed.

Memory Trace. ย Trace accesses to up to three user-defined memory ranges. ย These ranges are defined in the Advanced configuration dialog (see below). ย The linear and physical addresses of the access, along with the type (read or write), are displayed.

SGX.ย  Trace the following SGX events: ย EENTER (enter enclave), ERESUME (resume enclave), EEXIT (exit enclave) and AEX (asynchronous enclave exit).ย  The disassembled instruction is displayed.

Advanced Configuration

The Event Trace Advanced dialog is opened by pressing the Advanced button. ย It is used to control BTM range and memory range tracing. ย If neither event is supported on a processor, then the button will be disabled.

Event Trace Advanced Configuration Dialog

BTM range tracing

These controls only have an effect when the BTM checkbox in the Event Trace configuration tab is enabled.

These controls define a specific range of code to trace BTM events. ย The checkbox enables and disables the range. ย If the range is disabled, then all BTM events are traced.

The Start and End address values are linear addresses.

Memory range tracing

These controls only have an effect when the Memory Trace checkbox in the Event Trace configuration tab is enabled.

These controls define up to three specific ranges of memory accesses to trace. ย The checkboxes are used to enable and disable ranges. ย 

The Start address is a physical address. ย It must be on a 4 kb boundary.

The Size dropdown list defines the size of the memory range to trace. ย The values available in the list vary based on the alignment of the Start address. ย For example, if the Start address is on a 16 kb boundary, then 16 kb, 8 kb and 4 kb sizes will be available. ย If the Start address is on a 4 kb boundary, then the only choice available will be 4 kb.

Intel PT Tab

This tab is used to configure Intel PT trace collection.

Intel PT Configuration Tab

Processors to trace section

These controls specify which processors will be traced.

None. ย Disables Intel PT trace.

All. ย Enables Intel PT tracing on all processors.

List. ย Enables Intel PT processor tracing on selected processors. ย Use commas to list processors (e.g., P2, P4, P6). ย Use a hyphen to specify a range of processors (e.g., P0-P4). ย Press the Browse button to the right to graphically specify processors.

Note: ย It is processor dependent whether Intel PT trace and LBR/BTS trace can be enabled at the same time. ย An error message will display at run time if both are enabled on a processor that does not have this capability.

Share filter / timestamp settings section

These controls specify whether all tracing processors share the same filter and timestamp settings, or whether each processor has its own settings.

When โ€Apply settings to all processorsโ€ is selected, the settings selected in the Filters and Timestamp group boxes apply to all processors.

When โ€Apply settings toโ€ is selected, each tracing processor has its own filter and timestamp settings. ย The dropdown list to the right is used to select a processor. ย You must select each individual processor, and then specify the settings you want for that processor

Filters section

Intel PT can optionally be configured to trace instructions only when the CPU is executing code within certain IP ranges. ย If the IP is outside of these ranges, tracing is disabled.

There are two IP ranges: ย Range 1 and Range 2. ย The checkboxes are used to enable these ranges. ย If neither range is enabled, all instructions are traced. ย The edit control to the right is used to specify the IP range. ย It can contain a symbolic range (e.g., a function or module name), or two addresses separated with a hyphen (e.g., 1000-2000). ย The Symbol finder button to the right can be used to lookup symbol names. ย It is processor-dependent whether IP ranges are supported.

Intel PT provides the ability to specify whether tracing can occur in OS (CPL=0) or User (CPL>0) modes. ย The CPL checkbox enables this capability. ย The dropdown list to the right selects what to trace. ย If not enabled, then all privilege levels are traced.

Intel PT can enable or disable trace generation depending on the current CR3 value. ย The CR3 checkbox enables this capability. ย The edit control to the right specifies the CR3 value to trace.

Timestamp section

Intel PT can be configured to generate timestamp information in the trace stream. ย Timestamp can be used to measure time within the trace data, or to time align with other Trace views. ย There are three types of timestamp packets that can be enabled.

TSC. ย TSC (Timestamp Counter) packets contain TSC values. ย These are the same values read from the TSC MSR or by using the RDTSC instruction. ย These packets are required in order to time align with other Trace views. ย This allows for time alignment with Intel PT from other processors or with SW/FW trace from the Trace Hub.

MTC. MTC (Mini Time Counter) packets contain incremental updates to the CTC (a component of TSC). ย These values provide slightly more accuracy than TSC packets alone. ย The frequency of these packets is controlled with the Frequency setting. ย A value of CTC 6 indicates that a packet is generated whenever bit 6 of the CTC counter changes. ย These packets are generally not used.

Cycle Accurate. ย Cycle accurate packets contain information about the number of processor clocks that have occurred. ย These packets can be used by themselves to measure time within a trace buffer. ย TSC packets are required to time align with other Trace views. ย The frequency of these packets is controlled with the Threshold setting. ย This value indicates how many processor clocks occur before a packet is emitted.

Refer to the Timestamp topic in the Advanced section for more information.

Intel PT Memory Tab

The Intel PT Memory tab is used to configure the trace output region in target memory. ย This area contains a separate trace buffer per processor enabled for trace.

Intel PT Memory Tab

Trace Buffer section

When Use processor settings is selected, SourcePoint assumes that the location and size of the trace output region has been set by an operating system, or EFI code. ย 

When Use SourcePoint settings is selected, SourcePoint is used to specify the location and size of the trace buffers. ย 

The Base address field specifies the physical base address of the trace output region. ย The base address must be aligned with the length of the trace buffer. ย 

The Length per core field specifies the size of the trace buffer. ย ย Sizes range from 16 kb to 128 Mb in powers of two. ย The actual size of the trace output region is the number of processors enabled for trace times the length per core. ย 

Trace Capture Mode section

When overwrite is selected, SourcePoint clears the trace buffer prior to each data capture. ย When append is selected, new trace data is appended to existing trace data. ย The default setting is overwrite.

Trace Hub

This tab is used to configure the Trace Hub for system trace collection.

NOTE: ย The Trace Hub must be enabled in BIOS prior to use. ย This setting can usually be found in either the PCH section, or in the Debug section.

Software / firmware trace (system trace) is generated by software running on the target. ย Typically, this consists of ASCII strings, but it can also contain hex data. ย The Trace Hub supports multiple streams of software trace. ย In fact, the Trace Hub supports up to 65536 masters, each with up to 256 channels (streams of software trace), for a theoretical maximum of 16M streams of trace. ย 

User-provided metadata is used to describe the display format of System trace. ย Refer to Trace Hub Metadata for more information.

If the target contains any Trace Hubs, there will be a configuration tab for each. ย 

Trace Hub Configuration Tab

Masters to Trace Section

These controls specify which masters will be traced.

None. ย Disables Trace Hub trace.

All. ย Enables tracing of all masters.

List. ย Enables tracing of selected masters. ย Use commas to list individual masters (e.g., 2, 4, 6). ย Use a hyphen to specify a range of masters (e.g., 32-256). ย Press the Browse button to the right to graphically specify masters. ย 

Masters to Trace dialog

This dialog displays master names rather than just the master numbers. ย The names come from the XML metadata file user-specified in the Master / channel definitions file.

Trace Source Routing section

These controls specify the routing of different types of trace data to different destinations.

Trace Hub. ย Trace Hub routing refers to Software / Firmware trace. ย There are currently three trace destinations: system memory, MTB and DbC. ย When system memory is selected, trace data is stored in memory according to the settings in the Trace Buffer section. ย When MTB is selected, trace data is stored in the MSU trace buffer inside the Trace Hub. ย The advantage of using the MTB is that trace data can be captured very early in the boot process, before system memory has been initialized. ย The disadvantage or using the MTB is that itโ€™s very small (typically 2 kB), where a memory-based trace buffer can be as large as desired. ย The DbC selection is only available when you have a DCI connection to the target. ย In this case, trace data is streamed from the target and stored in an internal 512 MB trace buffer inside SourcePoint. ย This trace mode has the same advantages of MTB in that trace can be captured before system memory is available.

Intel PT. ย Intel PT can be routed through the Trace Hub intermixed with other types of trace data. ย Intel PT can also be routed directly to system memory without going through the Trace Hub. ย Currently, SourcePoint only supports the latter. ย All configuration for Intel PT is performed in the two Intel PT tabs.

AET. ย AET (Architectural Event Trace) can currently only be routed through the Trace Hub intermixed with other types of trace data. ย All configuration for AET is performed in the AET tab.

Trace Buffer section

When Use BIOS settings is selected, SourcePoint assumes that the location and size of the trace output region has been set by the BIOS. ย This is the safest setting to use since the BIOS will ensure the memory is dedicated to the Trace Hub, and will have defined a MTRR register to make it uncacheable.

When Use SourcePoint settings is selected, SourcePoint is used to specify the location and size of the trace buffer. ย 

The Base address field specifies the physical base address of the trace output region. If Use BIOS settings is selected this field display the region allocated by the BIOS. ย If Use SourcePoint settings is selected this field displays the user-allocated region. ย The base address must be aligned on a 4 kb boundary. ย This region must be in uncacheable memory.

The Length field specifies the size of the trace buffer. ย ย Sizes range from 8 kb to 2 Gb in powers of two. ย ย ย 

Timestamp section

SW/FW trace can be time aligned with other trace sources including AET and Intel PT. ย In order to convert SW/FW timestamp values to TSC values for alignment, timestamp alignment packets must be enabled.

Alignment packets: ย Enables timestamp alignment packets. ย This is only required when time alignment with other trace sources in other Trace views is desired. ย Note that this setting does not control whether SW/FW trace actually contains timestamp packets. ย This is controlled by user code generating the SW/FW trace data.

Frequency: ย Controls the frequency of the timestamp alignment packets. ย A value of CTC 16 indicates that whenever bit 16 of the CTC timer changes, a packet is emitted. ย The correct value to use is dependent on the density of the SW/FW trace. ย The sparser the trace, the higher this value should be set. ย Ideally, an alignment packet should be present every few thousand bytes of SW/FW trace.

Refer to the Timestamp topic in the Advanced section for more information.

Master / Channel Definitions section

The Filename control is used to specify the location of the Trace Hub metadata file. ย This XML file contains the Master / Channel display formatting information. The button to the right can be used to browse to the file. ย See Trace Hub Metadata.

ย 

ย 

ย 

ย