|
| 1 | +--- |
| 2 | +title: Assess OS kernel |
| 3 | +weight: 3 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | +### Step 1.0) Check whether the OS kernel is built with SPE |
| 10 | + |
| 11 | +From the Getting Started section, you know you need to verify both the kernel and driver layers. Start by checking the kernel version: |
| 12 | + |
| 13 | +```bash |
| 14 | +uname -r |
| 15 | +``` |
| 16 | +The output will be similar to: |
| 17 | + |
| 18 | +```output |
| 19 | +6.17.0-1010-aws |
| 20 | +``` |
| 21 | + |
| 22 | +This AWS instance is running the standard Ubuntu 24.04 LTS Amazon Machine Image (AMI) provided through AWS Quick Start. The command output shows a Linux 6.17 kernel, and the `1010-aws` suffix indicates an AWS-specific build customized for the AWS environment. |
| 23 | + |
| 24 | +Now check whether this kernel was built with SPE support enabled: |
| 25 | + |
| 26 | +```bash |
| 27 | +grep CONFIG_ARM_SPE_PMU /boot/config-$(uname -r) 2>/dev/null || true |
| 28 | +``` |
| 29 | + |
| 30 | +The possible outputs are `y`, `m`, or `n`, meaning built-in support, module support, or no support. |
| 31 | + |
| 32 | +- `y` indicates that the kernel was built with SPE support. |
| 33 | +- `m` indicates that SPE is available as a loadable kernel module. This is the typical output for cloud instances. |
| 34 | +- `n` means the kernel was **not** built with SPE support. |
| 35 | + |
| 36 | +If the output from the previous command is `CONFIG_ARM_SPE_PMU = n`, **skip directly to Step 3.0**. |
| 37 | + |
| 38 | +If the output from the previous command is `CONFIG_ARM_SPE_PMU = y`, **you can skip directly to step 1.2.** |
| 39 | + |
| 40 | +### Step 1.1) Check whether the kernel module is available |
| 41 | + |
| 42 | +If your output was `CONFIG_ARM_SPE_PMU = m`, as shown below, the OS kernel includes SPE support. However, you still need to confirm that the driver layer is present and can be loaded. |
| 43 | + |
| 44 | +```output |
| 45 | +CONFIG_ARM_SPE_PMU = m |
| 46 | +``` |
| 47 | + |
| 48 | +Run the following command to check whether the loadable kernel module (driver) is available on the target: |
| 49 | + |
| 50 | +```bash |
| 51 | +modinfo arm_spe_pmu 2>/dev/null || echo "arm_spe_pmu not present for this kernel" |
| 52 | +``` |
| 53 | + |
| 54 | +If you see output similar to the following, `arm_spe_pmu` is built as a module. If you see `arm_spe_pmu not present for this kernel`, continue to step 1.2. We will attempt to find and install the module for our specific kernel in later steps. |
| 55 | + |
| 56 | +```output |
| 57 | +filename: /lib/modules/6.17.0-1010-aws/kernel/drivers/perf/arm_spe_pmu.ko.zst |
| 58 | +license: GPL v2 |
| 59 | +author: Will Deacon <will.deacon@arm.com> |
| 60 | +description: Perf driver for the ARMv8.2 Statistical Profiling Extension |
| 61 | +srcversion: 3B6FCB5AD9B37B8BB9FF4A9 |
| 62 | +... |
| 63 | +``` |
| 64 | + |
| 65 | +Next, run the following command to load the driver: |
| 66 | + |
| 67 | +```bash |
| 68 | +sudo modprobe arm_spe_pmu |
| 69 | +lsmod | grep arm_spe_pmu |
| 70 | +``` |
| 71 | + |
| 72 | +If it loads correctly, the output will be similar to: |
| 73 | + |
| 74 | +```output |
| 75 | +arm_spe_pmu 24576 0 |
| 76 | +``` |
| 77 | + |
| 78 | +In Step 1.2, use Sysreport to review system-level metrics, including SPE status. |
| 79 | + |
| 80 | +### Step 1.2) Run Sysreport |
| 81 | + |
| 82 | +Follow the steps in the [Get ready for performance analysis with Sysreport guide](https://learn.arm.com/learning-paths/servers-and-cloud-computing/sysreport/) and run `sysreport` on your system: |
| 83 | + |
| 84 | +```bash |
| 85 | +python /src/sysreport.py |
| 86 | +``` |
| 87 | + |
| 88 | +This prints information about your system, including whether SPE is enabled. The `perf sampling` label shows SPE status. It also provides useful details for further debugging. |
| 89 | + |
| 90 | +```output |
| 91 | +System feature report: |
| 92 | + Collected: 2026-04-13 09:40:16.344396 |
| 93 | + Script version: 2026-04-08 08:08:28.656402 |
| 94 | + Running as root: False |
| 95 | +System hardware: |
| 96 | + Architecture: ARMv8.4 |
| 97 | + CPUs: 64 |
| 98 | + CPU types: 64 x Arm Neoverse V1 r1p1 |
| 99 | + cache info: size, associativity, sharing |
| 100 | + cache line size: 64 |
| 101 | + Caches: |
| 102 | + 64 x L1D 64K 4-way 64b-line |
| 103 | + 64 x L1I 64K 4-way 64b-line |
| 104 | + 64 x L2U 1M 8-way 64b-line |
| 105 | + 1 x L3U 32M 16-way 64b-line |
| 106 | + System memory: 126G |
| 107 | + Atomic operations: True |
| 108 | + interconnect: CMN-650 x 1 |
| 109 | + NUMA nodes: 1 |
| 110 | + Sockets: 1 |
| 111 | +OS configuration: |
| 112 | + Kernel: 6.17.0 |
| 113 | + config: /boot/config-6.17.0-1010-aws |
| 114 | + build dir: /lib/modules/6.17.0-1010-aws/build |
| 115 | + uses atomics: True |
| 116 | + page size: 4K |
| 117 | + huge pages: 2048kB: 0, 32768kB: 0, 64kB: 0, 1048576kB: 0 |
| 118 | + transparent HP: madvise |
| 119 | + MPAM configured: False |
| 120 | + resctrl: False |
| 121 | + Distribution: Ubuntu 24.04.4 LTS |
| 122 | + libc version: glibc 2.39 |
| 123 | + boot info: ACPI |
| 124 | + KPTI enforced: False |
| 125 | + Lockdown: landlock, lockdown, yama, integrity, apparmor |
| 126 | + Mitigations: spectre_v2:CSV2, BHB; spec_store_bypass:Speculative Store Bypass disabled via prctl; spectre_v1:__user pointer sanitization |
| 127 | +Performance features: |
| 128 | + perf tools: True |
| 129 | + perf installed at: /usr/lib/linux-tools/6.17.0-1010-aws/perf |
| 130 | + perf with OpenCSD: False |
| 131 | + perf counters: 6 |
| 132 | + perf sampling: None |
| 133 | + perf HW trace: None |
| 134 | + perf paranoid: 0 |
| 135 | + CAP_PERFMON: disabled |
| 136 | + kptr_restrict: 1 |
| 137 | + perf in userspace: disabled |
| 138 | + interconnect perf: True |
| 139 | + /proc/kcore: True |
| 140 | + /dev/mem: True |
| 141 | + eBPF: |
| 142 | + kernel configured for BPF: True |
| 143 | + bpftool installed: True |
| 144 | + bpftool v7.7.0 using libbpf v1.7 features: |
| 145 | + bpftrace installed: bpftrace v0.20.2 |
| 146 | +
|
| 147 | +
|
| 148 | +Actions that can be taken to improve performance tools experience: |
| 149 | + perf tools cannot decode hardware trace |
| 150 | + build with CORESIGHT=1 |
| 151 | + non-invasive sampling (SPE) not enabled |
| 152 | + ensure APIC table describes SPE interrupt |
| 153 | + kernel module arm_spe_pmu.ko must be built |
| 154 | + hardware trace not enabled |
| 155 | + rebuild kernel with CONFIG_CORESIGHT |
| 156 | + ensure ACPI describes CoreSight trace fabric |
| 157 | +``` |
| 158 | + |
| 159 | +In this example, the output shows `perf sampling: None`, so continue to the next step. |
0 commit comments