From 6678e1ef64b4d0329a0b573ed8e2c3ca77dc6c78 Mon Sep 17 00:00:00 2001 From: Feng Yang Date: Wed, 1 Jan 2025 16:33:10 +0800 Subject: [PATCH] tools/compactsnoop: Add aarch64 support Signed-off-by: Feng Yang --- tools/compactsnoop.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/compactsnoop.py b/tools/compactsnoop.py index dbd1b5b1c6f5..4c4c981665f1 100755 --- a/tools/compactsnoop.py +++ b/tools/compactsnoop.py @@ -260,11 +260,12 @@ } """ -if platform.machine() != 'x86_64' and platform.machine() != 'ppc64le': +if (platform.machine() != 'x86_64' and platform.machine() != 'ppc64le' + and platform.machine() != 'aarch64'): print(""" - Currently only support x86_64 and power servers, if you want + Currently only support x86_64 , aarch64 and power servers, if you want to use it on other platforms(including power embedded processors), - please refer include/linux/mmzone.h to modify zone_idex_to_str to + please refer include/linux/mmzone.h to modify zone_idx_to_str to get the right zone type """) exit() @@ -295,7 +296,6 @@ def zone_idx_to_str(idx): # from include/linux/mmzone.h - # NOTICE: consider only x86_64 servers zone_type = { 'x86_64': { @@ -308,6 +308,14 @@ def zone_idx_to_str(idx): { 0: "ZONE_NORMAL", 1: "ZONE_MOVABLE" + }, + 'aarch64': + { + 0: "ZONE_DMA", + 1: "ZONE_DMA32", + 2: "ZONE_NORMAL", + 3: "ZONE_MOVABLE", + 4: "ZONE_DEVICE" } }