perf tests: Consolidate test__arch_unwind_sample declaration
Subsystems (2)
PATCH 1/2 perf tests: Consolidate test__arch_unwind_sample declaration
There's no reason for making the test__arch_unwind_sample declaration per arch. Currently that's done 2 different ways either with a declaration in arch-tests.h or with an arch define. Unify all this with an unconditional declaration in tests.h.
---
Note that the only thing really arch specific is getting the stack pointer. I'm happy to refactor this further to just an arch function to get the stack pointer reg.
Compiled on arm64 and x86.
--- tools/perf/arch/arm/include/arch-tests.h | 5 ----- tools/perf/arch/arm64/include/arch-tests.h | 5 ----- tools/perf/arch/powerpc/include/arch-tests.h | 7 ------- tools/perf/arch/powerpc/tests/dwarf-unwind.c | 1 - tools/perf/arch/x86/include/arch-tests.h | 7 ------- tools/perf/arch/x86/tests/dwarf-unwind.c | 1 - tools/perf/tests/dwarf-unwind.c | 4 ---- tools/perf/tests/tests.h | 2 -- 8 files changed, 32 deletions(-)
tools/perf/arch/arm/include/arch-tests.h +0 -5
@@ -2,11 +2,6 @@#ifndef ARCH_TESTS_H #define ARCH_TESTS_H -#ifdef HAVE_DWARF_UNWIND_SUPPORT -struct thread ; -struct perf_sample ; -#endif -extern struct test arch_tests[];#endif
tools/perf/arch/arm64/include/arch-tests.h +0 -5
@@ -2,11 +2,6 @@#ifndef ARCH_TESTS_H #define ARCH_TESTS_H -#ifdef HAVE_DWARF_UNWIND_SUPPORT -struct thread ; -struct perf_sample ; -#endif -extern struct test arch_tests[];#endif
tools/perf/arch/powerpc/include/arch-tests.h +0 -7
@@ -2,13 +2,6 @@#ifndef ARCH_TESTS_H #define ARCH_TESTS_H -#ifdef HAVE_DWARF_UNWIND_SUPPORT -struct thread ; -struct perf_sample ; -int test__arch_unwind_sample (struct perf_sample *sample, -struct thread *thread); -#endif -extern struct test arch_tests[];#endif
tools/perf/arch/powerpc/tests/dwarf-unwind.c +0 -1
@@ -7,7 +7,6 @@#include "event.h" #include "debug.h" #include "tests/tests.h" -#include "arch-tests.h" #define STACK_SIZE 8192
tools/perf/arch/x86/include/arch-tests.h +0 -7
@@ -12,13 +12,6 @@ int test__intel_pt_pkt_decoder(struct test *test, int subtest);int test__bp_modify (struct test *test,int subtest);int test__x86_sample_parsing (struct test *test,int subtest); -#ifdef HAVE_DWARF_UNWIND_SUPPORT -struct thread ; -struct perf_sample ; -int test__arch_unwind_sample (struct perf_sample *sample, -struct thread *thread); -#endif -extern struct test arch_tests[];#endif
tools/perf/arch/x86/tests/dwarf-unwind.c +0 -1
@@ -7,7 +7,6 @@#include "event.h" #include "debug.h" #include "tests/tests.h" -#include "arch-tests.h" #define STACK_SIZE 8192
tools/perf/tests/dwarf-unwind.c +0 -4
@@ -17,10 +17,6 @@#include "callchain.h" #include "util/synthetic-events.h" -#if defined (__x86_64__) || defined (__i386__) || defined (__powerpc__) -#include "arch-tests.h" -#endif -/* For bsearch. We try to unwind functions in shared object. */ #include <stdlib.h>
tools/perf/tests/tests.h +0 -2
@@ -133,14 +133,12 @@ bool test__bp_account_is_supported(void);bool test__wp_is_supported (void );bool test__tsc_is_supported (void ); -#if defined(__arm__) || defined(__aarch64__)#ifdef HAVE_DWARF_UNWIND_SUPPORT struct thread ;struct perf_sample ;int test__arch_unwind_sample (struct perf_sample *sample,struct thread *thread);#endif -#endif #if defined(__arm__)int test__vectors_page (struct test *test,int subtest);
Signature · 1 line
2.27.0
PATCH 2/2 perf tests: Drop __maybe_unused on x86 test declarations
Function declarations don't need __maybe_unused annotations, only the implementations do. Drop them on the perf x86 tests.
--- tools/perf/arch/x86/include/arch-tests.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
tools/perf/arch/x86/include/arch-tests.h +2 -3
@@ -2,12 +2,11 @@#ifndef ARCH_TESTS_H #define ARCH_TESTS_H -#include <linux/compiler.h> struct test ;/* Tests */ -int test__rdpmc (struct test *test__maybe_unused ,int subtest); -int test__insn_x86 (struct test *test__maybe_unused ,int subtest); +int test__rdpmc (struct test *test,int subtest); +int test__insn_x86 (struct test *test,int subtest);int test__intel_pt_pkt_decoder (struct test *test,int subtest);int test__bp_modify (struct test *test,int subtest);int test__x86_sample_parsing (struct test *test,int subtest);
Signature · 1 line
2.27.0
Re: [PATCH 2/2] perf tests: Drop __maybe_unused on x86 test declarations
Quoted 2 lines · Rob Herring
Function declarations don't need
__maybe_unusedannotations, only the implementations do. Drop them on the perf x86 tests.
for both patches:
thanks,
jirka
Quoted 36 lines
Cc Peter Zijlstra <[email protected]>Cc Ingo Molnar <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc Mark Rutland <[email protected]>Cc Alexander Shishkin <[email protected]>Cc Jiri Olsa <[email protected]>Cc Namhyung Kim <[email protected]>Signed-off-by Rob Herring <[email protected]>--- tools/perf/arch/x86/include/arch-tests.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)tools/perf/arch/x86/include/arch-tests.h +2
-3@@ -2,12 +2,11 @@#ifndef ARCH_TESTS_H #define ARCH_TESTS_H -#include <linux/compiler.h> struct test ;/* Tests */ -int test__rdpmc (struct test *test__maybe_unused ,int subtest); -int test__insn_x86 (struct test *test__maybe_unused ,int subtest); +int test__rdpmc (struct test *test,int subtest); +int test__insn_x86 (struct test *test,int subtest);int test__intel_pt_pkt_decoder (struct test *test,int subtest);int test__bp_modify (struct test *test,int subtest);int test__x86_sample_parsing (struct test *test,int subtest);Signature · 1 line
2.27.0
Re: [PATCH 2/2] perf tests: Drop __maybe_unused on x86 test declarations
Em Fri, May 14, 2021 at 11:03:01AM +0200, Jiri Olsa escreveu:
Quoted 7 lines · Rob Herring
Quoted 2 lines
Function declarations don't need
__maybe_unusedannotations, only the implementations do. Drop them on the perf x86 tests.for both patches:
Acked-by Jiri Olsa <[email protected]>
Thanks, applied.
- Arnaldo