Skip to content

Commit

Permalink
tests: Fix test failures due to movement of cpu_number.
Browse files Browse the repository at this point in the history
cpu_number has been merged into pcpu_hot object, for x86,
in newer (v6.2+) kernels. For some archs like aarch64, it
still exists as per-cpu variable.

Since we just need a per-cpu address for this test, use
per-cpu runqueues. These have been existing as per-cpu
varibale for long time and even if this changes in future
the change will be architecture independent, so we would not
have to worry about test passing for one arch and failing for
other.

LSE-368.

Signed-off-by: Imran Khan <[email protected]>
  • Loading branch information
imran-kn authored and brenns10 committed May 31, 2024
1 parent 6be14e8 commit 66a8b3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_AddrKind_categorize_data(prog: drgn.Program) -> None:
assert mm.AddrKind.categorize(prog, bss) == mm.AddrKind.BSS

# percpu
pcpu = prog.symbol("cpu_number").address
pcpu = prog.symbol("runqueues").address
assert mm.AddrKind.categorize(prog, pcpu) == mm.AddrKind.PERCPU


Expand Down

0 comments on commit 66a8b3b

Please sign in to comment.