Skip to content

Conversation

@PrzemekWirkus
Copy link
Contributor

@PrzemekWirkus PrzemekWirkus commented Oct 10, 2024

Add new learning path for WindowsPerf and SPE sampling

Before submitting a pull request for a new Learning Path, please review Create a Learning Path

  • I have reviewed Create a Learning Path

Please do not include any confidential information in your contribution. This includes confidential microarchitecture details and unannounced product information. No AI tool can be used to generate either content or code when creating a learning path or install guide.

  • I have checked my contribution for confidential information

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the Creative Commons Attribution 4.0 International License.


Description

This PR introduces a comprehensive guide and examples for sampling CPython with Arm Statistical Profiling Extensions (SPE) using WindowsPerf. The following sections have been added:

  • Introduction: An overview of the purpose and benefits of sampling CPython with Arm SPE.
  • CPython Sampling with SPE Example Overview: Detailed explanation of the example provided for sampling CPython with SPE.
  • WindowsPerf Sample using SPE Example: Step-by-step guide on how to use WindowsPerf to sample CPython with SPE.
  • WindowsPerf Record using SPE Example: Instructions on recording performance data using WindowsPerf with SPE.
  • Review: Summary of the key points and findings from the examples.
  • Next Steps: reused existing ones.

Note: this is very similar to existing Sampling CPython with WindowsPerf learning path as these two workflows (sampling) are similar, new LP is explaining how to use newly added Arm SPE sampling for Windows on Arm devices.

Fixes: arm-developer-tools/windowsperf#7

@PrzemekWirkus
Copy link
Contributor Author

@RonanSynnottArm FYI

@odincodeshen
Copy link
Contributor

Here are some of my thoughts for your reference:

  1. The GitVer on my machine was different than yours. I think that's normal since the code is keeping change, Maybe you could probably mention that it might not be exactly the same as in the learning path.
  2. I recommend slightly changing the git clone command to git clone github.com:python/cpython.git to make it simpler for those who don't want to log in.
  3. For some reason, I needed to specify .\build.bat instead of build.bat during the CPython installation to ensure Windows could find the batch file.
  4. I think "LearningPath\PCbuild\arm64" should be "cpython\PCbuild\arm64".
  5. I had trouble pinning the process to Core 1. The login window popped up, and 1010100 became the username.
    start /affinity 2 cpython\PCbuild\arm64\python_d.exe -c 1010100

@PrzemekWirkus PrzemekWirkus force-pushed the devel_add_windowsperf_sampling_cpython_spe_v2 branch from 76e99e2 to c0ac449 Compare October 14, 2024 10:55
@PrzemekWirkus
Copy link
Contributor Author

PrzemekWirkus commented Oct 14, 2024

Ad 1. Fix in c0ac449
Ad 2. Fix in 2cae488
Ad 3. Both should be OK:

>cd cpython\PCbuild
>build.bat -d p ARM
Using "C:\xxx\3.8.0-release\cpython\PCbuild\\..\externals\pythonx86\tools\python.exe" (found in externals directory)
Fetching external libraries...
bzip2-1.0.8 already exists, skipping.
...

vs

>cd cpython\PCbuild
>.\build.bat -d p ARM
Using "C:\xxx\3.8.0-release\cpython\PCbuild\\..\externals\pythonx86\tools\python.exe" (found in externals directory)
Fetching external libraries...
bzip2-1.0.8 already exists, skipping.
...

Ad 4. Fix in 38bfa33
Ad 5. I think command is start /affinity 2 cpython\PCbuild\arm64\python_d.exe -c 10**10**100 -> s/1010100/10**10**100/. Sometimes start is unable to correctly pin process to a core, sadly.

@PrzemekWirkus
Copy link
Contributor Author

PrzemekWirkus commented Oct 16, 2024

After discussion with @odincodeshen, I can see that almost all SPE related articles are in servers-and-cloud-computing, and not in laptops-and-desktops learning path section:

arm-learning-paths/content/learning-paths (main)$ for x in `ls -1`; do echo $x; git grep "\bSPE\b" $x | wc -l; done
cross-platform
1
embedded-systems
0
laptops-and-desktops
0
microcontrollers
2
servers-and-cloud-computing
36
smartphones-and-mobile
5

I've moved my docs to servers-and-cloud-computing. Se 5436bb0.

@PrzemekWirkus PrzemekWirkus force-pushed the devel_add_windowsperf_sampling_cpython_spe_v2 branch from 5436bb0 to 4eaff79 Compare October 22, 2024 14:17
@jasonrandrews jasonrandrews merged commit 7679977 into ArmDeveloperEcosystem:main Dec 10, 2024
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.

Add Sampling CPython with Arm SPE using WindowsPerf Learning Path

3 participants