From 14899a636397307cc483211c684682c2f3b16b88 Mon Sep 17 00:00:00 2001 From: Harish Sadineni Date: Sat, 7 Mar 2026 21:44:41 +0000 Subject: [PATCH 1/2] tests/python: Remove x86-specific naming from tracing header Rename StaticTracepoint-ELFx86.h to StaticTracepoint-ELF.h so the header name is no longer tied to a specific architecture, enabling future support for additional architectures. Signed-off-by: Harish Sadineni --- .../tracing/{StaticTracepoint-ELFx86.h => StaticTracepoint-ELF.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/python/include/folly/tracing/{StaticTracepoint-ELFx86.h => StaticTracepoint-ELF.h} (100%) diff --git a/tests/python/include/folly/tracing/StaticTracepoint-ELFx86.h b/tests/python/include/folly/tracing/StaticTracepoint-ELF.h similarity index 100% rename from tests/python/include/folly/tracing/StaticTracepoint-ELFx86.h rename to tests/python/include/folly/tracing/StaticTracepoint-ELF.h From 1d700c8c4be29a13ccd4c5d23ea7be32c3a1a5b9 Mon Sep 17 00:00:00 2001 From: Harish Sadineni Date: Sat, 7 Mar 2026 22:02:07 +0000 Subject: [PATCH 2/2] tests/python: Add ARM and AArch64 support to static tracepoints Extend the static tracepoint (SDT) macros to work on ARM and AArch64 by: - Defining FOLLY_SDT_NOP as "nop" (the same mnemonic works for both ARM and AArch64) - Adding `defined(__aarch64__) || defined(__arm__)` to the preprocessor guard in StaticTracepoint.h This resolves USDT probe test failures on ARM64 platforms. Without these changes, the .note.stapsdt section containing probe information was missing entirely on ARM64, causing test failures when attempting to find and attach to USDT probes in the BCC test suite. Fixes: #5354 Signed-off-by: Harish Sadineni --- tests/python/include/folly/tracing/StaticTracepoint-ELF.h | 6 ++++++ tests/python/include/folly/tracing/StaticTracepoint.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/python/include/folly/tracing/StaticTracepoint-ELF.h b/tests/python/include/folly/tracing/StaticTracepoint-ELF.h index 033809cb3cb7..4782830975de 100644 --- a/tests/python/include/folly/tracing/StaticTracepoint-ELF.h +++ b/tests/python/include/folly/tracing/StaticTracepoint-ELF.h @@ -25,7 +25,13 @@ #endif // Instruction to emit for the probe. +#if defined(__x86_64__) || defined(__i386__) #define FOLLY_SDT_NOP nop +#elif defined(__aarch64__) || defined(__arm__) +#define FOLLY_SDT_NOP nop +#else +#error "Unsupported architecture" +#endif // Note section properties. #define FOLLY_SDT_NOTE_NAME "stapsdt" diff --git a/tests/python/include/folly/tracing/StaticTracepoint.h b/tests/python/include/folly/tracing/StaticTracepoint.h index 858b7dbc0cee..86f8e40cd1d2 100644 --- a/tests/python/include/folly/tracing/StaticTracepoint.h +++ b/tests/python/include/folly/tracing/StaticTracepoint.h @@ -16,10 +16,10 @@ #pragma once -#if defined(__ELF__) && (defined(__x86_64__) || defined(__i386__)) && \ +#if defined(__ELF__) && (defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || defined(__arm__)) && \ !FOLLY_DISABLE_SDT -#include +#include #define FOLLY_SDT(provider, name, ...) \ FOLLY_SDT_PROBE_N( \