* [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf
@ 2025-03-07 23:22 Stephen Brennan
2025-03-07 23:22 ` [PATCH v3 1/3] tools: perf: add dummy functions for !HAVE_LZMA_SUPPORT Stephen Brennan
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Stephen Brennan @ 2025-03-07 23:22 UTC (permalink / raw)
To: Namhyung Kim, Arnaldo Carvalho de Melo, Peter Zijlstra,
Ingo Molnar
Cc: Mark Rutland, Liang, Kan, linux-perf-users, James Clark,
Stephen Brennan, Ian Rogers, Alexander Shishkin,
Chaitanya S Prakash, linux-kernel, Jiri Olsa, Adrian Hunter,
Athira Rajeev
Hello all,
This series adds the ability to read symbols from the ".gnu_debugdata" section
of DSOs. More details are the cover letter of v1. This only has one small change
from v2: it adds the missing entry in dso__symtab_origin(). Its lack resulted in
truncating the output of symbols in "perf report -v" -- thanks to Arnaldo for
testing and catching that.
v2: https://lore.kernel.org/linux-perf-users/20250220185512.3357820-1-stephen.s.brennan@oracle.com/
v1: https://lore.kernel.org/linux-perf-users/20250213190542.3249050-1-stephen.s.brennan@oracle.com/
Stephen Brennan (3):
tools: perf: add dummy functions for !HAVE_LZMA_SUPPORT
tools: perf: add LZMA decompression from FILE
tools: perf: support .gnu_debugdata for symbols
tools/perf/util/compress.h | 20 +++++++
tools/perf/util/dso.c | 3 +
tools/perf/util/dso.h | 1 +
tools/perf/util/lzma.c | 29 ++++++----
tools/perf/util/symbol-elf.c | 106 ++++++++++++++++++++++++++++++++++-
tools/perf/util/symbol.c | 2 +
6 files changed, 148 insertions(+), 13 deletions(-)
--
2.43.5
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 1/3] tools: perf: add dummy functions for !HAVE_LZMA_SUPPORT
2025-03-07 23:22 [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf Stephen Brennan
@ 2025-03-07 23:22 ` Stephen Brennan
2025-03-07 23:22 ` [PATCH v3 2/3] tools: perf: add LZMA decompression from FILE Stephen Brennan
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Stephen Brennan @ 2025-03-07 23:22 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Peter Zijlstra, Namhyung Kim,
Ingo Molnar
Cc: Mark Rutland, Liang, Kan, linux-perf-users, James Clark,
Stephen Brennan, Ian Rogers, Alexander Shishkin,
Chaitanya S Prakash, linux-kernel, Jiri Olsa, Adrian Hunter,
Athira Rajeev
This allows us to use them without needing to ifdef the calling code.
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
---
tools/perf/util/compress.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/perf/util/compress.h b/tools/perf/util/compress.h
index b29109cd36095..a7650353c6622 100644
--- a/tools/perf/util/compress.h
+++ b/tools/perf/util/compress.h
@@ -5,6 +5,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <sys/types.h>
+#include <linux/compiler.h>
#ifdef HAVE_ZSTD_SUPPORT
#include <zstd.h>
#endif
@@ -17,6 +18,17 @@ bool gzip_is_compressed(const char *input);
#ifdef HAVE_LZMA_SUPPORT
int lzma_decompress_to_file(const char *input, int output_fd);
bool lzma_is_compressed(const char *input);
+#else
+static inline
+int lzma_decompress_to_file(const char *input __maybe_unused,
+ int output_fd __maybe_unused)
+{
+ return -1;
+}
+static inline int lzma_is_compressed(const char *input __maybe_unused)
+{
+ return false;
+}
#endif
struct zstd_data {
--
2.43.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 2/3] tools: perf: add LZMA decompression from FILE
2025-03-07 23:22 [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf Stephen Brennan
2025-03-07 23:22 ` [PATCH v3 1/3] tools: perf: add dummy functions for !HAVE_LZMA_SUPPORT Stephen Brennan
@ 2025-03-07 23:22 ` Stephen Brennan
2025-03-07 23:22 ` [PATCH v3 3/3] tools: perf: support .gnu_debugdata for symbols Stephen Brennan
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Stephen Brennan @ 2025-03-07 23:22 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Peter Zijlstra, Namhyung Kim,
Ingo Molnar
Cc: Mark Rutland, Liang, Kan, linux-perf-users, James Clark,
Stephen Brennan, Ian Rogers, Alexander Shishkin,
Chaitanya S Prakash, linux-kernel, Jiri Olsa, Adrian Hunter,
Athira Rajeev
Internally lzma_decompress_to_file() creates a FILE from the filename.
Add an API that takes an existing FILE directly. This allows
decompressing already-open files and even buffers opened by fmemopen().
It is necessary for supporting .gnu_debugdata in the next patch.
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
---
tools/perf/util/compress.h | 8 ++++++++
tools/perf/util/lzma.c | 29 ++++++++++++++++++-----------
2 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/tools/perf/util/compress.h b/tools/perf/util/compress.h
index a7650353c6622..6cfecfca16f24 100644
--- a/tools/perf/util/compress.h
+++ b/tools/perf/util/compress.h
@@ -4,6 +4,7 @@
#include <stdbool.h>
#include <stddef.h>
+#include <stdio.h>
#include <sys/types.h>
#include <linux/compiler.h>
#ifdef HAVE_ZSTD_SUPPORT
@@ -16,10 +17,17 @@ bool gzip_is_compressed(const char *input);
#endif
#ifdef HAVE_LZMA_SUPPORT
+int lzma_decompress_stream_to_file(FILE *input, int output_fd);
int lzma_decompress_to_file(const char *input, int output_fd);
bool lzma_is_compressed(const char *input);
#else
static inline
+int lzma_decompress_stream_to_file(FILE *input __maybe_unused,
+ int output_fd __maybe_unused)
+{
+ return -1;
+}
+static inline
int lzma_decompress_to_file(const char *input __maybe_unused,
int output_fd __maybe_unused)
{
diff --git a/tools/perf/util/lzma.c b/tools/perf/util/lzma.c
index af9a97612f9df..bbcd2ffcf4bd1 100644
--- a/tools/perf/util/lzma.c
+++ b/tools/perf/util/lzma.c
@@ -32,7 +32,7 @@ static const char *lzma_strerror(lzma_ret ret)
}
}
-int lzma_decompress_to_file(const char *input, int output_fd)
+int lzma_decompress_stream_to_file(FILE *infile, int output_fd)
{
lzma_action action = LZMA_RUN;
lzma_stream strm = LZMA_STREAM_INIT;
@@ -41,18 +41,11 @@ int lzma_decompress_to_file(const char *input, int output_fd)
u8 buf_in[BUFSIZE];
u8 buf_out[BUFSIZE];
- FILE *infile;
-
- infile = fopen(input, "rb");
- if (!infile) {
- pr_debug("lzma: fopen failed on %s: '%s'\n", input, strerror(errno));
- return -1;
- }
ret = lzma_stream_decoder(&strm, UINT64_MAX, LZMA_CONCATENATED);
if (ret != LZMA_OK) {
pr_debug("lzma: lzma_stream_decoder failed %s (%d)\n", lzma_strerror(ret), ret);
- goto err_fclose;
+ return err;
}
strm.next_in = NULL;
@@ -100,11 +93,25 @@ int lzma_decompress_to_file(const char *input, int output_fd)
err = 0;
err_lzma_end:
lzma_end(&strm);
-err_fclose:
- fclose(infile);
return err;
}
+int lzma_decompress_to_file(const char *input, int output_fd)
+{
+ FILE *infile;
+ int ret;
+
+ infile = fopen(input, "rb");
+ if (!infile) {
+ pr_debug("lzma: fopen failed on %s: '%s'\n", input, strerror(errno));
+ return -1;
+ }
+
+ ret = lzma_decompress_stream_to_file(infile, output_fd);
+ fclose(infile);
+ return ret;
+}
+
bool lzma_is_compressed(const char *input)
{
int fd = open(input, O_RDONLY);
--
2.43.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 3/3] tools: perf: support .gnu_debugdata for symbols
2025-03-07 23:22 [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf Stephen Brennan
2025-03-07 23:22 ` [PATCH v3 1/3] tools: perf: add dummy functions for !HAVE_LZMA_SUPPORT Stephen Brennan
2025-03-07 23:22 ` [PATCH v3 2/3] tools: perf: add LZMA decompression from FILE Stephen Brennan
@ 2025-03-07 23:22 ` Stephen Brennan
2025-03-10 15:52 ` [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf Arnaldo Carvalho de Melo
2025-03-11 16:11 ` Namhyung Kim
4 siblings, 0 replies; 8+ messages in thread
From: Stephen Brennan @ 2025-03-07 23:22 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Peter Zijlstra, Namhyung Kim,
Ingo Molnar
Cc: Mark Rutland, Liang, Kan, linux-perf-users, James Clark,
Stephen Brennan, Ian Rogers, Alexander Shishkin,
Chaitanya S Prakash, linux-kernel, Jiri Olsa, Adrian Hunter,
Athira Rajeev
Fedora introduced a "MiniDebuginfo" feature, in which an LZMA-compressed
ELF file is placed inside a section named ".gnu_debugdata". This file
contains nothing but a symbol table, which can be used to supplement the
.dynsym section which only contains required symbols for runtime.
It is supported by GDB for stack traces, but it should be useful for
tracing as well. Implement support for loading symbols from
.gnu_debugdata.
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
---
tools/perf/util/dso.c | 3 +
tools/perf/util/dso.h | 1 +
tools/perf/util/symbol-elf.c | 106 ++++++++++++++++++++++++++++++++++-
tools/perf/util/symbol.c | 2 +
4 files changed, 110 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 5c6e85fdae0de..7576e8e248386 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -67,6 +67,7 @@ char dso__symtab_origin(const struct dso *dso)
[DSO_BINARY_TYPE__GUEST_KMODULE] = 'G',
[DSO_BINARY_TYPE__GUEST_KMODULE_COMP] = 'M',
[DSO_BINARY_TYPE__GUEST_VMLINUX] = 'V',
+ [DSO_BINARY_TYPE__GNU_DEBUGDATA] = 'n',
};
if (dso == NULL || dso__symtab_type(dso) == DSO_BINARY_TYPE__NOT_FOUND)
@@ -93,6 +94,7 @@ bool dso__is_object_file(const struct dso *dso)
case DSO_BINARY_TYPE__UBUNTU_DEBUGINFO:
case DSO_BINARY_TYPE__MIXEDUP_UBUNTU_DEBUGINFO:
case DSO_BINARY_TYPE__BUILDID_DEBUGINFO:
+ case DSO_BINARY_TYPE__GNU_DEBUGDATA:
case DSO_BINARY_TYPE__SYSTEM_PATH_DSO:
case DSO_BINARY_TYPE__GUEST_KMODULE:
case DSO_BINARY_TYPE__GUEST_KMODULE_COMP:
@@ -224,6 +226,7 @@ int dso__read_binary_type_filename(const struct dso *dso,
case DSO_BINARY_TYPE__VMLINUX:
case DSO_BINARY_TYPE__GUEST_VMLINUX:
case DSO_BINARY_TYPE__SYSTEM_PATH_DSO:
+ case DSO_BINARY_TYPE__GNU_DEBUGDATA:
__symbol__join_symfs(filename, size, dso__long_name(dso));
break;
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index bb8e8f444054d..84d5aac666aa1 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -33,6 +33,7 @@ enum dso_binary_type {
DSO_BINARY_TYPE__UBUNTU_DEBUGINFO,
DSO_BINARY_TYPE__MIXEDUP_UBUNTU_DEBUGINFO,
DSO_BINARY_TYPE__BUILDID_DEBUGINFO,
+ DSO_BINARY_TYPE__GNU_DEBUGDATA,
DSO_BINARY_TYPE__SYSTEM_PATH_DSO,
DSO_BINARY_TYPE__GUEST_KMODULE,
DSO_BINARY_TYPE__GUEST_KMODULE_COMP,
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 66fd1249660a3..3fa92697c457b 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -7,6 +7,7 @@
#include <unistd.h>
#include <inttypes.h>
+#include "compress.h"
#include "dso.h"
#include "map.h"
#include "maps.h"
@@ -1228,6 +1229,81 @@ bool elf__needs_adjust_symbols(GElf_Ehdr ehdr)
ehdr.e_type == ET_DYN;
}
+static Elf *read_gnu_debugdata(struct dso *dso, Elf *elf, const char *name, int *fd_ret)
+{
+ Elf *elf_embedded;
+ GElf_Ehdr ehdr;
+ GElf_Shdr shdr;
+ Elf_Scn *scn;
+ Elf_Data *scn_data;
+ FILE *wrapped;
+ size_t shndx;
+ char temp_filename[] = "/tmp/perf.gnu_debugdata.elf.XXXXXX";
+ int ret, temp_fd;
+
+ if (gelf_getehdr(elf, &ehdr) == NULL) {
+ pr_debug("%s: cannot read %s ELF file.\n", __func__, name);
+ *dso__load_errno(dso) = DSO_LOAD_ERRNO__INVALID_ELF;
+ return NULL;
+ }
+
+ scn = elf_section_by_name(elf, &ehdr, &shdr, ".gnu_debugdata", &shndx);
+ if (!scn) {
+ *dso__load_errno(dso) = -ENOENT;
+ return NULL;
+ }
+
+ if (shdr.sh_type == SHT_NOBITS) {
+ pr_debug("%s: .gnu_debugdata of ELF file %s has no data.\n", __func__, name);
+ *dso__load_errno(dso) = DSO_LOAD_ERRNO__INVALID_ELF;
+ return NULL;
+ }
+
+ scn_data = elf_rawdata(scn, NULL);
+ if (!scn_data) {
+ pr_debug("%s: error reading .gnu_debugdata of %s: %s\n", __func__,
+ name, elf_errmsg(-1));
+ *dso__load_errno(dso) = DSO_LOAD_ERRNO__INVALID_ELF;
+ return NULL;
+ }
+
+ wrapped = fmemopen(scn_data->d_buf, scn_data->d_size, "r");
+ if (!wrapped) {
+ pr_debug("%s: fmemopen: %s\n", __func__, strerror(errno));
+ *dso__load_errno(dso) = -errno;
+ return NULL;
+ }
+
+ temp_fd = mkstemp(temp_filename);
+ if (temp_fd < 0) {
+ pr_debug("%s: mkstemp: %s\n", __func__, strerror(errno));
+ *dso__load_errno(dso) = -errno;
+ fclose(wrapped);
+ return NULL;
+ }
+ unlink(temp_filename);
+
+ ret = lzma_decompress_stream_to_file(wrapped, temp_fd);
+ fclose(wrapped);
+ if (ret < 0) {
+ *dso__load_errno(dso) = -errno;
+ close(temp_fd);
+ return NULL;
+ }
+
+ elf_embedded = elf_begin(temp_fd, PERF_ELF_C_READ_MMAP, NULL);
+ if (!elf_embedded) {
+ pr_debug("%s: error reading .gnu_debugdata of %s: %s\n", __func__,
+ name, elf_errmsg(-1));
+ *dso__load_errno(dso) = DSO_LOAD_ERRNO__INVALID_ELF;
+ close(temp_fd);
+ return NULL;
+ }
+ pr_debug("%s: using .gnu_debugdata of %s\n", __func__, name);
+ *fd_ret = temp_fd;
+ return elf_embedded;
+}
+
int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
enum dso_binary_type type)
{
@@ -1256,6 +1332,19 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
goto out_close;
}
+ if (type == DSO_BINARY_TYPE__GNU_DEBUGDATA) {
+ int new_fd;
+ Elf *embedded = read_gnu_debugdata(dso, elf, name, &new_fd);
+
+ if (!embedded)
+ goto out_close;
+
+ elf_end(elf);
+ close(fd);
+ fd = new_fd;
+ elf = embedded;
+ }
+
if (gelf_getehdr(elf, &ehdr) == NULL) {
*dso__load_errno(dso) = DSO_LOAD_ERRNO__INVALID_ELF;
pr_debug("%s: cannot get elf header.\n", __func__);
@@ -1854,10 +1943,23 @@ int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss,
kmodule, 1);
if (err < 0)
return err;
- err += nr;
+ nr += err;
}
- return err;
+ /*
+ * The .gnu_debugdata is a special situation: it contains a symbol
+ * table, but the runtime file may also contain dynsym entries which are
+ * not present there. We need to load both.
+ */
+ if (syms_ss->type == DSO_BINARY_TYPE__GNU_DEBUGDATA && runtime_ss->dynsym) {
+ err = dso__load_sym_internal(dso, map, runtime_ss, runtime_ss,
+ kmodule, 1);
+ if (err < 0)
+ return err;
+ nr += err;
+ }
+
+ return nr;
}
static int elf_read_maps(Elf *elf, bool exe, mapfn_t mapfn, void *data)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 49b08adc6ee34..a0767762d4d73 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -84,6 +84,7 @@ static enum dso_binary_type binary_type_symtab[] = {
DSO_BINARY_TYPE__FEDORA_DEBUGINFO,
DSO_BINARY_TYPE__UBUNTU_DEBUGINFO,
DSO_BINARY_TYPE__BUILDID_DEBUGINFO,
+ DSO_BINARY_TYPE__GNU_DEBUGDATA,
DSO_BINARY_TYPE__SYSTEM_PATH_DSO,
DSO_BINARY_TYPE__GUEST_KMODULE,
DSO_BINARY_TYPE__GUEST_KMODULE_COMP,
@@ -1716,6 +1717,7 @@ static bool dso__is_compatible_symtab_type(struct dso *dso, bool kmod,
case DSO_BINARY_TYPE__MIXEDUP_UBUNTU_DEBUGINFO:
case DSO_BINARY_TYPE__BUILDID_DEBUGINFO:
case DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO:
+ case DSO_BINARY_TYPE__GNU_DEBUGDATA:
return !kmod && dso__kernel(dso) == DSO_SPACE__USER;
case DSO_BINARY_TYPE__KALLSYMS:
--
2.43.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf
2025-03-07 23:22 [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf Stephen Brennan
` (2 preceding siblings ...)
2025-03-07 23:22 ` [PATCH v3 3/3] tools: perf: support .gnu_debugdata for symbols Stephen Brennan
@ 2025-03-10 15:52 ` Arnaldo Carvalho de Melo
2025-03-10 21:32 ` Namhyung Kim
2025-03-11 16:11 ` Namhyung Kim
4 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2025-03-10 15:52 UTC (permalink / raw)
To: Stephen Brennan
Cc: Namhyung Kim, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Liang, Kan, linux-perf-users, James Clark, Ian Rogers,
Alexander Shishkin, Chaitanya S Prakash, linux-kernel, Jiri Olsa,
Adrian Hunter, Athira Rajeev
On Fri, Mar 07, 2025 at 03:22:00PM -0800, Stephen Brennan wrote:
> Hello all,
>
> This series adds the ability to read symbols from the ".gnu_debugdata" section
> of DSOs. More details are the cover letter of v1. This only has one small change
> from v2: it adds the missing entry in dso__symtab_origin(). Its lack resulted in
> truncating the output of symbols in "perf report -v" -- thanks to Arnaldo for
> testing and catching that.
>
> v2: https://lore.kernel.org/linux-perf-users/20250220185512.3357820-1-stephen.s.brennan@oracle.com/
> v1: https://lore.kernel.org/linux-perf-users/20250213190542.3249050-1-stephen.s.brennan@oracle.com/
>
> Stephen Brennan (3):
> tools: perf: add dummy functions for !HAVE_LZMA_SUPPORT
> tools: perf: add LZMA decompression from FILE
> tools: perf: support .gnu_debugdata for symbols
Next time please follow the convention on subject lines in tools/perf:
36e7748d33bf6a82 (perf-tools-next/perf-tools-next) perf tests: Fix data symbol test with LTO builds
e1f5bb18a7b25cac perf report: Fix memory leaks in the hierarchy mode
e242df05ee5f2ab0 perf report: Use map_symbol__copy() when copying callchains
4c3f09e35ca999f6 perf annotate: Return errors from disasm_line__parse_powerpc()
dab8c32ece27c7d8 perf annotate: Add annotation_options.disassembler_used
b0920abe0d529101 perf report: Do not process non-JIT BPF ksymbol events
2c744f38da7aeae7 perf test: Fix leak in "Synthesize attr update" test
41453107bfc30083 perf machine: Fix insertion of PERF_RECORD_KSYMBOL related kernel maps
e0e4e0b8b7fabd8c perf maps: Add missing map__set_kmap_maps() when replacing a kernel map
0d11fab32714a2da perf maps: Fixup maps_by_name when modifying maps_by_address
f7a46e028c394cd4 perf machine: Fixup kernel maps ends after adding extra maps
25d9c0301d36f4d8 perf maps: Set the kmaps for newly created/added kernel maps
99deaf5578cd768f perf maps: Introduce map__set_kmap_maps() for kernel maps
74fb903b212925ca perf script: Fix output type for dynamically allocated core PMU's
957d194163bf983d perf bench: Fix perf bench syscall loop count
b627b443ccfbdd2c perf test: Simplify data symbol test
f04c7ef35256beea perf test: Add timeout to datasym workload
15bcfb96d0ddbc1b perf test: Add trace record and replay test
38672c5033c3aebc perf test: Skip perf trace tests when running as non-root
3fb29a7514e727ca perf test: Skip perf probe tests when running as non-root
⬢ [acme@toolbox perf-tools-next]$
I.e. perf, followed by the tool or class (machine, maps, etc), followed
by : and then the summary, starting with a capital letter.
I retested and everything looks great, so please add my:
Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Thanks,
- Arnaldo
> tools/perf/util/compress.h | 20 +++++++
> tools/perf/util/dso.c | 3 +
> tools/perf/util/dso.h | 1 +
> tools/perf/util/lzma.c | 29 ++++++----
> tools/perf/util/symbol-elf.c | 106 ++++++++++++++++++++++++++++++++++-
> tools/perf/util/symbol.c | 2 +
> 6 files changed, 148 insertions(+), 13 deletions(-)
>
> --
> 2.43.5
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf
2025-03-10 15:52 ` [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf Arnaldo Carvalho de Melo
@ 2025-03-10 21:32 ` Namhyung Kim
2025-03-10 23:42 ` Stephen Brennan
0 siblings, 1 reply; 8+ messages in thread
From: Namhyung Kim @ 2025-03-10 21:32 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Stephen Brennan, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Liang, Kan, linux-perf-users, James Clark, Ian Rogers,
Alexander Shishkin, Chaitanya S Prakash, linux-kernel, Jiri Olsa,
Adrian Hunter, Athira Rajeev
On Mon, Mar 10, 2025 at 12:52:40PM -0300, Arnaldo Carvalho de Melo wrote:
> On Fri, Mar 07, 2025 at 03:22:00PM -0800, Stephen Brennan wrote:
> > Hello all,
> >
> > This series adds the ability to read symbols from the ".gnu_debugdata" section
> > of DSOs. More details are the cover letter of v1. This only has one small change
> > from v2: it adds the missing entry in dso__symtab_origin(). Its lack resulted in
> > truncating the output of symbols in "perf report -v" -- thanks to Arnaldo for
> > testing and catching that.
> >
> > v2: https://lore.kernel.org/linux-perf-users/20250220185512.3357820-1-stephen.s.brennan@oracle.com/
> > v1: https://lore.kernel.org/linux-perf-users/20250213190542.3249050-1-stephen.s.brennan@oracle.com/
> >
> > Stephen Brennan (3):
> > tools: perf: add dummy functions for !HAVE_LZMA_SUPPORT
> > tools: perf: add LZMA decompression from FILE
> > tools: perf: support .gnu_debugdata for symbols
>
> Next time please follow the convention on subject lines in tools/perf:
>
> 36e7748d33bf6a82 (perf-tools-next/perf-tools-next) perf tests: Fix data symbol test with LTO builds
> e1f5bb18a7b25cac perf report: Fix memory leaks in the hierarchy mode
> e242df05ee5f2ab0 perf report: Use map_symbol__copy() when copying callchains
> 4c3f09e35ca999f6 perf annotate: Return errors from disasm_line__parse_powerpc()
> dab8c32ece27c7d8 perf annotate: Add annotation_options.disassembler_used
> b0920abe0d529101 perf report: Do not process non-JIT BPF ksymbol events
> 2c744f38da7aeae7 perf test: Fix leak in "Synthesize attr update" test
> 41453107bfc30083 perf machine: Fix insertion of PERF_RECORD_KSYMBOL related kernel maps
> e0e4e0b8b7fabd8c perf maps: Add missing map__set_kmap_maps() when replacing a kernel map
> 0d11fab32714a2da perf maps: Fixup maps_by_name when modifying maps_by_address
> f7a46e028c394cd4 perf machine: Fixup kernel maps ends after adding extra maps
> 25d9c0301d36f4d8 perf maps: Set the kmaps for newly created/added kernel maps
> 99deaf5578cd768f perf maps: Introduce map__set_kmap_maps() for kernel maps
> 74fb903b212925ca perf script: Fix output type for dynamically allocated core PMU's
> 957d194163bf983d perf bench: Fix perf bench syscall loop count
> b627b443ccfbdd2c perf test: Simplify data symbol test
> f04c7ef35256beea perf test: Add timeout to datasym workload
> 15bcfb96d0ddbc1b perf test: Add trace record and replay test
> 38672c5033c3aebc perf test: Skip perf trace tests when running as non-root
> 3fb29a7514e727ca perf test: Skip perf probe tests when running as non-root
> ⬢ [acme@toolbox perf-tools-next]$
>
> I.e. perf, followed by the tool or class (machine, maps, etc), followed
> by : and then the summary, starting with a capital letter.
Yep, I can fix them this time but please follow the convention next
time.
>
> I retested and everything looks great, so please add my:
>
> Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Thanks for the review!
Namhyung
>
> > tools/perf/util/compress.h | 20 +++++++
> > tools/perf/util/dso.c | 3 +
> > tools/perf/util/dso.h | 1 +
> > tools/perf/util/lzma.c | 29 ++++++----
> > tools/perf/util/symbol-elf.c | 106 ++++++++++++++++++++++++++++++++++-
> > tools/perf/util/symbol.c | 2 +
> > 6 files changed, 148 insertions(+), 13 deletions(-)
> >
> > --
> > 2.43.5
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf
2025-03-10 21:32 ` Namhyung Kim
@ 2025-03-10 23:42 ` Stephen Brennan
0 siblings, 0 replies; 8+ messages in thread
From: Stephen Brennan @ 2025-03-10 23:42 UTC (permalink / raw)
To: Namhyung Kim, Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, Mark Rutland, Liang, Kan,
linux-perf-users, James Clark, Ian Rogers, Alexander Shishkin,
Chaitanya S Prakash, linux-kernel, Jiri Olsa, Adrian Hunter,
Athira Rajeev
Namhyung Kim <namhyung@kernel.org> writes:
> On Mon, Mar 10, 2025 at 12:52:40PM -0300, Arnaldo Carvalho de Melo wrote:
>> On Fri, Mar 07, 2025 at 03:22:00PM -0800, Stephen Brennan wrote:
>> > Hello all,
>> >
>> > This series adds the ability to read symbols from the ".gnu_debugdata" section
>> > of DSOs. More details are the cover letter of v1. This only has one small change
>> > from v2: it adds the missing entry in dso__symtab_origin(). Its lack resulted in
>> > truncating the output of symbols in "perf report -v" -- thanks to Arnaldo for
>> > testing and catching that.
>> >
>> > v2: https://lore.kernel.org/linux-perf-users/20250220185512.3357820-1-stephen.s.brennan@oracle.com/
>> > v1: https://lore.kernel.org/linux-perf-users/20250213190542.3249050-1-stephen.s.brennan@oracle.com/
>> >
>> > Stephen Brennan (3):
>> > tools: perf: add dummy functions for !HAVE_LZMA_SUPPORT
>> > tools: perf: add LZMA decompression from FILE
>> > tools: perf: support .gnu_debugdata for symbols
>>
>> Next time please follow the convention on subject lines in tools/perf:
>>
>> 36e7748d33bf6a82 (perf-tools-next/perf-tools-next) perf tests: Fix data symbol test with LTO builds
>> e1f5bb18a7b25cac perf report: Fix memory leaks in the hierarchy mode
>> e242df05ee5f2ab0 perf report: Use map_symbol__copy() when copying callchains
>> 4c3f09e35ca999f6 perf annotate: Return errors from disasm_line__parse_powerpc()
>> dab8c32ece27c7d8 perf annotate: Add annotation_options.disassembler_used
>> b0920abe0d529101 perf report: Do not process non-JIT BPF ksymbol events
>> 2c744f38da7aeae7 perf test: Fix leak in "Synthesize attr update" test
>> 41453107bfc30083 perf machine: Fix insertion of PERF_RECORD_KSYMBOL related kernel maps
>> e0e4e0b8b7fabd8c perf maps: Add missing map__set_kmap_maps() when replacing a kernel map
>> 0d11fab32714a2da perf maps: Fixup maps_by_name when modifying maps_by_address
>> f7a46e028c394cd4 perf machine: Fixup kernel maps ends after adding extra maps
>> 25d9c0301d36f4d8 perf maps: Set the kmaps for newly created/added kernel maps
>> 99deaf5578cd768f perf maps: Introduce map__set_kmap_maps() for kernel maps
>> 74fb903b212925ca perf script: Fix output type for dynamically allocated core PMU's
>> 957d194163bf983d perf bench: Fix perf bench syscall loop count
>> b627b443ccfbdd2c perf test: Simplify data symbol test
>> f04c7ef35256beea perf test: Add timeout to datasym workload
>> 15bcfb96d0ddbc1b perf test: Add trace record and replay test
>> 38672c5033c3aebc perf test: Skip perf trace tests when running as non-root
>> 3fb29a7514e727ca perf test: Skip perf probe tests when running as non-root
>> ⬢ [acme@toolbox perf-tools-next]$
>>
>> I.e. perf, followed by the tool or class (machine, maps, etc), followed
>> by : and then the summary, starting with a capital letter.
>
> Yep, I can fix them this time but please follow the convention next
> time.
Thank you for the fix-up! I will use that style going forward.
>>
>> I retested and everything looks great, so please add my:
>>
>> Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
And thanks Arnaldo for the test & review!
Stephen
> Thanks for the review!
> Namhyung
>
>>
>> > tools/perf/util/compress.h | 20 +++++++
>> > tools/perf/util/dso.c | 3 +
>> > tools/perf/util/dso.h | 1 +
>> > tools/perf/util/lzma.c | 29 ++++++----
>> > tools/perf/util/symbol-elf.c | 106 ++++++++++++++++++++++++++++++++++-
>> > tools/perf/util/symbol.c | 2 +
>> > 6 files changed, 148 insertions(+), 13 deletions(-)
>> >
>> > --
>> > 2.43.5
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf
2025-03-07 23:22 [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf Stephen Brennan
` (3 preceding siblings ...)
2025-03-10 15:52 ` [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf Arnaldo Carvalho de Melo
@ 2025-03-11 16:11 ` Namhyung Kim
4 siblings, 0 replies; 8+ messages in thread
From: Namhyung Kim @ 2025-03-11 16:11 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
Stephen Brennan
Cc: Mark Rutland, Liang, Kan, linux-perf-users, James Clark,
Ian Rogers, Alexander Shishkin, Chaitanya S Prakash, linux-kernel,
Jiri Olsa, Adrian Hunter, Athira Rajeev
On Fri, 07 Mar 2025 15:22:00 -0800, Stephen Brennan wrote:
> This series adds the ability to read symbols from the ".gnu_debugdata" section
> of DSOs. More details are the cover letter of v1. This only has one small change
> from v2: it adds the missing entry in dso__symtab_origin(). Its lack resulted in
> truncating the output of symbols in "perf report -v" -- thanks to Arnaldo for
> testing and catching that.
>
> v2: https://lore.kernel.org/linux-perf-users/20250220185512.3357820-1-stephen.s.brennan@oracle.com/
> v1: https://lore.kernel.org/linux-perf-users/20250213190542.3249050-1-stephen.s.brennan@oracle.com/
>
> [...]
Applied to perf-tools-next, thanks!
Best regards,
Namhyung
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-03-11 16:11 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07 23:22 [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf Stephen Brennan
2025-03-07 23:22 ` [PATCH v3 1/3] tools: perf: add dummy functions for !HAVE_LZMA_SUPPORT Stephen Brennan
2025-03-07 23:22 ` [PATCH v3 2/3] tools: perf: add LZMA decompression from FILE Stephen Brennan
2025-03-07 23:22 ` [PATCH v3 3/3] tools: perf: support .gnu_debugdata for symbols Stephen Brennan
2025-03-10 15:52 ` [PATCH v3 0/3] Support .gnu_debugdata for symbols in perf Arnaldo Carvalho de Melo
2025-03-10 21:32 ` Namhyung Kim
2025-03-10 23:42 ` Stephen Brennan
2025-03-11 16:11 ` Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).