Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf test demangle-java: Switch to using dso__demangle_sym()

The use of the demangle-java APIs means we don't detect if a different
demangler is used before the Java one for the case that matters to
perf.

Remove the return types from the demangled names as dso__demangle_sym()
removes those.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alex Gaynor <alex.gaynor@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Ariel Ben-Yehuda <ariel.byd@gmail.com>
Cc: Benno Lossin <benno.lossin@proton.me>
Cc: Bill Wendling <morbo@google.com>
Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Daniel Xu <dxu@dxuuu.xyz>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Gary Guo <gary@garyguo.net>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Stephen Brennan <stephen.s.brennan@oracle.com>
Cc: Trevor Gross <tmgross@umich.edu>
Link: https://lore.kernel.org/r/20250430004128.474388-6-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
41fcc9a3 bdf05ccd

+8 -9
+8 -9
tools/perf/tests/demangle-java-test.c
··· 3 3 #include <stdlib.h> 4 4 #include <stdio.h> 5 5 #include <linux/kernel.h> 6 - #include "tests.h" 7 - #include "session.h" 8 6 #include "debug.h" 9 - #include "demangle-java.h" 7 + #include "symbol.h" 8 + #include "tests.h" 10 9 11 10 static int test__demangle_java(struct test_suite *test __maybe_unused, int subtest __maybe_unused) 12 11 { ··· 17 18 const char *mangled, *demangled; 18 19 } test_cases[] = { 19 20 { "Ljava/lang/StringLatin1;equals([B[B)Z", 20 - "boolean java.lang.StringLatin1.equals(byte[], byte[])" }, 21 + "java.lang.StringLatin1.equals(byte[], byte[])" }, 21 22 { "Ljava/util/zip/ZipUtils;CENSIZ([BI)J", 22 - "long java.util.zip.ZipUtils.CENSIZ(byte[], int)" }, 23 + "java.util.zip.ZipUtils.CENSIZ(byte[], int)" }, 23 24 { "Ljava/util/regex/Pattern$BmpCharProperty;match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z", 24 - "boolean java.util.regex.Pattern$BmpCharProperty.match(java.util.regex.Matcher, int, java.lang.CharSequence)" }, 25 + "java.util.regex.Pattern$BmpCharProperty.match(java.util.regex.Matcher, int, java.lang.CharSequence)" }, 25 26 { "Ljava/lang/AbstractStringBuilder;appendChars(Ljava/lang/String;II)V", 26 - "void java.lang.AbstractStringBuilder.appendChars(java.lang.String, int, int)" }, 27 + "java.lang.AbstractStringBuilder.appendChars(java.lang.String, int, int)" }, 27 28 { "Ljava/lang/Object;<init>()V", 28 - "void java.lang.Object<init>()" }, 29 + "java.lang.Object<init>()" }, 29 30 }; 30 31 31 32 for (i = 0; i < ARRAY_SIZE(test_cases); i++) { 32 - buf = java_demangle_sym(test_cases[i].mangled, 0); 33 + buf = dso__demangle_sym(/*dso=*/NULL, /*kmodule=*/0, test_cases[i].mangled); 33 34 if (strcmp(buf, test_cases[i].demangled)) { 34 35 pr_debug("FAILED: %s: %s != %s\n", test_cases[i].mangled, 35 36 buf, test_cases[i].demangled);