Skip to content

libwrap: Add WSL libwrap to trace blob on Windows

Danylo Piliaiev requested to merge Danil/freedreno:libwrap-on-wsl into master

Compared to kgsl libwrap:

  • Hooks to libdxcore.so calls instead of IOCTLs because libdxcore calls are nicer to deal with
  • DOESN'T support faking GPU.

To build:

  • BUILD=glibc make libwrap-wsl.so for WSL libwrap
  • BUILD=glibc make libwrap.so for KGSL libwrap
WSL libwrap log example (click me)
< D3DKMTCreateAllocation2 => 0
                allocation[0]:          0x400020c0
                allocated_size[0]:      0x00008000
> D3DKMTMapGpuVirtualAddress
                allocation:             0x400020c0
                base_address:           0x00000000
                size_in_pages:          0x00000008
< D3DKMTMapGpuVirtualAddress => 259
                virtual_address:        0x39a0000
> D3DKMTLock2
                allocation:             0x400020c0
< D3DKMTLock2 => 0
                host_address:           0xff3c79ca8000
> D3DKMTMakeResident
< D3DKMTMakeResident => 259
> D3DKMTCreateAllocation2
                resource:               0x00000000
                flags:                  0x00000000
                alloc_count:            1
                size[0]:                0x00010000
                aligment[0]:            0x1000
< D3DKMTCreateAllocation2 => 0
                allocation[0]:          0x40002100
                allocated_size[0]:      0x00010000
> D3DKMTMapGpuVirtualAddress
                allocation:             0x40002100
                base_address:           0x00000000
                size_in_pages:          0x00000010
< D3DKMTMapGpuVirtualAddress => 259
                virtual_address:        0x39a8000
> D3DKMTMakeResident
< D3DKMTMakeResident => 259
> D3DKMTCreateAllocation2
                resource:               0x00000000
                flags:                  0x00000000
                alloc_count:            1
                size[0]:                0x00010000
                aligment[0]:            0x1000
< D3DKMTCreateAllocation2 => 0
                allocation[0]:          0x40002140
                allocated_size[0]:      0x00010000
> D3DKMTMapGpuVirtualAddress
                allocation:             0x40002140
                base_address:           0x00000000
                size_in_pages:          0x00000010
< D3DKMTMapGpuVirtualAddress => 259
                virtual_address:        0x39b8000
> D3DKMTMakeResident
< D3DKMTMakeResident => 259
> D3DKMTCreateAllocation2
                resource:               0x00000000
                flags:                  0x00000000
                alloc_count:            1
                size[0]:                0x00010000
                aligment[0]:            0x1000
< D3DKMTCreateAllocation2 => 0
                allocation[0]:          0x40002180
                allocated_size[0]:      0x00010000
> D3DKMTMapGpuVirtualAddress
                allocation:             0x40002180
                base_address:           0x00000000
                size_in_pages:          0x00000010
< D3DKMTMapGpuVirtualAddress => 259
                virtual_address:        0x39c8000
> D3DKMTMakeResident
< D3DKMTMakeResident => 259
> D3DKMTCreateAllocation2
                resource:               0x00000000
                flags:                  0x00000000
                alloc_count:            1
                size[0]:                0x00010000
                aligment[0]:            0x1000
< D3DKMTCreateAllocation2 => 0
                allocation[0]:          0x400021c0
                allocated_size[0]:      0x00010000
> D3DKMTMapGpuVirtualAddress
                allocation:             0x400021c0
                base_address:           0x00000000
                size_in_pages:          0x00000010
< D3DKMTMapGpuVirtualAddress => 259
                virtual_address:        0x39d8000
> D3DKMTMakeResident
< D3DKMTMakeResident => 259
> D3DKMTLock2
                allocation:             0x40002100
< D3DKMTLock2 => 0
                host_address:           0xff3c6ac50000
> D3DKMTLock2
                allocation:             0x40002140
< D3DKMTLock2 => 0
                host_address:           0xff3c6ac40000
> D3DKMTLock2
                allocation:             0x40002180
< D3DKMTLock2 => 0
                host_address:           0xff3c6ac30000
> D3DKMTLock2
                allocation:             0x400021c0
< D3DKMTLock2 => 0
                host_address:           0xff3c6ac20000
> D3DKMTCreateAllocation2
                resource:               0x00000000
                flags:                  0x00000000
                alloc_count:            1
                size[0]:                0x00010000
                aligment[0]:            0x1000
< D3DKMTCreateAllocation2 => 0
                allocation[0]:          0x40002200
                allocated_size[0]:      0x00010000
> D3DKMTMapGpuVirtualAddress
                allocation:             0x40002200
                base_address:           0x00000000
                size_in_pages:          0x00000010
< D3DKMTMapGpuVirtualAddress => 259
                virtual_address:        0x39e8000
> D3DKMTLock2
                allocation:             0x40002200
< D3DKMTLock2 => 0
                host_address:           0xff3c6ac10000
> D3DKMTMakeResident
< D3DKMTMakeResident => 259
> D3DKMTCreateAllocation2
                resource:               0x00000000
                flags:                  0x00000000
                alloc_count:            1
                size[0]:                0x00008000
                aligment[0]:            0x1000
< D3DKMTCreateAllocation2 => 0
                allocation[0]:          0x40002240
                allocated_size[0]:      0x00008000
> D3DKMTMapGpuVirtualAddress
                allocation:             0x40002240
                base_address:           0x00000000
                size_in_pages:          0x00000008
< D3DKMTMapGpuVirtualAddress => 259
                virtual_address:        0x39f8000
> D3DKMTLock2
                allocation:             0x40002240
< D3DKMTLock2 => 0
                host_address:           0xff3c79c28000
> D3DKMTMakeResident
< D3DKMTMakeResident => 259
> D3DKMTSubmitCommand
                device:                 0x40000000
                command_buffer:         0x37740bc
                command_length:         300
                priv_drv_data_size:     172
                        00000000  ee bb aa cc  00 00 00 00  ac 00 00 00  00 00 00 00    |................|
                        00000010  02 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00    |................|
                        00000020  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00    |................|
                        00000030  00 00 00 00  02 ab dc fa  70 00 00 00  01 00 cc cc    |........p.......|
                        00000040  68 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00    |h...............|
                        00000050  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00    |................|
                        00000060  00 00 00 00  01 00 00 00  00 00 00 00  00 00 00 00    |................|
                        00000070  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00    |................|
                        00000080  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00    |................|
                        00000090  4b 00 00 00  bc 40 77 03  00 00 00 00  00 00 00 00    |K....@w.........|
                        000000A0  00 00 00 00  00 ab dc fa  08 00 00 00                 |................|
< D3DKMTSubmitCommand => 0

Merge request reports