Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Add support for hybrid DLLs (Arm64EC) for sampling #39

@PrzemekWirkus

Description

@PrzemekWirkus

Cloned from: https://linaro.atlassian.net/browse/WPERF-828

We now do not support hybrid PE files (ARM64EC). When sampling users hit an assert:

wperf.exe record -v -e l1i_cache -c 0 --timeout 7 -- workload.exe
deduced image name 'workload.exe'
deduced image PDB file 'workload.pdb'
pe_file 'workload.exe', args 'workload.exe'


workload.exe pid is 26636
================================
                    KERNEL32.DLL          0x000000007ffdd5540000          C:\WINDOWS\System32\KERNEL32.DLL
                  KERNELBASE.dll          0x000000007ffdd4240000          C:\WINDOWS\System32\KERNELBASE.dll
...

base address of 'workload.exe': 0x7ff6818f12f4, runtime delta: 0x7ff5418f0000
sampling ...... done!
=================
sample generated: 154
sample dropped  : 0
sample drop rate: 0.00%
Sampling stopped, process pid=26636 exited with code 0x0000
Assertion failed: b.sec_idx, file C:\path\to\source\windowsperf\wperf\main.cpp, line 753

Additional documentation

Regarding the assert: a little investigation:

Debug prints:

image

Rerunning gives tons of lines like:

VCRUNTIME140.dll has no section index for #_SomeSymbolName

Workaround:

image

Note: The key thing is that vcruntime140.dll is an arm64X dll, and it has two “halves” – an arm64EC side, and arm64 native side. The assert was firing on symbols from the arm64EC side (you can tell because those methods are prefixed with #).

See:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions