Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
PrzemekWirkus opened this issue Oct 14, 2024 · 1 comment
Open

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

PrzemekWirkus opened this issue Oct 14, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@PrzemekWirkus
Copy link
Collaborator

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:

@PrzemekWirkus PrzemekWirkus added the enhancement New feature or request label Oct 14, 2024
@PrzemekWirkus
Copy link
Collaborator Author

I’ve added mitigation MR and I will work on a proper solution after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant