LXR | KVM | PM | Time | Interrupt | Systems Performance | Bootup Optimization

ThreadX(3):TraceX创建、事件分类、解析

分别从如下几方面介绍TraceX:

  • 如何创建TraceX数据。
  • TraceX数据格式。
  • TraceX检测哪些事件。
  • TraceX工具TraceX和Tracealyzer使用方法。

1 TraceX生成trace buffer

1.1 TraceX初始化

参考《Chapter 5 - Generating trace buffers》。

TraceX初始化函数:

  • tx_trace_enable:初始化并使能TraceX。
  • tx_trace_event_filter:过滤特定类型事件。
  • tx_trace_event_unfilter:取消对特定类型事件过滤。
  • tx_trace_disable:关闭TraceX。
UINT tx_trace_enable (VOID *trace_buffer_start,
     ULONG trace_buffer_size, ULONG registry_entries);--以trace_buffer_start为起始地址,总大小为trace_buffer_size,object个数为registry_entries。剩余都给event buffer。
UINT tx_trace_event_filter (ULONG  vent_filter_bits);
UINT tx_trace_event_unfilter (ULONG event_unfilter_bits);
UINT tx_trace_disable (VOID);

关于Filter参考《TraceX Event Filter》。

tx_trace_buffer_full_notify注册TraceX buffer溢出回调函数:

VOID tx_trace_buffer_full_notify (VOID (*full_buffer_callback)(VOID *));

_tx_trace_enable初始化TraceX数据:

  • 初始化Object Entry数据。
  • 初始化Event Buffer数据。
  • 初始化TraceX Header。
  • 依次将THREAD、TIMER、EVENT_FLAGS、QUEUE、SEMAPHORE、MUTEX、BLOCK_POOL、BYTE_POOL等Object写入TraceX数据。
  • 写入两个RUNNING事件。

1.2 TraceX数据格式

参考《Chapter 11 - Format of event trace buffer》。

TraceX的数据按照如下组装:

Header定义Trace的Object和Event Buffer空间:

typedef struct TX_TRACE_HEADER_STRUCT
{

    ULONG                                                   tx_trace_header_id;--TraceX标识,固定为0x54585442。
    ULONG                                                   tx_trace_header_timer_valid_mask;--时间戳中有效位的掩码。这个掩码允许系统使用不同位宽的时间源,例如32位、24位、16位或8位。
    ULONG                                                   tx_trace_header_trace_base_address;--定义了TraceX的基地址。通过从TraceX指针中减去这个基地址,可以得到追踪缓冲区中的偏移量。
    ULONG                                                   tx_trace_header_registry_start_pointer;--指向TraceX Object起始位置的指针。
    USHORT                                                  tx_trace_header_reserved1;--保留两个字节的空间,为0x0000。
    USHORT                                                  tx_trace_header_object_name_size;--TraceX Object名称的字节大小。
    ULONG                                                   tx_trace_header_registry_end_pointer;--TraceX Object结束位置的指针。
    ULONG                                                   tx_trace_header_buffer_start_pointer;--TraceX Buffer起始位置的指针。
    ULONG                                                   tx_trace_header_buffer_end_pointer;--TraceX Buffer结束位置的指针。
    ULONG                                                   tx_trace_header_buffer_current_pointer;--指向TraceX Buffer中当前指针。这个指针会在新事件写入时更新,如果缓冲区已满,它将回绕到缓冲区的顶部。
    ULONG                                                   tx_trace_header_reserved2;--为0xAAAAAAAA。
    ULONG                                                   tx_trace_header_reserved3;--为0xBBBBBBBB。
    ULONG                                                   tx_trace_header_reserved4;--为0xCCCCCCCC。
} TX_TRACE_HEADER;

Object表示触发事件的主体:

typedef struct TX_TRACE_OBJECT_ENTRY_STRUCT
{

    UCHAR                                                   tx_trace_object_entry_available;--1表示空间;0表示被使用。
    UCHAR                                                   tx_trace_object_entry_type;--Object的类型。
    UCHAR                                                   tx_trace_object_entry_reserved1;                            /* Should be zero - except for thread   */
    UCHAR                                                   tx_trace_object_entry_reserved2;                            /* Should be zero - except for thread   */
    ULONG                                                   tx_trace_object_entry_thread_pointer;--存储指向ThreadX对象的指针。
    ULONG                                                   tx_trace_object_entry_param_1;--存储与Object类型相关的第一个参数值。
    ULONG                                                   tx_trace_object_entry_param_2;--存储与Object类型相关的第二个参数值。
    UCHAR                                                   tx_trace_object_entry_name[TX_TRACE_OBJECT_REGISTRY_NAME];--存储Object的名称。
} TX_TRACE_OBJECT_ENTRY;

 TraceX支持的Object类型如下,同时注释了P1和P2参数定义:

#define TX_TRACE_OBJECT_TYPE_NOT_VALID                      ((UCHAR) 0)     /* Object is not valid                               */
#define TX_TRACE_OBJECT_TYPE_THREAD                         ((UCHAR) 1)     /* P1 = stack start address, P2 = stack size         */
#define TX_TRACE_OBJECT_TYPE_TIMER                          ((UCHAR) 2)     /* P1 = initial ticks, P2 = reschedule ticks         */
#define TX_TRACE_OBJECT_TYPE_QUEUE                          ((UCHAR) 3)     /* P1 = queue size, P2 = message size                */
#define TX_TRACE_OBJECT_TYPE_SEMAPHORE                      ((UCHAR) 4)     /* P1 = initial instances                            */
#define TX_TRACE_OBJECT_TYPE_MUTEX                          ((UCHAR) 5)     /* P1 = priority inheritance flag                    */
#define TX_TRACE_OBJECT_TYPE_EVENT_FLAGS                    ((UCHAR) 6)     /* none                                              */
#define TX_TRACE_OBJECT_TYPE_BLOCK_POOL                     ((UCHAR) 7)     /* P1 = total blocks, P2 = block size                */
#define TX_TRACE_OBJECT_TYPE_BYTE_POOL                      ((UCHAR) 8)     /* P1 = total bytes                                  */

 Event的Buffer结构体定义如下:

  • 可以根据thread_pointer和Object区域匹配,获取详细信息。
  • 对于SMP系统,event_id的高8位用于扩展Core ID。
typedef struct TX_TRACE_BUFFER_ENTRY_STRUCT
{

    ULONG                                                   tx_trace_buffer_entry_thread_pointer;--存储指向触发事件的线程的指针。0xFFFFFFFF表示在ISR中触发;0xF0F0F0F0表示在初始化时触发。到Object区域匹配tx_trace_object_entry_thread_pointer,如匹配到则找到详细信息。
    ULONG                                                   tx_trace_buffer_entry_thread_priority;--存储触发事件的线程的优先级。低16位是优先级;高8位固定为0x80000000,中间12位为tx_thread_preempt_threshold。
    ULONG                                                   tx_trace_buffer_entry_event_id;--存储事件的标识符。对于SMP系统,高8位标识Core ID。
    ULONG                                                   tx_trace_buffer_entry_time_stamp;--存储事件发生时的时间戳。
#ifdef TX_MISRA_ENABLE
    ULONG                                                   tx_trace_buffer_entry_info_1;
    ULONG                                                   tx_trace_buffer_entry_info_2;
    ULONG                                                   tx_trace_buffer_entry_info_3;
    ULONG                                                   tx_trace_buffer_entry_info_4;
#else
    ULONG                                                   tx_trace_buffer_entry_information_field_1;--存储与事件相关的额外信息。
    ULONG                                                   tx_trace_buffer_entry_information_field_2;--存储与事件相关的额外信息。
    ULONG                                                   tx_trace_buffer_entry_information_field_3;--存储与事件相关的额外信息。
    ULONG                                                   tx_trace_buffer_entry_information_field_4;--存储与事件相关的额外信息。
#endif
} TX_TRACE_BUFFER_ENTRY;

 其中Event ID按照如下划分:

  • ThreadX events: 1-199
  • FileX events: 200-299
  • NetX events: 300-599
  • USBX events: 600-999

ThreadX常用事件和额外信息定义如下:

#define TX_TRACE_THREAD_RESUME                              1           /* I1 = thread ptr, I2 = previous_state, I3 = stack ptr, I4 = next thread   */
#define TX_TRACE_THREAD_SUSPEND                             2           /* I1 = thread ptr, I2 = new_state, I3 = stack ptr  I4 = next thread        */
#define TX_TRACE_ISR_ENTER                                  3           /* I1 = stack_ptr, I2 = ISR number, I3 = system state, I4 = preempt disable */
#define TX_TRACE_ISR_EXIT                                   4           /* I1 = stack_ptr, I2 = ISR number, I3 = system state, I4 = preempt disable */
#define TX_TRACE_TIME_SLICE                                 5           /* I1 = next thread ptr, I2 = system state, I3 = preempt disable, I4 = stack*/
#define TX_TRACE_RUNNING                                    6           /* None                                                                     */

2 TraceX监测事件

2.1 ThreadX

2.1.1 插入ThreadX Object

除了在tx_trace_enable中初始化Object Entry,还可以通过TX_TRACE_OBJECT_REGISTER插入Object,通过TX_TRACE_OBJECT_UNREGISTER移除。

2.1.2 插入ThreadX Event

ThreadX在特定地点调用TX_TRACE_IN_LINE_INSERT,写入特定事件到TraceX,记录系统行为。

输入6个参数:

  • i:事件ID。
  • a,b,c,d:事件额外信息。
  • e:当前事件分组,用于过滤。
#define TX_TRACE_IN_LINE_INSERT(i,a,b,c,d,e) \
        { \
        TX_TRACE_BUFFER_ENTRY     *trace_event_ptr; \
        ULONG                      trace_system_state; \
        ULONG                      trace_priority; \
        TX_THREAD                 *trace_thread_ptr; \
        ULONG                      core; \
            trace_event_ptr =  _tx_trace_buffer_current_ptr; \
            if ((trace_event_ptr) && (_tx_trace_event_enable_bits & ((ULONG) (e)))) \--对事件分组e进行过滤。
            { \
                TX_TRACE_PORT_EXTENSION \
                trace_system_state =  (ULONG) _tx_thread_smp_current_state_get(); \--0xF0F0F0F0,初始化完成;0xF0F0F0F1,初始化差不多完成;0x00000000,初始化完成。
                TX_THREAD_GET_CURRENT(trace_thread_ptr) \
                \
                if (trace_system_state == ((ULONG) 0)) \
                { \
                    trace_priority =  trace_thread_ptr -> tx_thread_priority; \
                    trace_priority =  trace_priority | 0x80000000UL | (trace_thread_ptr -> tx_thread_preempt_threshold << 16); \
                } \
                else if (trace_system_state < 0xF0F0F0F0UL) \
                { \
                    trace_priority =    (ULONG) trace_thread_ptr; \--对应线程指针保存在trace_priority中。
                    trace_thread_ptr =  (TX_THREAD *) 0xFFFFFFFFUL; \--在ISR中触发。
                } \
                else \
                { \
                    trace_thread_ptr =  (TX_THREAD *) 0xF0F0F0F0UL; \--在初始化时触发。
                    trace_priority =    (ULONG) 0; \
                } \
                trace_event_ptr -> tx_trace_buffer_entry_thread_pointer =       (ULONG) trace_thread_ptr; \
                trace_event_ptr -> tx_trace_buffer_entry_thread_priority =      (ULONG) trace_priority; \
                core =  _tx_thread_smp_core_get(); \
                trace_event_ptr -> tx_trace_buffer_entry_event_id =             (ULONG) (core << 24) | (i); \--记录事件ID。SMP架构,记录产生事件的Core ID。
                trace_event_ptr -> tx_trace_buffer_entry_time_stamp =           (ULONG) TX_TRACE_TIME_SOURCE; \--记录时间戳。
                TX_TRACE_INFO_FIELD_ASSIGNMENT((a),(b),(c),(d)) \--插入4个额外信息。
                trace_event_ptr++; \
                if (trace_event_ptr >= _tx_trace_buffer_end_ptr) \--事件溢出,回绕插入。
                { \
                    trace_event_ptr =  _tx_trace_buffer_start_ptr; \
                    _tx_trace_buffer_current_ptr =  trace_event_ptr;  \
                    _tx_trace_header_ptr -> tx_trace_header_buffer_current_pointer =  (ULONG) trace_event_ptr; \
                    if (_tx_trace_full_notify_function) \
                        (_tx_trace_full_notify_function)((VOID *) _tx_trace_header_ptr); \
                } \
                else \
                { \
                    _tx_trace_buffer_current_ptr =  trace_event_ptr;  \
                    _tx_trace_header_ptr -> tx_trace_header_buffer_current_pointer =  (ULONG) trace_event_ptr; \
                } \
            } \
        }
#endif

2.1.3 Event Group和Event ID

参考《Ch. 6 - ThreadX trace events》。

 Event Groupt  Event ID  Event Detail
TX_TRACE_INTERNAL_EVENTS 

TX_TRACE_THREAD_RESUME
TX_TRACE_THREAD_SUSPEND
TX_TRACE_ISR_ENTER
TX_TRACE_ISR_EXIT
TX_TRACE_TIME_SLICE
TX_TRACE_RUNNING

/* I1 = thread ptr, I2 = previous_state, I3 = stack ptr, I4 = next thread */
/* I1 = thread ptr, I2 = new_state, I3 = stack ptr I4 = next thread */
/* I1 = stack_ptr, I2 = ISR number, I3 = system state, I4 = preempt disable */
/* I1 = stack_ptr, I2 = ISR number, I3 = system state, I4 = preempt disable */
/* I1 = next thread ptr, I2 = system state, I3 = preempt disable, I4 = stack*/
/* None */

 TX_TRACE_BLOCK_POOL_EVENTS

TX_TRACE_BLOCK_ALLOCATE
TX_TRACE_BLOCK_POOL_CREATE
TX_TRACE_BLOCK_POOL_DELETE
TX_TRACE_BLOCK_POOL_INFO_GET
TX_TRACE_BLOCK_POOL_PERFORMANCE_INFO_GET
TX_TRACE_BLOCK_POOL__PERFORMANCE_SYSTEM_INFO_GET
TX_TRACE_BLOCK_POOL_PRIORITIZE
TX_TRACE_BLOCK_RELEASE

/* I1 = pool ptr, I2 = memory ptr, I3 = wait option, I4 = remaining blocks */
/* I1 = pool ptr, I2 = pool_start, I3 = total blocks, I4 = block size */
/* I1 = pool ptr, I2 = stack ptr */
/* I1 = pool ptr */
/* I1 = pool ptr */
/* None */
/* I1 = pool ptr, I2 = suspended count, I3 = stack ptr */
/* I1 = pool ptr, I2 = memory ptr, I3 = suspended, I4 = stack ptr */

 TX_TRACE_BYTE_POOL_EVENTS

TX_TRACE_BYTE_ALLOCATE
TX_TRACE_BYTE_POOL_CREATE
TX_TRACE_BYTE_POOL_DELETE
TX_TRACE_BYTE_POOL_INFO_GET
TX_TRACE_BYTE_POOL_PERFORMANCE_INFO_GET
TX_TRACE_BYTE_POOL__PERFORMANCE_SYSTEM_INFO_GET
TX_TRACE_BYTE_POOL_PRIORITIZE
TX_TRACE_BYTE_RELEASE

/* I1 = pool ptr, I2 = memory ptr, I3 = size requested, I4 = wait option */
/* I1 = pool ptr, I2 = start ptr, I3 = pool size, I4 = stack ptr */
/* I1 = pool ptr, I2 = stack ptr */
/* I1 = pool ptr */
/* I1 = pool ptr */
/* None */
/* I1 = pool ptr, I2 = suspended count, I3 = stack ptr */
/* I1 = pool ptr, I2 = memory ptr, I3 = suspended, I4 = available bytes */

 TX_TRACE_EVENT_FLAGS_EVENTS

TX_TRACE_EVENT_FLAGS_CREATE
TX_TRACE_EVENT_FLAGS_DELETE
TX_TRACE_EVENT_FLAGS_GET
TX_TRACE_EVENT_FLAGS_INFO_GET
TX_TRACE_EVENT_FLAGS_PERFORMANCE_INFO_GET
TX_TRACE_EVENT_FLAGS__PERFORMANCE_SYSTEM_INFO_GET
TX_TRACE_EVENT_FLAGS_SET
TX_TRACE_EVENT_FLAGS_SET_NOTIFY

 /* I1 = group ptr, I2 = stack ptr */

/* I1 = group ptr, I2 = stack ptr */
/* I1 = group ptr, I2 = requested flags, I3 = current flags, I4 = get option*/
/* I1 = group ptr */
/* I1 = group ptr */
/* None */
/* I1 = group ptr, I2 = flags to set, I3 = set option, I4= suspended count */
/* I1 = group ptr */

TX_TRACE_INTERRUPT_CONTROL_EVENT  TX_TRACE_INTERRUPT_CONTROL  /* I1 = new interrupt posture, I2 = stack ptr                               */
TX_TRACE_MUTEX_EVENTS

TX_TRACE_MUTEX_CREATE
TX_TRACE_MUTEX_DELETE
TX_TRACE_MUTEX_GET
TX_TRACE_MUTEX_INFO_GET
TX_TRACE_MUTEX_PERFORMANCE_INFO_GET
TX_TRACE_MUTEX_PERFORMANCE_SYSTEM_INFO_GET
TX_TRACE_MUTEX_PRIORITIZE
TX_TRACE_MUTEX_PUT

/* I1 = mutex ptr, I2 = inheritance, I3 = stack ptr */
/* I1 = mutex ptr, I2 = stack ptr */
/* I1 = mutex ptr, I2 = wait option, I3 = owning thread, I4 = own count */
/* I1 = mutex ptr */
/* I1 = mutex ptr */
/* None */
/* I1 = mutex ptr, I2 = suspended count, I3 = stack ptr */
/* I1 = mutex ptr, I2 = owning thread, I3 = own count, I4 = stack ptr */

TX_TRACE_QUEUE_EVENTS

TX_TRACE_QUEUE_CREATE
TX_TRACE_QUEUE_DELETE
TX_TRACE_QUEUE_FLUSH
TX_TRACE_QUEUE_FRONT_SEND
TX_TRACE_QUEUE_INFO_GET
TX_TRACE_QUEUE_PERFORMANCE_INFO_GET
TX_TRACE_QUEUE_PERFORMANCE_SYSTEM_INFO_GET
TX_TRACE_QUEUE_PRIORITIZE
TX_TRACE_QUEUE_RECEIVE
TX_TRACE_QUEUE_SEND
TX_TRACE_QUEUE_SEND_NOTIFY

/* I1 = queue ptr, I2 = message size, I3 = queue start, I4 = queue size */
/* I1 = queue ptr, I2 = stack ptr */
/* I1 = queue ptr, I2 = stack ptr */
/* I1 = queue ptr, I2 = source ptr, I3 = wait option, I4 = enqueued */
/* I1 = queue ptr */
/* I1 = queue ptr */
/* None */
/* I1 = queue ptr, I2 = suspended count, I3 = stack ptr */
/* I1 = queue ptr, I2 = destination ptr, I3 = wait option, I4 = enqueued */
/* I1 = queue ptr, I2 = source ptr, I3 = wait option, I4 = enqueued */
/* I1 = queue ptr */

TX_TRACE_SEMAPHORE_EVENTS

TX_TRACE_SEMAPHORE_CEILING_PUT
TX_TRACE_SEMAPHORE_CREATE
TX_TRACE_SEMAPHORE_DELETE
TX_TRACE_SEMAPHORE_GET
TX_TRACE_SEMAPHORE_INFO_GET
TX_TRACE_SEMAPHORE_PERFORMANCE_INFO_GET
TX_TRACE_SEMAPHORE__PERFORMANCE_SYSTEM_INFO_GET
TX_TRACE_SEMAPHORE_PRIORITIZE
TX_TRACE_SEMAPHORE_PUT
TX_TRACE_SEMAPHORE_PUT_NOTIFY

/* I1 = semaphore ptr, I2 = current count, I3 = suspended count,I4 =ceiling */
/* I1 = semaphore ptr, I2 = initial count, I3 = stack ptr */
/* I1 = semaphore ptr, I2 = stack ptr */
/* I1 = semaphore ptr, I2 = wait option, I3 = current count, I4 = stack ptr */
/* I1 = semaphore ptr */
/* I1 = semaphore ptr */
/* None */
/* I1 = semaphore ptr, I2 = suspended count, I2 = stack ptr */
/* I1 = semaphore ptr, I2 = current count, I3 = suspended count,I4=stack ptr*/
/* I1 = semaphore ptr */

TX_TRACE_THREAD_EVENTS

TX_TRACE_THREAD_CREATE
TX_TRACE_THREAD_DELETE
TX_TRACE_THREAD_ENTRY_EXIT_NOTIFY
TX_TRACE_THREAD_IDENTIFY
TX_TRACE_THREAD_INFO_GET
TX_TRACE_THREAD_PERFORMANCE_INFO_GET
TX_TRACE_THREAD_PERFORMANCE_SYSTEM_INFO_GET
TX_TRACE_THREAD_PREEMPTION_CHANGE
TX_TRACE_THREAD_PRIORITY_CHANGE
TX_TRACE_THREAD_RELINQUISH
TX_TRACE_THREAD_RESET
TX_TRACE_THREAD_RESUME_API
TX_TRACE_THREAD_SLEEP
TX_TRACE_THREAD_STACK_ERROR_NOTIFY
TX_TRACE_THREAD_SUSPEND_API
TX_TRACE_THREAD_TERMINATE
TX_TRACE_THREAD_TIME_SLICE_CHANGE
TX_TRACE_THREAD_WAIT_ABORT

/* I1 = thread ptr, I2 = priority, I3 = stack ptr, I4 = stack_size */
/* I1 = thread ptr, I2 = stack ptr */
/* I1 = thread ptr, I2 = thread state, I3 = stack ptr */
/* None */
/* I1 = thread ptr, I2 = thread state */
/* I1 = thread ptr, I2 = thread state */
/* None */
/* I1 = thread ptr, I2 = new threshold, I3 = old threshold, I4 =thread state*/
/* I1 = thread ptr, I2 = new priority, I3 = old priority, I4 = thread state */
/* I1 = stack ptr, I2 = next thread ptr */
/* I1 = thread ptr, I2 = thread state */
/* I1 = thread ptr, I2 = thread state, I3 = stack ptr */
/* I1 = sleep value, I2 = thread state, I3 = stack ptr */
/* None */
/* I1 = thread ptr, I2 = thread state, I3 = stack ptr */
/* I1 = thread ptr, I2 = thread state, I3 = stack ptr */
/* I1 = thread ptr, I2 = new timeslice, I3 = old timeslice */
/* I1 = thread ptr, I2 = thread state, I3 = stack ptr */

TX_TRACE_TIME_EVENTS

TX_TRACE_TIME_GET
TX_TRACE_TIME_SET

/* I1 = current time, I2 = stack ptr */
/* I1 = new time */

TX_TRACE_TIMER_EVENTS

TX_TRACE_TIMER_ACTIVATE
TX_TRACE_TIMER_CHANGE
TX_TRACE_TIMER_CREATE
TX_TRACE_TIMER_DEACTIVATE
TX_TRACE_TIMER_DELETE
TX_TRACE_TIMER_INFO_GET
TX_TRACE_TIMER_PERFORMANCE_INFO_GET
TX_TRACE_TIMER_PERFORMANCE_SYSTEM_INFO_GET

/* I1 = timer ptr */
/* I1 = timer ptr, I2 = initial ticks, I3= reschedule ticks */
/* I1 = timer ptr, I2 = initial ticks, I3= reschedule ticks, I4 = enable */
/* I1 = timer ptr, I2 = stack ptr */
/* I1 = timer ptr */
/* I1 = timer ptr, I2 = stack ptr */
/* I1 = timer ptr */
/* None */

TX_TRACE_USER_EVENTS    

 2.2 FileX

参考《Ch. 7 - FileX trace events》。

FX_TRACE_OBJECT_REGISTER注册FileX的Object,FX_TRACE_OBJECT_UNREGISTER去注册Object。

FX_TRACE_IN_LINE_INSERT插入FileX的Event到TraceX,FX_TRACE_EVENT_UPDATE匹配EventID和Timestamp后跟新Event额外信息。

 Event Group Event ID  Event Detail 
FX_TRACE_INTERNAL_EVENTS  

FX_TRACE_INTERNAL_LOG_SECTOR_CACHE_MISS
FX_TRACE_INTERNAL_DIR_CACHE_MISS
FX_TRACE_INTERNAL_MEDIA_FLUSH
FX_TRACE_INTERNAL_DIR_ENTRY_READ
FX_TRACE_INTERNAL_DIR_ENTRY_WRITE
FX_TRACE_INTERNAL_IO_DRIVER_READ
FX_TRACE_INTERNAL_IO_DRIVER_WRITE
FX_TRACE_INTERNAL_IO_DRIVER_FLUSH
FX_TRACE_INTERNAL_IO_DRIVER_ABORT
FX_TRACE_INTERNAL_IO_DRIVER_INIT
FX_TRACE_INTERNAL_IO_DRIVER_BOOT_READ
FX_TRACE_INTERNAL_IO_DRIVER_RELEASE_SECTORS
FX_TRACE_INTERNAL_IO_DRIVER_BOOT_WRITE
FX_TRACE_INTERNAL_IO_DRIVER_UNINIT

 

FX_TRACE_SYSTEM_DATE_GET
FX_TRACE_SYSTEM_DATE_SET
FX_TRACE_SYSTEM_INITIALIZE
FX_TRACE_SYSTEM_TIME_GET
FX_TRACE_SYSTEM_TIME_SET

 

/* I1 = media ptr, I2 = sector, I3 = total misses, I4 = cache size */
/* I1 = media ptr, I2 = total misses */
/* I1 = media ptr, I2 = dirty sectors */
/* I1 = media ptr */
/* I1 = media ptr */
/* I1 = media ptr, I2 = sector, I3 = number of sectors, I4 = buffer */
/* I1 = media ptr, I2 = sector, I3 = number of sectors, I4 = buffer */
/* I1 = media ptr */
/* I1 = media ptr */
/* I1 = media ptr */
/* I1 = media ptr, I2 = buffer */
/* I1 = media ptr, I2 = sector, I3 = number of sectors */
/* I1 = media ptr, I2 = buffer */
/* I1 = media ptr */

 

/* I1 = year, I2 = month, I3 = day */
/* I1 = year, I2 = month, I3 = day */
/* None */
/* I1 = hour, I2 = minute, I3 = second */
/* I1 = hour, I2 = minute, I3 = second */

FX_TRACE_MEDIA_EVENTS  

FX_TRACE_MEDIA_ABORT
FX_TRACE_MEDIA_CACHE_INVALIDATE
FX_TRACE_MEDIA_CHECK
FX_TRACE_MEDIA_CLOSE
FX_TRACE_MEDIA_FLUSH
FX_TRACE_MEDIA_FORMAT
FX_TRACE_MEDIA_OPEN
FX_TRACE_MEDIA_READ
FX_TRACE_MEDIA_SPACE_AVAILABLE
FX_TRACE_MEDIA_VOLUME_GET
FX_TRACE_MEDIA_VOLUME_SET
FX_TRACE_MEDIA_WRITE

 

/* I1 = media ptr */
/* I1 = media ptr */
/* I1 = media ptr, I2 = scratch memory, I3 = scratch memory size, I4 =errors*/
/* I1 = media ptr */
/* I1 = media ptr */
/* I1 = media ptr, I2 = root entries, I3 = sectors, I4 = sectors per cluster*/
/* I1 = media ptr, I2 = media driver, I3 = memory ptr, I4 = memory size */
/* I1 = media ptr, I2 = logical sector, I3 = buffer ptr, I4 = bytes read */
/* I1 = media ptr, I2 = available bytes ptr, I3 = available clusters */
/* I1 = media ptr, I2 = volume name, I3 = volume source */
/* I1 = media ptr, I2 = volume name */
/* I1 = media ptr, I2 = logical_sector, I3 = buffer_ptr, I4 = byte written */

FX_TRACE_DIRECTORY_EVENTS

FX_TRACE_DIRECTORY_ATTRIBUTES_READ
FX_TRACE_DIRECTORY_ATTRIBUTES_SET
FX_TRACE_DIRECTORY_CREATE
FX_TRACE_DIRECTORY_DEFAULT_GET
FX_TRACE_DIRECTORY_DEFAULT_SET
FX_TRACE_DIRECTORY_DELETE
FX_TRACE_DIRECTORY_FIRST_ENTRY_FIND
FX_TRACE_DIRECTORY_FIRST_FULL_ENTRY_FIND
FX_TRACE_DIRECTORY_INFORMATION_GET
FX_TRACE_DIRECTORY_LOCAL_PATH_CLEAR
FX_TRACE_DIRECTORY_LOCAL_PATH_GET
FX_TRACE_DIRECTORY_LOCAL_PATH_RESTORE
FX_TRACE_DIRECTORY_LOCAL_PATH_SET
FX_TRACE_DIRECTORY_LONG_NAME_GET
FX_TRACE_DIRECTORY_NAME_TEST
FX_TRACE_DIRECTORY_NEXT_ENTRY_FIND
FX_TRACE_DIRECTORY_NEXT_FULL_ENTRY_FIND
FX_TRACE_DIRECTORY_RENAME
FX_TRACE_DIRECTORY_SHORT_NAME_GET

 

FX_TRACE_UNICODE_DIRECTORY_CREATE
FX_TRACE_UNICODE_DIRECTORY_RENAME

/* I1 = media ptr, I2 = directory name, I3 = attributes */
/* I1 = media ptr, I2 = directory name, I3 = attributes */
/* I1 = media ptr, I2 = directory name */
/* I1 = media ptr, I2 = return path name */
/* I1 = media ptr, I2 = new path name */
/* I1 = media ptr, I2 = directory name */
/* I1 = media ptr, I2 = directory name */
/* I1 = media ptr, I2 = directory name */
/* I1 = media ptr, I2 = directory name */
/* I1 = media ptr */
/* I1 = media ptr, I2 = return path name */
/* I1 = media ptr, I2 = local path ptr */
/* I1 = media ptr, I2 = local path ptr, I3 = new path name */
/* I1 = media ptr, I2 = short file name, I3 = long file name */
/* I1 = media ptr, I2 = directory name */
/* I1 = media ptr, I2 = directory name */
/* I1 = media ptr, I2 = directory name */
/* I1 = media ptr, I2 = old directory name, I3 = new directory name */
/* I1 = media ptr, I2 = long file name, I3 = short file name */

 

/* I1 = media ptr, I2 = source unicode, I3 = source length, I4 = short_name */
/* I1 = media ptr, I2 = source unicode, I3 = source length, I4 = new_name */

FX_TRACE_FILE_EVENTS  

FX_TRACE_FILE_ALLOCATE
FX_TRACE_FILE_ATTRIBUTES_READ
FX_TRACE_FILE_ATTRIBUTES_SET
FX_TRACE_FILE_BEST_EFFORT_ALLOCATE
FX_TRACE_FILE_CLOSE
FX_TRACE_FILE_CREATE
FX_TRACE_FILE_DATE_TIME_SET
FX_TRACE_FILE_DELETE
FX_TRACE_FILE_OPEN
FX_TRACE_FILE_READ
FX_TRACE_FILE_RELATIVE_SEEK
FX_TRACE_FILE_RENAME
FX_TRACE_FILE_SEEK
FX_TRACE_FILE_TRUNCATE
FX_TRACE_FILE_TRUNCATE_RELEASE
FX_TRACE_FILE_WRITE

 

FX_TRACE_UNICODE_FILE_CREATE
FX_TRACE_UNICODE_FILE_RENAME
FX_TRACE_UNICODE_LENGTH_GET
FX_TRACE_UNICODE_NAME_GET
FX_TRACE_UNICODE_SHORT_NAME_GET

 

/* I1 = file ptr, I2 = size I3 = previous size, I4 = new size */
/* I1 = media ptr, I2 = file name, I3 = attributes */
/* I1 = media ptr, I2 = file name, I3 = attributes */
/* I1 = file ptr, I2 = size, I3 = actual_size_allocated */
/* I1 = file ptr, I3 = file size */
/* I1 = media ptr, I2 = file name */
/* I1 = media ptr, I2 = file name, I3 = year, I4 = month */
/* I1 = media ptr, I2 = file name */
/* I1 = media ptr, I2 = file ptr, I3 = file name, I4 = open type */
/* I1 = file ptr, I2 = buffer ptr, I3 = request size I4 = actual size */
/* I1 = file ptr, I2 = byte offset, I3 = seek from, I4 = previous offset */
/* I1 = media ptr, I2 = old file name, I3 = new file name */
/* I1 = file ptr, I2 = byte offset, I3 = previous offset */
/* I1 = file ptr, I2 = size, I3 = previous size, I4 = new size */
/* I1 = file ptr, I2 = size, I3 = previous size, I4 = new size */
/* I1 = file ptr, I2 = buffer ptr, I3 = size, I4 = bytes written */

 

/* I1 = media ptr, I2 = source unicode, I3 = source length, I4 = short name */
/* I1 = media ptr, I2 = source unicode, I3 = source length, I4 = new name */
/* I1 = unicode name, I2 = length */
/* I1 = media ptr, I2 = source short name, I3 = unicode name, I4 = length */
/* I1 = media ptr, I2 = source unicode name, I3 = length, I4 = short name */

 2.3 NetX Duo

参考《Ch. 8 - NetX Duo trace events》。

NX_TRACE_OBJECT_REGISTER注册NetX Duo的Object,NX_TRACE_OBJECT_UNREGISTER去注册Object。

NX_TRACE_IN_LINE_INSERT插入NetX Duo的Event到TraceX,NX_TRACE_EVENT_UPDATE匹配EventID和Timestamp后跟新Event额外信息。

 Event Group Event ID  Event Detail 
NX_TRACE_INTERNAL_EVENTS

NX_TRACE_INTERNAL_ARP_REQUEST_RECEIVE
NX_TRACE_INTERNAL_ARP_REQUEST_SEND
NX_TRACE_INTERNAL_ARP_RESPONSE_RECEIVE
NX_TRACE_INTERNAL_ARP_RESPONSE_SEND
NX_TRACE_INTERNAL_ICMP_RECEIVE
NX_TRACE_INTERNAL_ICMP_SEND
NX_TRACE_INTERNAL_IGMP_RECEIVE

NX_TRACE_INTERNAL_IP_RECEIVE
NX_TRACE_INTERNAL_IP_SEND
NX_TRACE_INTERNAL_TCP_DATA_RECEIVE
NX_TRACE_INTERNAL_TCP_DATA_SEND
NX_TRACE_INTERNAL_TCP_FIN_RECEIVE
NX_TRACE_INTERNAL_TCP_FIN_SEND
NX_TRACE_INTERNAL_TCP_RESET_RECEIVE
NX_TRACE_INTERNAL_TCP_RESET_SEND
NX_TRACE_INTERNAL_TCP_SYN_RECEIVE
NX_TRACE_INTERNAL_TCP_SYN_SEND
NX_TRACE_INTERNAL_UDP_RECEIVE
NX_TRACE_INTERNAL_UDP_SEND
NX_TRACE_INTERNAL_RARP_RECEIVE
NX_TRACE_INTERNAL_RARP_SEND
NX_TRACE_INTERNAL_TCP_RETRY
NX_TRACE_INTERNAL_TCP_STATE_CHANGE
NX_TRACE_INTERNAL_IO_DRIVER_PACKET_SEND
NX_TRACE_INTERNAL_IO_DRIVER_INITIALIZE
NX_TRACE_INTERNAL_IO_DRIVER_LINK_ENABLE
NX_TRACE_INTERNAL_IO_DRIVER_LINK_DISABLE
NX_TRACE_INTERNAL_IO_DRIVER_PACKET_BROADCAST
NX_TRACE_INTERNAL_IO_DRIVER_ARP_SEND
NX_TRACE_INTERNAL_IO_DRIVER_ARP_RESPONSE_SEND
NX_TRACE_INTERNAL_IO_DRIVER_RARP_SEND
NX_TRACE_INTERNAL_IO_DRIVER_MULTICAST_JOIN
NX_TRACE_INTERNAL_IO_DRIVER_MULTICAST_LEAVE
NX_TRACE_INTERNAL_IO_DRIVER_GET_STATUS
NX_TRACE_INTERNAL_IO_DRIVER_GET_SPEED
NX_TRACE_INTERNAL_IO_DRIVER_GET_DUPLEX_TYPE
NX_TRACE_INTERNAL_IO_DRIVER_GET_ERROR_COUNT
NX_TRACE_INTERNAL_IO_DRIVER_GET_RX_COUNT
NX_TRACE_INTERNAL_IO_DRIVER_GET_TX_COUNT
NX_TRACE_INTERNAL_IO_DRIVER_GET_ALLOC_ERRORS
NX_TRACE_INTERNAL_IO_DRIVER_UNINITIALIZE
NX_TRACE_INTERNAL_IO_DRIVER_DEFERRED_PROCESSING

 

NX_TRACE_SYSTEM_INITIALIZE

/* I1 = ip ptr, I2 = source IP address, I3 = packet ptr */
/* I1 = ip ptr, I2 = destination IP address, I3 = packet ptr */
/* I1 = ip ptr, I2 = source IP address, I3 = packet ptr */
/* I1 = ip ptr, I2 = destination IP address, I3 = packet ptr */
/* I1 = ip ptr, I2 = source IP address, I3 = packet ptr, I4 = header word 0 */
/* I1 = ip ptr, I2 = destination IP address, I3 = packet ptr, I4 = header 0 */
/* I1 = ip ptr, I2 = source IP address, I3 = packet ptr, I4 = header word 0 */

/* I1 = ip ptr, I2 = source IP address, I3 = packet ptr, I4 = packet length */
/* I1 = ip ptr, I2 = destination IP address, I3 = packet ptr, I4 = length */
/* I1 = ip ptr, I2 = source IP address, I3 = packet ptr, I4 = sequence */
/* I1 = ip ptr, I2 = socket ptr, I3 = packet ptr, I4 = sequence */
/* I1 = ip ptr, I2 = socket ptr, I3 = packet ptr, I4 = sequence */
/* I1 = ip ptr, I2 = socket ptr, I3 = packet ptr, I4 = sequence */
/* I1 = ip ptr, I2 = socket ptr, I3 = packet ptr, I4 = sequence */
/* I1 = ip ptr, I2 = socket ptr, I3 = packet ptr, I4 = sequence */
/* I1 = ip ptr, I2 = socket ptr, I3 = packet ptr, I4 = sequence */
/* I1 = ip ptr, I2 = socket ptr, I3 = packet ptr, I4 = sequence */
/* I1 = ip ptr, I2 = socket ptr, I3 = packet ptr, I4 = header word 0 */
/* I1 = ip ptr, I2 = socket_ptr, I3 = packet ptr, I4 = header 0 */
/* I1 = ip ptr, I2 = target IP address, I3 = packet ptr, I4 = header word 1 */
/* I1 = ip ptr, I2 = target IP address, I3 = packet ptr, I4 = header word 1 */
/* I1 = ip ptr, I2 = socket ptr, I3 = packet ptr, I4 = number of retries */
/* I1 = ip ptr, I2 = socket ptr, I3 = previous state, I4 = new state */
/* I1 = ip ptr, I2 = packet ptr, I3 = packet size */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr, I2 = packet ptr, I3 = packet size */
/* I1 = ip ptr, I2 = packet ptr, I3 = packet size */
/* I1 = ip ptr, I2 = packet ptr, I3 = packet size */
/* I1 = ip ptr, I2 = packet ptr, I3 = packet size */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr, I2 = packet ptr, I3 = packet size */

 

/* none                                                                     */

NX_TRACE_ARP_EVENTS

NX_TRACE_ARP_DYNAMIC_ENTRIES_INVALIDATE
NX_TRACE_ARP_DYNAMIC_ENTRY_SET
NX_TRACE_ARP_ENABLE
NX_TRACE_ARP_GRATUITOUS_SEND
NX_TRACE_ARP_HARDWARE_ADDRESS_FIND
NX_TRACE_ARP_INFO_GET
NX_TRACE_ARP_IP_ADDRESS_FIND
NX_TRACE_ARP_STATIC_ENTRIES_DELETE
NX_TRACE_ARP_STATIC_ENTRY_CREATE
NX_TRACE_ARP_STATIC_ENTRY_DELETE

/* I1 = ip ptr, I2 = entries invalidated */
/* I1 = ip ptr, I2 = ip address, I3 = physical msw, I4 = physical lsw */
/* I1 = ip ptr, I2 = arp cache memory, I3 = arp cache size */
/* I1 = ip ptr */
/* I1 = ip ptr, I2 = ip_address, I3 = physical msw, I4 = physical lsw */
/* I1 = ip ptr, I2 = arps sent, I3 = arp responses, I3 = arps received */
/* I1 = ip ptr, I2 = ip address, I3 = physical msw, I4 = physical lsw */
/* I1 = ip ptr, I2 = entries deleted */
/* I1 = ip ptr, I2 = ip address, I3 = physical msw, I4 = physical_lsw */
/* I1 = ip ptr, I2 = ip address, I3 = physical_msw, I4 = physical_lsw */

NX_TRACE_ICMP_EVENTS

NX_TRACE_ICMP_ENABLE
NX_TRACE_ICMP_INFO_GET
NX_TRACE_ICMP_PING

/* I1 = ip ptr */
/* I1 = ip ptr, I2 = pings sent, I3 = ping responses, I4 = pings received */
/* I1 = ip ptr, I2 = ip_address, I3 = data ptr, I4 = data size */

NX_TRACE_IGMP_EVENTS NX_TRACE_IGMP_ENABLE
NX_TRACE_IGMP_INFO_GET
NX_TRACE_IGMP_LOOPBACK_DISABLE
NX_TRACE_IGMP_LOOPBACK_ENABLE
NX_TRACE_IGMP_MULTICAST_JOIN
NX_TRACE_IGMP_MULTICAST_LEAVE
/* I1 = ip ptr */
/* I1 = ip ptr, I2 = reports sent, I3 = queries received, I4 = groups joined*/
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr, I2 = group address */
/* I1 = ip ptr, I2 = group_address */
NX_TRACE_IP_EVENTS

NX_TRACE_IP_ADDRESS_CHANGE_NOTIFY
NX_TRACE_IP_ADDRESS_GET
NX_TRACE_IP_ADDRESS_SET
NX_TRACE_IP_CREATE
NX_TRACE_IP_DELETE
NX_TRACE_IP_DRIVER_DIRECT_COMMAND
NX_TRACE_IP_FORWARDING_DISABLE
NX_TRACE_IP_FORWARDING_ENABLE
NX_TRACE_IP_FRAGMENT_DISABLE
NX_TRACE_IP_FRAGMENT_ENABLE
NX_TRACE_IP_GATEWAY_ADDRESS_SET
NX_TRACE_IP_INFO_GET
NX_TRACE_IP_RAW_PACKET_DISABLE
NX_TRACE_IP_RAW_PACKET_ENABLE
NX_TRACE_IP_RAW_PACKET_RECEIVE
NX_TRACE_IP_RAW_PACKET_SEND
NX_TRACE_IP_STATUS_CHECK

 

NX_TRACE_IP_INTERFACE_ATTACH

NX_TRACE_IP_STATIC_ROUTE_ENABLE
NX_TRACE_IP_STATIC_ROUTE_DISABLE
NX_TRACE_IP_STATIC_ROUTE_ADD
NX_TRACE_IP_STATIC_ROUTE_DELETE

 

NX_TRACE_IP_INTERFACE_INFO_GET

 

/* I1 = ip ptr, I2 = ip address change notify, I3 = additional info */
/* I1 = ip ptr, I2 = ip address, I3 = network_mask */
/* I1 = ip ptr, I2 = ip address, I3 = network_mask */
/* I1 = ip ptr, I2 = ip address, I3 = network mask, I4 = default_pool */
/* I1 = ip ptr */
/* I1 = ip ptr, I2 = command, I3 = return value */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr, I2 = gateway address */
/* I1 = ip ptr, I2 = bytes sent, I3 = bytes received, I4 = packets dropped */
/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr, I2 = packet ptr, I3 = wait option */
/* I1 = ip ptr, I2 = packet ptr, I3 = destination ip, I4 = type of service */
/* I1 = ip ptr, I2 = needed status, I3 = actual status, I4 = wait option */

 

/* I1 = ip ptr, I2 = ip address, I3 = interface index                       */

/* I1 = ip_ptr, */
/* I1 = ip_ptr, */
/* I1 = ip_ptr, I2 = network_address, I3 = net_mask, I4 = next_hop */
/* I1 = ip_ptr, I2 = network_address, I3 = net_mask */

 

/* I1 = ip_ptr, I2 = ip_address, I3 = mtu_size, I4 = interface_index        */

NX_TRACE_PACKET_EVENTS

NX_TRACE_PACKET_ALLOCATE
NX_TRACE_PACKET_COPY
NX_TRACE_PACKET_DATA_APPEND
NX_TRACE_PACKET_DATA_RETRIEVE
NX_TRACE_PACKET_LENGTH_GET
NX_TRACE_PACKET_POOL_CREATE
NX_TRACE_PACKET_POOL_DELETE
NX_TRACE_PACKET_POOL_INFO_GET
NX_TRACE_PACKET_RELEASE
NX_TRACE_PACKET_TRANSMIT_RELEASE

 

NX_TRACE_PACKET_DATA_EXTRACT_OFFSET

/* I1 = pool ptr, I2 = packet ptr, I3 = packet type, I4 = available packets */
/* I1 = packet ptr, I2 = new packet ptr, I3 = pool ptr, I4 = wait option */
/* I1 = packet ptr, I2 = data start, I3 = data size, I4 = pool ptr */
/* I1 = packet ptr, I2 = buffer start, I3 = bytes copied */
/* I1 = packet ptr, I2 = length */
/* I1 = pool ptr, I2 = payload size, I3 = memory ptr, I4 = memory_size */
/* I1 = pool ptr */
/* I1 = pool ptr, I2 = total_packets, I3 = free packets, I4 = empty requests*/
/* I1 = packet ptr, I2 = packet status, I3 = available packets */
/* I1 = packet ptr, I2 = packet status, I3 = available packets */

 

/* I1 = packet_ptr, I2 = buffer_length, I3 = bytes_copied,                  */

NX_TRACE_RARP_EVENTS

NX_TRACE_RARP_DISABLE
NX_TRACE_RARP_ENABLE
NX_TRACE_RARP_INFO_GET

/* I1 = ip ptr */
/* I1 = ip ptr */
/* I1 = ip ptr, I2 = requests sent, I3 = responses received, I4 = invalids */

NX_TRACE_TCP_EVENTS

NX_TRACE_TCP_CLIENT_SOCKET_BIND
NX_TRACE_TCP_CLIENT_SOCKET_CONNECT
NX_TRACE_TCP_CLIENT_SOCKET_PORT_GET
NX_TRACE_TCP_CLIENT_SOCKET_UNBIND
NX_TRACE_TCP_ENABLE
NX_TRACE_TCP_FREE_PORT_FIND
NX_TRACE_TCP_INFO_GET
NX_TRACE_TCP_SERVER_SOCKET_ACCEPT
NX_TRACE_TCP_SERVER_SOCKET_LISTEN
NX_TRACE_TCP_SERVER_SOCKET_RELISTEN
NX_TRACE_TCP_SERVER_SOCKET_UNACCEPT
NX_TRACE_TCP_SERVER_SOCKET_UNLISTEN
NX_TRACE_TCP_SOCKET_CREATE
NX_TRACE_TCP_SOCKET_DELETE
NX_TRACE_TCP_SOCKET_DISCONNECT
NX_TRACE_TCP_SOCKET_INFO_GET
NX_TRACE_TCP_SOCKET_MSS_GET
NX_TRACE_TCP_SOCKET_MSS_PEER_GET
NX_TRACE_TCP_SOCKET_MSS_SET
NX_TRACE_TCP_SOCKET_RECEIVE
NX_TRACE_TCP_SOCKET_RECEIVE_NOTIFY
NX_TRACE_TCP_SOCKET_SEND
NX_TRACE_TCP_SOCKET_STATE_WAIT
NX_TRACE_TCP_SOCKET_TRANSMIT_CONFIGURE

 

NX_TRACE_TCP_SOCKET_PEER_INFO_GET
NX_TRACE_TCP_SOCKET_WINDOW_UPDATE_NOTIFY_SET

/* I1 = ip ptr, I2 = socket ptr, I3 = port, I4 = wait option */
/* I1 = ip ptr, I2 = socket ptr, I3 = server ip, I4 = server port */
/* I1 = ip ptr, I2 = socket ptr, I3 = port */
/* I1 = ip ptr, I2 = socket ptr */
/* I1 = ip ptr */
/* I1 = ip ptr, I2 = port, I3 = free port */
/* I1 = ip ptr, I2 = bytes sent, I3 = bytes received, I4 = invalid packets */
/* I1 = ip ptr, I2 = socket ptr, I3 = wait option, I4 = socket state */
/* I1 = ip ptr, I2 = port, I3 = socket ptr, I4 = listen queue size */
/* I1 = ip ptr, I2 = port, I3 = socket ptr, I4 = socket state */
/* I1 = ip ptr, I2 = socket ptr, I3 = socket state */
/* I1 = ip ptr, I2 = port */
/* I1 = ip ptr, I2 = socket ptr, I3 = type of service, I4 = window size */
/* I1 = ip ptr, I2 = socket ptr, I3 = socket state */
/* I1 = ip ptr, I2 = socket ptr, I3 = wait option, I4 = socket state */
/* I1 = ip ptr, I2 = socket ptr, I3 = bytes sent, I4 = bytes received */
/* I1 = ip ptr, I2 = socket ptr, I3 = mss, I4 = socket state */
/* I1 = ip ptr, I2 = socket ptr, I3 = peer_mss, I4 = socket state */
/* I1 = ip ptr, I2 = socket ptr, I3 = mss, I4 socket state */
/* I1 = socket ptr, I2 = packet ptr, I3 = length, I4 = rx sequence */
/* I1 = ip ptr, I2 = socket ptr, I3 = receive notify */
/* I1 = socket ptr, I2 = packet ptr, I3 = length, I4 = tx sequence */
/* I1 = ip ptr, I2 = socket ptr, I3 = desired state, I4 = previous state */
/* I1 = ip ptr, I2 = socket ptr, I3 = queue depth, I4 = timeout */

 

/* I1 = socket ptr, I2 = network_address, I3 = port */
/* I1 = socket ptr, */

NX_TRACE_UDP_EVENTS

NX_TRACE_UDP_ENABLE
NX_TRACE_UDP_FREE_PORT_FIND
NX_TRACE_UDP_INFO_GET
NX_TRACE_UDP_SOCKET_BIND
NX_TRACE_UDP_SOCKET_CHECKSUM_DISABLE
NX_TRACE_UDP_SOCKET_CHECKSUM_ENABLE
NX_TRACE_UDP_SOCKET_CREATE
NX_TRACE_UDP_SOCKET_DELETE
NX_TRACE_UDP_SOCKET_INFO_GET
NX_TRACE_UDP_SOCKET_PORT_GET
NX_TRACE_UDP_SOCKET_RECEIVE
NX_TRACE_UDP_SOCKET_RECEIVE_NOTIFY
NX_TRACE_UDP_SOCKET_SEND
NX_TRACE_UDP_SOCKET_UNBIND
NX_TRACE_UDP_SOURCE_EXTRACT

 

NX_TRACE_UDP_SOCKET_BYTES_AVAILABLE

NX_TRACE_UDP_SOCKET_INTERFACE_SET
NX_TRACE_UDP_SOCKET_INTERFACE_CLEAR

 

/* I1 = ip ptr */
/* I1 = ip ptr, I2 = port, I3 = free port */
/* I1 = ip ptr, I2 = bytes sent, I3 = bytes received, I4 = invalid packets */
/* I1 = ip ptr, I2 = socket ptr, I3 = port, I4 = wait option */
/* I1 = ip ptr, I2 = socket ptr */
/* I1 = ip ptr, I2 = socket ptr */
/* I1 = ip ptr, I2 = socket ptr, I3 = type of service, I4 = queue maximum */
/* I1 = ip ptr, I2 = socket ptr */
/* I1 = ip ptr, I2 = socket ptr, I3 = bytes sent, I4 = bytes received */
/* I1 = ip ptr, I2 = socket ptr, I3 = port */
/* I1 = ip ptr, I2 = socket ptr, I3 = packet ptr, I4 = packet size */
/* I1 = ip ptr, I2 = socket ptr, I3 = receive notify */
/* I1 = socket ptr, I2 = packet ptr, I3 = packet size, I4 = ip address */
/* I1 = ip ptr, I2 = socket ptr, I3 = port */
/* I1 = packet ptr, I2 = ip address, I3 = port */

 

/* I1 = ip ptr, I2 = socket ptr, I3 = bytes available                       */

/* I1 = socket_ptr, I2 = interface_index, */
/* I1 = socket_ptr, */

 2.4 USBX

参考《Ch. 9 - USBX trace events》。

UX_TRACE_OBJECT_REGISTER注册USBX Duo的Object,UX_TRACE_OBJECT_UNREGISTER去注册Object。

UX_TRACE_IN_LINE_INSERT插入NetX Duo的Event到TraceX,UX_TRACE_EVENT_UPDATE匹配EventID和Timestamp后跟新Event额外信息。

Event Group Event ID Event Detail
UX_TRACE_ERRORS UX_TRACE_ERROR  
UX_TRACE_HOST_STACK_EVENTS

UX_TRACE_HOST_STACK_EVENTS_BASE
UX_TRACE_HOST_STACK_CLASS_INSTANCE_CREATE
UX_TRACE_HOST_STACK_CLASS_INSTANCE_DESTROY
UX_TRACE_HOST_STACK_CONFIGURATION_DELETE
UX_TRACE_HOST_STACK_CONFIGURATION_ENUMERATE
UX_TRACE_HOST_STACK_CONFIGURATION_INSTANCE_CREATE
UX_TRACE_HOST_STACK_CONFIGURATION_INSTANCE_DELETE
UX_TRACE_HOST_STACK_CONFIGURATION_SET
UX_TRACE_HOST_STACK_DEVICE_ADDRESS_SET
UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_GET
UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_SELECT
UX_TRACE_HOST_STACK_DEVICE_DESCRIPTOR_READ
UX_TRACE_HOST_STACK_DEVICE_GET
UX_TRACE_HOST_STACK_DEVICE_REMOVE
UX_TRACE_HOST_STACK_DEVICE_RESOURCE_FREE
UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_CREATE
UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_DELETE
UX_TRACE_HOST_STACK_ENDPOINT_RESET
UX_TRACE_HOST_STACK_ENDPOINT_TRANSFER_ABORT
UX_TRACE_HOST_STACK_HCD_REGISTER
UX_TRACE_HOST_STACK_INITIALIZE
UX_TRACE_HOST_STACK_INTERFACE_ENDPOINT_GET
UX_TRACE_HOST_STACK_INTERFACE_INSTANCE_CREATE
UX_TRACE_HOST_STACK_INTERFACE_INSTANCE_DELETE
UX_TRACE_HOST_STACK_INTERFACE_SET
UX_TRACE_HOST_STACK_INTERFACE_SETTING_SELECT
UX_TRACE_HOST_STACK_NEW_CONFIGURATION_CREATE
UX_TRACE_HOST_STACK_NEW_DEVICE_CREATE
UX_TRACE_HOST_STACK_NEW_ENDPOINT_CREATE
UX_TRACE_HOST_STACK_RH_CHANGE_PROCESS
UX_TRACE_HOST_STACK_RH_DEVICE_EXTRACTION
UX_TRACE_HOST_STACK_RH_DEVICE_INSERTION
UX_TRACE_HOST_STACK_TRANSFER_REQUEST
UX_TRACE_HOST_STACK_TRANSFER_REQUEST_ABORT
UX_TRACE_HOST_STACK_UNINITIALIZE
UX_TRACE_HOST_STACK_HCD_UNREGISTER
UX_TRACE_HOST_STACK_CLASS_REGISTER
UX_TRACE_HOST_STACK_CLASS_UNREGISTER
UX_TRACE_HOST_STACK_DEVICE_STRING_GET
UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_ACTIVATE
UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_DEACTIVATE

/* I1 = class , I2 = class instance */
/* I1 = class , I2 = class instance */
/* I1 = configuration */
/* I1 = device */
/* I1 = configuration */
/* I1 = configuration */
/* I1 = configuration */
/* I1 = device , I2 = device address */
/* I1 = device , I2 = configuration */
/* I1 = device , I2 = configuration */
/* I1 = device */
/* I1 = device index */
/* I1 = hcd , I2 = parent , I3 = port index , I4 = device */
/* I1 = device */
/* I1 = device , I2 = endpoint */
/* I1 = device , I2 = endpoint */
/* I1 = device , I2 = endpoint */
/* I1 = endpoint */
/* I1 = hcd name , I2 = parameter 1 , I3 = parameter 2 */
/* */
/* I1 = interface , I2 = endpoint index */
/* I1 = interface */
/* I1 = interface */
/* I1 = interface */
/* I1 = interface */
/* I1 = device , I2 = configuration */
/* I1 = hcd , I2 = device owner , I3 = port index , I4 = device */
/* I1 = interface , I2 = endpoint */
/* I1 = port index */
/* I1 = hcd , I2 = port index */
/* I1 = hcd , I2 = port index */
/* I1 = device , I2 = endpoint , I3 = transfer request */
/* I1 = device , I2 = endpoint , I3 = transfer request */
/* */
/* I1 = hcd name , I2 = parameter 1 , I3 = parameter 2 */
/* I1 = class name , I2 = entry function */
/* I1 = class entry */
/* I1 = device , I2 = buffer , I3 = length , I4 = (langID<<16) | index */
/* I1 = device , I2 = configuration */
/* I1 = device , I2 = configuration */

UX_TRACE_DEVICE_STACK_EVENTS

UX_TRACE_DEVICE_STACK_EVENTS_BASE
UX_TRACE_DEVICE_STACK_ALTERNATE_SETTING_GET
UX_TRACE_DEVICE_STACK_ALTERNATE_SETTING_SET
UX_TRACE_DEVICE_STACK_CLASS_REGISTER
UX_TRACE_DEVICE_STACK_CLEAR_FEATURE
UX_TRACE_DEVICE_STACK_CONFIGURATION_GET
UX_TRACE_DEVICE_STACK_CONFIGURATION_SET
UX_TRACE_DEVICE_STACK_CONNECT
UX_TRACE_DEVICE_STACK_DESCRIPTOR_SEND
UX_TRACE_DEVICE_STACK_DISCONNECT
UX_TRACE_DEVICE_STACK_ENDPOINT_STALL
UX_TRACE_DEVICE_STACK_GET_STATUS
UX_TRACE_DEVICE_STACK_HOST_WAKEUP
UX_TRACE_DEVICE_STACK_INITIALIZE
UX_TRACE_DEVICE_STACK_INTERFACE_DELETE
UX_TRACE_DEVICE_STACK_INTERFACE_GET
UX_TRACE_DEVICE_STACK_INTERFACE_SET
UX_TRACE_DEVICE_STACK_SET_FEATURE
UX_TRACE_DEVICE_STACK_TRANSFER_ABORT
UX_TRACE_DEVICE_STACK_TRANSFER_ALL_REQUEST_ABORT
UX_TRACE_DEVICE_STACK_TRANSFER_REQUEST
UX_TRACE_DEVICE_STACK_MICROSOFT_EXTENSION_REGISTER
UX_TRACE_DEVICE_STACK_CLASS_UNREGISTER

/* I1 = interface value */
/* I1 = interface value , I2 = alternate setting value */
/* I1 = class name , I2 = interface number, I3 = parameter */
/* I1 = request type , I2 = request value , I3 = request index */
/* I1 = configuration value */
/* I1 = configuration value */
/* */
/* I1 = descriptor type , I2 = request index */
/* I1 = device */
/* I1 = endpoint */
/* I1 = request type , I2 = request value , I3 = request index */
/* */
/* */
/* I1 = interface */
/* I1 = interface value */
/* I1 = alternate setting value */
/* I1 = request value , I2 = request index */
/* I1 = transfer request, I2 = completion code */
/* I1 = endpoint , I2 = completion code */
/* I1 = transfer request */
/* I1 = transfer request */
/* I1 = class name */

UX_TRACE_HOST_CONTROLLER_EVENTS    
UX_TRACE_DEVICE_CONTROLLER_EVENTS    
UX_TRACE_HOST_CLASS_EVENTS

UX_TRACE_HOST_CLASS_EVENTS_BASE
UX_TRACE_HOST_CLASS_ASIX_ACTIVATE
UX_TRACE_HOST_CLASS_ASIX_DEACTIVATE
UX_TRACE_HOST_CLASS_ASIX_INTERRUPT_NOTIFICATION
UX_TRACE_HOST_CLASS_ASIX_READ
UX_TRACE_HOST_CLASS_ASIX_WRITE

UX_TRACE_HOST_CLASS_AUDIO_ACTIVATE
UX_TRACE_HOST_CLASS_AUDIO_CONTROL_VALUE_GET
UX_TRACE_HOST_CLASS_AUDIO_CONTROL_VALUE_SET
UX_TRACE_HOST_CLASS_AUDIO_DEACTIVATE
UX_TRACE_HOST_CLASS_AUDIO_READ
UX_TRACE_HOST_CLASS_AUDIO_STREAMING_SAMPLING_GET
UX_TRACE_HOST_CLASS_AUDIO_STREAMING_SAMPLING_SET
UX_TRACE_HOST_CLASS_AUDIO_WRITE

UX_TRACE_HOST_CLASS_CDC_ACM_ACTIVATE
UX_TRACE_HOST_CLASS_CDC_ACM_DEACTIVATE
UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_SET_LINE_CODING
UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_GET_LINE_CODING
UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_SET_LINE_STATE
UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_SEND_BREAK
UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_ABORT_IN_PIPE
UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_ABORT_OUT_PIPE
UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_NOTIFICATION_CALLBACK
UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_GET_DEVICE_STATUS
UX_TRACE_HOST_CLASS_CDC_ACM_READ
UX_TRACE_HOST_CLASS_CDC_ACM_RECEPTION_START
UX_TRACE_HOST_CLASS_CDC_ACM_RECEPTION_STOP
UX_TRACE_HOST_CLASS_CDC_ACM_WRITE

UX_TRACE_HOST_CLASS_CDC_ECM_ACTIVATE
UX_TRACE_HOST_CLASS_CDC_ECM_DEACTIVATE
UX_TRACE_HOST_CLASS_CDC_ECM_READ
UX_TRACE_HOST_CLASS_CDC_ECM_WRITE
UX_TRACE_HOST_CLASS_CDC_ECM_INTERRUPT_NOTIFICATION

UX_TRACE_HOST_CLASS_HID_ACTIVATE
UX_TRACE_HOST_CLASS_HID_CLIENT_REGISTER
UX_TRACE_HOST_CLASS_HID_DEACTIVATE
UX_TRACE_HOST_CLASS_HID_IDLE_GET
UX_TRACE_HOST_CLASS_HID_IDLE_SET
UX_TRACE_HOST_CLASS_HID_KEYBOARD_ACTIVATE
UX_TRACE_HOST_CLASS_HID_KEYBOARD_DEACTIVATE
UX_TRACE_HOST_CLASS_HID_MOUSE_ACTIVATE
UX_TRACE_HOST_CLASS_HID_MOUSE_DEACTIVATE
UX_TRACE_HOST_CLASS_HID_REMOTE_CONTROL_ACTIVATE
UX_TRACE_HOST_CLASS_HID_REMOTE_CONTROL_DEACTIVATE
UX_TRACE_HOST_CLASS_HID_REPORT_GET
UX_TRACE_HOST_CLASS_HID_REPORT_SET
UX_TRACE_HOST_CLASS_HID_REMOTE_CONTROL_CALLBACK

UX_TRACE_HOST_CLASS_HUB_ACTIVATE
UX_TRACE_HOST_CLASS_HUB_CHANGE_DETECT
UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_CONNECTION_PROCESS
UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_ENABLE_PROCESS
UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_OVER_CURRENT_PROCESS
UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_RESET_PROCESS
UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_SUSPEND_PROCESS
UX_TRACE_HOST_CLASS_HUB_DEACTIVATE

UX_TRACE_HOST_CLASS_PIMA_ACTIVATE
UX_TRACE_HOST_CLASS_PIMA_DEACTIVATE
UX_TRACE_HOST_CLASS_PIMA_DEVICE_INFO_GET
UX_TRACE_HOST_CLASS_PIMA_DEVICE_RESET
UX_TRACE_HOST_CLASS_PIMA_NOTIFICATION
UX_TRACE_HOST_CLASS_PIMA_NUM_OBJECTS_GET
UX_TRACE_HOST_CLASS_PIMA_OBJECT_CLOSE
UX_TRACE_HOST_CLASS_PIMA_OBJECT_COPY
UX_TRACE_HOST_CLASS_PIMA_OBJECT_DELETE
UX_TRACE_HOST_CLASS_PIMA_OBJECT_GET
UX_TRACE_HOST_CLASS_PIMA_OBJECT_INFO_GET
UX_TRACE_HOST_CLASS_PIMA_OBJECT_INFO_SEND
UX_TRACE_HOST_CLASS_PIMA_OBJECT_MOVE
UX_TRACE_HOST_CLASS_PIMA_OBJECT_SEND
UX_TRACE_HOST_CLASS_PIMA_OBJECT_TRANSFER_ABORT
UX_TRACE_HOST_CLASS_PIMA_READ
UX_TRACE_HOST_CLASS_PIMA_REQUEST_CANCEL
UX_TRACE_HOST_CLASS_PIMA_SESSION_CLOSE
UX_TRACE_HOST_CLASS_PIMA_SESSION_OPEN
UX_TRACE_HOST_CLASS_PIMA_STORAGE_IDS_GET
UX_TRACE_HOST_CLASS_PIMA_STORAGE_INFO_GET
UX_TRACE_HOST_CLASS_PIMA_THUMB_GET
UX_TRACE_HOST_CLASS_PIMA_WRITE

UX_TRACE_HOST_CLASS_PRINTER_ACTIVATE
UX_TRACE_HOST_CLASS_PRINTER_DEACTIVATE
UX_TRACE_HOST_CLASS_PRINTER_NAME_GET
UX_TRACE_HOST_CLASS_PRINTER_READ
UX_TRACE_HOST_CLASS_PRINTER_WRITE
UX_TRACE_HOST_CLASS_PRINTER_SOFT_RESET
UX_TRACE_HOST_CLASS_PRINTER_STATUS_GET
UX_TRACE_HOST_CLASS_PRINTER_DEVICE_ID_GET

UX_TRACE_HOST_CLASS_PROLIFIC_ACTIVATE
UX_TRACE_HOST_CLASS_PROLIFIC_DEACTIVATE
UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_SET_LINE_CODING
UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_GET_LINE_CODING
UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_SET_LINE_STATE
UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_PURGE
UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_SEND_BREAK
UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_ABORT_IN_PIPE
UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_ABORT_OUT_PIPE
UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_REPORT_DEVICE_STATUS_CHAN
UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_GET_DEVICE_STATUS
UX_TRACE_HOST_CLASS_PROLIFIC_READ
UX_TRACE_HOST_CLASS_PROLIFIC_RECEPTION_START
UX_TRACE_HOST_CLASS_PROLIFIC_RECEPTION_STOP
UX_TRACE_HOST_CLASS_PROLIFIC_WRITE

UX_TRACE_HOST_CLASS_STORAGE_ACTIVATE
UX_TRACE_HOST_CLASS_STORAGE_DEACTIVATE
UX_TRACE_HOST_CLASS_STORAGE_MEDIA_CAPACITY_GET
UX_TRACE_HOST_CLASS_STORAGE_MEDIA_FORMAT_CAPACITY_GET
UX_TRACE_HOST_CLASS_STORAGE_MEDIA_MOUNT
UX_TRACE_HOST_CLASS_STORAGE_MEDIA_OPEN
UX_TRACE_HOST_CLASS_STORAGE_MEDIA_READ
UX_TRACE_HOST_CLASS_STORAGE_MEDIA_WRITE
UX_TRACE_HOST_CLASS_STORAGE_REQUEST_SENSE
UX_TRACE_HOST_CLASS_STORAGE_START_STOP
UX_TRACE_HOST_CLASS_STORAGE_UNIT_READY_TEST

UX_TRACE_HOST_CLASS_DPUMP_ACTIVATE
UX_TRACE_HOST_CLASS_DPUMP_DEACTIVATE
UX_TRACE_HOST_CLASS_DPUMP_READ
UX_TRACE_HOST_CLASS_DPUMP_WRITE

UX_TRACE_HOST_CLASS_SWAR_ACTIVATE
UX_TRACE_HOST_CLASS_SWAR_DEACTIVATE
UX_TRACE_HOST_CLASS_SWAR_IOCTL_ABORT_IN_PIPE
UX_TRACE_HOST_CLASS_SWAR_IOCTL_ABORT_OUT_PIPE
UX_TRACE_HOST_CLASS_SWAR_READ
UX_TRACE_HOST_CLASS_SWAR_RECEPTION_START
UX_TRACE_HOST_CLASS_SWAR_RECEPTION_STOP
UX_TRACE_HOST_CLASS_SWAR_WRITE

UX_TRACE_HOST_CLASS_GSER_ACTIVATE
UX_TRACE_HOST_CLASS_GSER_DEACTIVATE
UX_TRACE_HOST_CLASS_GSER_IOCTL_SET_LINE_CODING
UX_TRACE_HOST_CLASS_GSER_IOCTL_GET_LINE_CODING
UX_TRACE_HOST_CLASS_GSER_IOCTL_SET_LINE_STATE
UX_TRACE_HOST_CLASS_GSER_IOCTL_PURGE
UX_TRACE_HOST_CLASS_GSER_IOCTL_SEND_BREAK
UX_TRACE_HOST_CLASS_GSER_IOCTL_ABORT_IN_PIPE
UX_TRACE_HOST_CLASS_GSER_IOCTL_ABORT_OUT_PIPE
UX_TRACE_HOST_CLASS_GSER_IOCTL_REPORT_DEVICE_STATUS_CHANGE
UX_TRACE_HOST_CLASS_GSER_IOCTL_GET_DEVICE_STATUS
UX_TRACE_HOST_CLASS_GSER_IOCTL_NOTIFICATION_CALLBACK
UX_TRACE_HOST_CLASS_GSER_READ
UX_TRACE_HOST_CLASS_GSER_RECEPTION_START
UX_TRACE_HOST_CLASS_GSER_RECEPTION_STOP
UX_TRACE_HOST_CLASS_GSER_WRITE

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance , I2 = data pointer , I3 = requested length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = audio control */
/* I1 = class instance */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance */
/* I1 = class instance , I2 = audio sampling */
/* I1 = class instance , I2 = data pointer , I3 = requested length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = endpoint */
/* I1 = class instance , I2 = endpointr */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = device status */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = data pointer , I3 = requested length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance */

/* I1 = class instance */
/* I1 = hid client name */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = hid client instance */
/* I1 = class instance , I2 = hid client instance */
/* I1 = class instance , I2 = hid client instance */
/* I1 = class instance , I2 = hid client instance */
/* I1 = class instance , I2 = hid client instance */
/* I1 = class instance , I2 = hid client instance */
/* I1 = class instance , I2 = client report */
/* I1 = class instance , I2 = client report */
/* I1 = client instance , I2 = remote control instance */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = port , I3 = port status */
/* I1 = class instance , I2 = port , I3 = port status */
/* I1 = class instance , I2 = port , I3 = port status */
/* I1 = class instance , I2 = port , I3 = port status */
/* I1 = class instance , I2 = port , I3 = port status */
/* I1 = class instance */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = pima device */
/* I1 = class instance */
/* I1 = class instance , I2 = event code , I3 = transaction ID , I4 = parameter1 */
/* I1 = class instance */
/* I1 = class instance , I2 = object */
/* I1 = class instance , I2 = object handle */
/* I1 = class instance , I2 = object handle */
/* I1 = class instance , I2 = object handle , I3 = object */
/* I1 = class instance , I2 = object handle , I3 = object */
/* I1 = class instance , I2 = object */
/* I1 = class instance , I2 = object handle */
/* I1 = class instance , I2 = object , I3 = object_buffer , I4 = object length */
/* I1 = class instance , I2 = object handle , I3 = object */
/* I1 = class instance , I2 = data pointer , I3 = data length */
/* I1 = class instance */
/* I1 = class instance , I2 = pima session */
/* I1 = class instance , I2 = pima session */
/* I1 = class instance , I2 = storage ID array, I3 = storage ID length */
/* I1 = class instance , I2 = storage ID , I3 = storage */
/* I1 = class instance , I2 = object handle */
/* I1 = class instance , I2 = data pointer , I3 = data length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance */
/* I1 = class instance , I2 = printer status */
/* I1 = class instance , I2 = printer , I3 = data pointer , I4 = buffer length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance */
/* I1 = class instance , I2 = endpoint */
/* I1 = class instance , I2 = endpointr */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = device status */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = data pointer , I3 = requested length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = sector */
/* I1 = class instance , I2 = media */
/* I1 = class instance , I2 = sector start , I3 = sector count , I4 = data pointer */
/* I1 = class instance , I2 = sector start , I3 = sector count , I4 = data pointer */
/* I1 = class instance */
/* I1 = class instance , I2 = start stop signal */
/* I1 = class instance */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance , I2 = data pointer , I3 = requested length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = endpoint */
/* I1 = class instance , I2 = endpointr */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = data pointer , I3 = requested length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance */
/* I1 = class instance , I2 = endpoint */
/* I1 = class instance , I2 = endpointr */
/* I1 = class instance , I2 = parameter */
/* I1 = class instance , I2 = device status */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance , I2 = data pointer , I3 = requested length */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = data pointer , I3 = requested length */

UX_TRACE_DEVICE_CLASS_EVENTS

UX_TRACE_DEVICE_CLASS_EVENTS_BASE
UX_TRACE_DEVICE_CLASS_DPUMP_ACTIVATE
UX_TRACE_DEVICE_CLASS_DPUMP_DEACTIVATE
UX_TRACE_DEVICE_CLASS_DPUMP_READ
UX_TRACE_DEVICE_CLASS_DPUMP_WRITE
UX_TRACE_DEVICE_CLASS_DPUMP_CHANGE

UX_TRACE_DEVICE_CLASS_CDC_ACM_ACTIVATE
UX_TRACE_DEVICE_CLASS_CDC_ACM_DEACTIVATE
UX_TRACE_DEVICE_CLASS_CDC_ACM_READ
UX_TRACE_DEVICE_CLASS_CDC_ACM_WRITE

UX_TRACE_DEVICE_CLASS_HID_ACTIVATE
UX_TRACE_DEVICE_CLASS_HID_DEACTIVATE
UX_TRACE_DEVICE_CLASS_HID_EVENT_GET
UX_TRACE_DEVICE_CLASS_HID_EVENT_SET
UX_TRACE_DEVICE_CLASS_HID_REPORT_GET
UX_TRACE_DEVICE_CLASS_HID_REPORT_SET
UX_TRACE_DEVICE_CLASS_HID_DESCRIPTOR_SEND
UX_TRACE_DEVICE_CLASS_HID_READ
UX_TRACE_DEVICE_CLASS_HID_RECEIVER_EVENT_GET
UX_TRACE_DEVICE_CLASS_HID_RECEIVER_EVENT_FREE

UX_TRACE_DEVICE_CLASS_PIMA_ACTIVATE
UX_TRACE_DEVICE_CLASS_PIMA_DEACTIVATE
UX_TRACE_DEVICE_CLASS_PIMA_DEVICE_INFO_SEND
UX_TRACE_DEVICE_CLASS_PIMA_EVENT_GET
UX_TRACE_DEVICE_CLASS_PIMA_EVENT_SET
UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_ADD
UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_DATA_GET
UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_DATA_SEND
UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_DELETE
UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_HANDLES_SEND
UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_INFO_GET
UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_INFO_SEND
UX_TRACE_DEVICE_CLASS_PIMA_OBJECTS_NUMBER_SEND
UX_TRACE_DEVICE_CLASS_PIMA_PARTIAL_OBJECT_DATA_GET
UX_TRACE_DEVICE_CLASS_PIMA_RESPONSE_SEND
UX_TRACE_DEVICE_CLASS_PIMA_STORAGE_ID_SEND
UX_TRACE_DEVICE_CLASS_PIMA_STORAGE_INFO_SEND
UX_TRACE_DEVICE_CLASS_PIMA_GET_DEVICE_PROP_DESC_GET
UX_TRACE_DEVICE_CLASS_PIMA_GET_DEVICE_PROP_VALUE
UX_TRACE_DEVICE_CLASS_PIMA_GET_DEVICE_PROP_VALUE_SET
UX_TRACE_DEVICE_CLASS_PIMA_GET_OBJECT_PROP_DESC
UX_TRACE_DEVICE_CLASS_PIMA_GET_OBJECT_PROP_VALUE
UX_TRACE_DEVICE_CLASS_PIMA_OBJECTS_PROPS_SUPPORTED_GET
UX_TRACE_DEVICE_CLASS_PIMA_GET_OBJECT_REFERENCES
UX_TRACE_DEVICE_CLASS_PIMA_OBJECTS_PROPS_SUPPORTED_SET
UX_TRACE_DEVICE_CLASS_PIMA_SET_OBJECT_REFERENCES
UX_TRACE_DEVICE_CLASS_PIMA_STORAGE_FORMAT
UX_TRACE_DEVICE_CLASS_PIMA_DEVICE_RESET
UX_TRACE_DEVICE_CLASS_PIMA_SET_OBJECT_PROP_VALUE

UX_TRACE_DEVICE_CLASS_RNDIS_ACTIVATE
UX_TRACE_DEVICE_CLASS_RNDIS_DEACTIVATE
UX_TRACE_DEVICE_CLASS_RNDIS_PACKET_RECEIVE
UX_TRACE_DEVICE_CLASS_RNDIS_PACKET_TRANSMIT
UX_TRACE_DEVICE_CLASS_RNDIS_MSG_QUERY
UX_TRACE_DEVICE_CLASS_RNDIS_MSG_KEEP_ALIVE
UX_TRACE_DEVICE_CLASS_RNDIS_MSG_RESET
UX_TRACE_DEVICE_CLASS_RNDIS_MSG_SET

UX_TRACE_DEVICE_CLASS_STORAGE_ACTIVATE
UX_TRACE_DEVICE_CLASS_STORAGE_DEACTIVATE
UX_TRACE_DEVICE_CLASS_STORAGE_FORMAT
UX_TRACE_DEVICE_CLASS_STORAGE_INQUIRY
UX_TRACE_DEVICE_CLASS_STORAGE_MODE_SELECT
UX_TRACE_DEVICE_CLASS_STORAGE_MODE_SENSE
UX_TRACE_DEVICE_CLASS_STORAGE_PREVENT_ALLOW_MEDIA_REMOVAL
UX_TRACE_DEVICE_CLASS_STORAGE_READ
UX_TRACE_DEVICE_CLASS_STORAGE_READ_CAPACITY
UX_TRACE_DEVICE_CLASS_STORAGE_READ_FORMAT_CAPACITY
UX_TRACE_DEVICE_CLASS_STORAGE_READ_TOC
UX_TRACE_DEVICE_CLASS_STORAGE_REQUEST_SENSE
UX_TRACE_DEVICE_CLASS_STORAGE_TEST_READY
UX_TRACE_DEVICE_CLASS_STORAGE_START_STOP
UX_TRACE_DEVICE_CLASS_STORAGE_VERIFY
UX_TRACE_DEVICE_CLASS_STORAGE_WRITE
UX_TRACE_DEVICE_CLASS_STORAGE_GET_CONFIGURATION
UX_TRACE_DEVICE_CLASS_STORAGE_SYNCHRONIZE_CACHE
UX_TRACE_DEVICE_CLASS_STORAGE_OTHER

UX_TRACE_DEVICE_CLASS_CDC_ECM_ACTIVATE
UX_TRACE_DEVICE_CLASS_CDC_ECM_DEACTIVATE
UX_TRACE_DEVICE_CLASS_CDC_ECM_CHANGE
UX_TRACE_DEVICE_CLASS_CDC_ECM_READ
UX_TRACE_DEVICE_CLASS_CDC_ECM_WRITE
UX_TRACE_DEVICE_CLASS_CDC_ECM_PACKET_TRANSMIT
UX_TRACE_DEVICE_CLASS_CDC_ECM_PACKET_RECEIVE

UX_TRACE_DEVICE_CLASS_DFU_ACTIVATE
UX_TRACE_DEVICE_CLASS_DFU_DEACTIVATE

UX_TRACE_DEVICE_CLASS_PRINTER_ACTIVATE
UX_TRACE_DEVICE_CLASS_PRINTER_DEACTIVATE
UX_TRACE_DEVICE_CLASS_PRINTER_READ
UX_TRACE_DEVICE_CLASS_PRINTER_WRITE

UX_TRACE_DEVICE_CLASS_CCID_ACTIVATE
UX_TRACE_DEVICE_CLASS_CCID_DEACTIVATE
UX_TRACE_DEVICE_CLASS_CCID_REQ_ABORT
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_ICC_POWER_ON
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_ICC_POWER_OFF
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_GET_SLOT_STATUS
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_XFR_BLOCK
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_GET_PARAMETERS
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_RESET_PARAMETERS
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_SET_PARAMETERS
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_ESCAPE
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_ICC_CLOCK
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_T0_APDU
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_SECURE
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_MECHANICAL
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_ABORT
UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_SET_RATE_CLOCK
UX_TRACE_DEVICE_CLASS_CCID_RDR_TO_PC_RESPONSE
UX_TRACE_DEVICE_CLASS_CCID_ICC_INSERT
UX_TRACE_DEVICE_CLASS_CCID_ICC_REMOVE
UX_TRACE_DEVICE_CLASS_CCID_AUTO_SEQ_START
UX_TRACE_DEVICE_CLASS_CCID_AUTO_SEQ_STOP
UX_TRACE_DEVICE_CLASS_CCID_TIME_EXTENSION
UX_TRACE_DEVICE_CLASS_CCID_HARDWARE_ERROR

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = buffer , I3 = requested_length */
/* I1 = class instance , I2 = buffer , I3 = requested_length */
/* I1 = class instance , I2 = buffer , I3 = requested_length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = buffer , I3 = requested_length */
/* I1 = class instance , I2 = buffer , I3 = requested_length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = hid event */
/* I1 = class instance , I2 = hid event */
/* I1 = class instance , I2 = descriptor type , I3 = request index */
/* I1 = class instance , I2 = descriptor type , I3 = request index */
/* I1 = class instance , I2 = descriptor type , I3 = request index */
/* I1 = class instance , I2 = buffer , I3 = requested_length */
/* I1 = class instance , I2 = receiver event , I3 = wait_option */
/* I1 = class instance , I2 = receiver event */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = pima event */
/* I1 = class instance , I2 = pima event */
/* I1 = class instance , I2 = object handle */
/* I1 = class instance , I2 = object handle */
/* I1 = class instance , I2 = object handle */
/* I1 = class instance , I2 = object handle */
/* I1 = class instance , I2 = storage id , I3 = object format code, I4 = object association */
/* I1 = class instance , I2 = object handle */
/* I1 = class instance */
/* I1 = class instance , I2 = storage id , I3 = object format code, I4 = object association */
/* I1 = class instance , I2 = object handle , I3 = offset requested , I4 = length requested */
/* I1 = class instance , I2 = response code , I3 = number parameter , I4 = pima parameter 1 */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = rndis OID */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = rndis OID */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun , I3 = sector , I4 = number sectors */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun , I3 = sense key , I4 = code */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun , I3 = sector , I4 = number sectors */
/* I1 = class instance , I2 = lun */
/* I1 = class instance , I2 = lun , I3 = sector , I4 = number sectors */
/* I1 = class instance , I2 = lun */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = buffer , I3 = requested_length */
/* I1 = class instance , I2 = buffer , I3 = requested_length */
/* I1 = class instance , I2 = buffer , I3 = requested_length */
/* I1 = class instance , I2 = buffer , I3 = requested_length */

/* I1 = class instance */
/* I1 = class instance */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = buffer , I3 = requested_length */
/* I1 = class instance , I2 = buffer , I3 = requested_length */

/* I1 = class instance */
/* I1 = class instance */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot */
/* I1 = class instance , I2 = slot , I3 = time */
/* I1 = class instance , I2 = slot */

2.5 自定义事件

参考《Ch. 10 - Customer user events》。

tx_trace_user_event_insert插入用户自定义事件:

UINT tx_trace_user_event_insert (ULONG event_id, 
   ULONG info_field_1, ULONG info_field_2,
   ULONG info_field_3, ULONG info_field_4);

 可以参考《Defining Custom User-Defined Event Icons》,定义用户事件的显示。

3 TraceX抓取和解析

3.1 TraceX

详细解读参考:

3.2 Tracealyzer

Getting Started with Tracealyzer - Percepio

4 使用Visual Studio 2019环境生成TraceX

4.1 使能TraceX

#ifdef TX_ENABLE_EVENT_TRACE
UCHAR   event_buffer[65536];
#endif

/* Define what the initial system looks like.  */

void    tx_application_define(void *first_unused_memory)
{

  CHAR    *pointer = TX_NULL;

  #ifdef TX_ENABLE_EVENT_TRACE
  tx_trace_enable(event_buffer, sizeof(event_buffer), 32);
  #endif
  ...
}

4.2 Visual Studio 2019转储、WinDbg导出TraceX、TraceX分析

在Visual Studio 2019中,点击“本地Windows调试器”,进入调试模式:

暂停调试,然后“调试”->"将转储另存为...",保存到本地文件。

在Microsoft Store中安装WinDbg,打开转储文件。

在Disassembly中找到event_buffer地址,在Command输入".writemem D:\event_buffer.trx 0x010a9100 0x010b90ff",导出event_buffer到event_buffer.trx文件中。 

使用TraceX打开,event_buffer.trx文件:

posted on 2024-10-26 23:59  ArnoldLu  阅读(40)  评论(2编辑  收藏  举报

导航