Skip to content

Conversation

@alexbatashev
Copy link
Contributor

@alexbatashev alexbatashev commented Mar 12, 2022

Add support for tracing Level Zero API calls to Level Zero plugin. Also modify sycl-trace tool to be able to display both PI and L0 calls simultaneously.

TBD tests link

Example PI-only trace:

[PI] piMemBufferCreate(
    context: 0x1511b60
    flags: 1
    size: 16
    host_ptr: 0
    ret_mem: 0x7ffceb731460
    properties: 0
) ---> PI_SUCCESS
[PI] piextMemGetNativeHandle(
    mem: 0x16c1130
    nativeHandle: 0x7ffceb731268
) ---> PI_SUCCESS
[PI] piDeviceGetInfo(
    device: 0xda40f0
    param_name: 65576
    param_value_size: 4
    param_value: 0x7ffceb730e24
    param_value_size_ret: 0
) ---> PI_SUCCESS
[PI] piextDeviceSelectBinary(
    device: 0xda40f0
    binaries: 0x16c02c0
    num_binaries: 1
    selected_binary_ind: 0x7ffceb730d14
) ---> PI_INVALID_BINARY

Example of verbose output:

[PI:TID 140400402187264:<unknown>:0]
piEnqueueMemBufferMap(
    command_queue: 0x13aae70
    buffer: 0x160da50
    blocking_map: 0
    map_flags: 1
    offset: 0
    size: 16
    num_events_in_wait_list: 1
    event_wait_list: 0x20b08c0
    event: 0x1eb7758
    ret_map: 0x7ffeba138a70
) {
*  [L0:TID 140400402187264:<unknown>:0]
*  zeEventQueryStatus(
*     phEvent: 0x7ffeba1385f8
*  ) ---> ZE_RESULT_NOT_READY (synchronization primitive not signaled)
*  
*  [L0:TID 140400402187264:<unknown>:0]
*  zeEventCreate(
*     phEventPool: 0x7ffeba1385a8
*     pdesc: 0x7ffeba1385a0
*     pphEvent: 0x7ffeba138598
*  ) ---> ZE_RESULT_SUCCESS (success)
*  
*  [L0:TID 140400402187264:<unknown>:0]
*  zeEventHostSynchronize(
*     phEvent: 0x7ffeba1385e8
*     ptimeout: 0x7ffeba1385e0
*  ) ---> ZE_RESULT_SUCCESS (success)
*  
*  [L0:TID 140400402187264:<unknown>:0]
*  zeFenceQueryStatus(
*     phFence: 0x7ffeba138578
*  ) ---> ZE_RESULT_SUCCESS (success)
*  
*  [L0:TID 140400402187264:<unknown>:0]
*  zeFenceReset(
*     phFence: 0x7ffeba138528
*  ) ---> ZE_RESULT_SUCCESS (success)
*  
*  [L0:TID 140400402187264:<unknown>:0]
*  zeCommandListReset(
*     phCommandList: 0x7ffeba138528
*  ) ---> ZE_RESULT_SUCCESS (success)
*  
*  [L0:TID 140400402187264:<unknown>:0]
*  zeEventHostSignal(
*     phEvent: 0x7ffeba138648
*  ) ---> ZE_RESULT_SUCCESS (success)
*  
} ---> PI_SUCCESS

[PI:TID 140400402187264:<unknown>:0]
piEventsWait(
    num_events: 1
    event_list: 0x1d7ef90
) {
*  [L0:TID 140400402187264:<unknown>:0]
*  zeEventHostSynchronize(
*     phEvent: 0x7ffeba138928
*     ptimeout: 0x7ffeba138920
*  ) ---> ZE_RESULT_SUCCESS (success)
*  
} ---> PI_SUCCESS

@alexbatashev
Copy link
Contributor Author

alexbatashev commented Mar 12, 2022

Example SYCL performance trace
Screenshot from 2022-03-12 18-56-29
simple.txt (replace txt with json)

@alexbatashev alexbatashev changed the title [WIP][SYCL][L0] Add XPTI-based Level Zero tracing [SYCL][L0] Add XPTI-based Level Zero tracing Mar 31, 2022
@alexbatashev alexbatashev marked this pull request as ready for review March 31, 2022 15:04
@alexbatashev alexbatashev requested review from a team as code owners March 31, 2022 15:04
@smaslov-intel
Copy link
Contributor

Continuing in #6023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants