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

setting GRUB_CMDLINE_LINUX, example usage of perf c2c #420

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RamaMalladiAWS
Copy link
Contributor

This PR adds an example usage of perf c2c and setting the GRUB_CMDLINE_LINUX for using SPE.

Related issues: #415

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -230,6 +231,11 @@ the samples directly, you can use the [Arm SPE Parser](https://gitlab.arm.com/te

Be aware that SPE produces a large of volume of data (many GBs) if the sampling period is low and you collect the data over a long time.

### Capturing cache coherence issues
The `perf c2c` command can be used to analyze cache coherence issues and false sharing in multi-core systems.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add info that this uses SPE on Graviton, which is only available on metal instances, and requires loading the SPE driver (apt-get install linux-modules-extra-$(uname -r) && modprobe arm_spe_pmu).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add for AL as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing text does have instructions to load the SPE driver. So, not adding those again in this PR.

@@ -213,7 +213,8 @@ On Ubuntu to enable SPE requires four extra steps
# Install the arm_spe_pmu.ko module
sudo apt install linux-modules-extra-$(uname -r)

# Add kpti=off to the kernel boot command line
# Add kpti=off to the kernel boot command line: GRUB_CMDLINE_LINUX, to set it for all the installed kernels.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Modify the kernel boot arguments for all installed kernels by adding kpti=off to GRUB_CMDLINE_LINUX in /etc/default/grub"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we maybe provide a quick inline change cmd to it? something like:

sed -i -E 's/^(GRUB_CMDLINE_LINUX=".*)"/\1 kpti=off"/g'  /etc/default/grub

Copy link
Contributor

@CristianPrundeanu CristianPrundeanu Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sed command is tricky to get right in all situations, e.g. what if the line already sets kpti, or there is no GRUB_CMDLINE_LINUX line?
It's better to explain what to do so the user knows where/what to modify, rather than copy/paste something harder to understand and potentially faulty or suboptimal.

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.

3 participants