linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] 2 memory fixes and a build fix
@ 2024-09-24  0:37 Ian Rogers
  2024-09-24  0:37 ` [PATCH v1 1/3] perf disasm: Fix capstone memory leak Ian Rogers
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Ian Rogers @ 2024-09-24  0:37 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Kan Liang, Kajol Jain, Athira Rajeev,
	Steinar H. Gunderson, Masami Hiramatsu, David S. Miller,
	Przemek Kitszel, Alexander Lobakin, Hemant Kumar,
	linux-perf-users, linux-kernel, Yang Jihong, leo.yan

I was looking into some lsan regressions and a latent issue with
libdw, creating these fixes.

A thought, we should probably simplify the libdw logic but rather than
do it here I'll do it as a separate series on top of these. The issues
I see are:

1) dwfl_thread_getframes is used to test for the presence of
   libdw-dwarf-unwind. The blame date on this function is
   2013-05-30. As the function is 10 years old I think having libdw
   implies having dwfl_thread_getframes and so we can just merge the
   two pieces of logic instead of having different feature tests and
   ifdefs.

2) similarly, dwarf_getlocations has a blame date of 2013-08-23 so
   let's just make libdw tests test for this and make having libdw
   imply dwarf_getlocations support.

3) similarly, dwarf_getcfi has a blame date of 2009-06-24 so let's
   just make libdw tests test for this and make having libdw imply
   dwarf_getcfi support.

4) in Makefie.config feature-dwarf is a synonym for libdw support. I
   think using the name libdw is more intention revealing as dwarf can
   mean multiple things. Let's change HAVE_DWARF_SUPPORT to
   HAVE_LIBDW_SUPPORT and all similar dwarf vs libdw names.

5) We have "#if _ELFUTILS_PREREQ(0, 142)" testing for elfutils version
   0.142. Elfutils 0.142 was released around 2009-06-13 (via git blame
   on the NEWS file). Let's remove the #if and ensure elfutils feature
   tests for at least 0.142. If someone were using an incredibly old
   version then they'd lose some elfutils support, but given the 15
   year old age of the library I find it unlikely anyone is doing
   this. They can also just move to a newer version.

From the mailing list I notice also overlap with the last patch and
this series:
https://lore.kernel.org/lkml/20240919013513.118527-1-yangjihong@bytedance.com/
Simplifying the libdw support will address some of those issues too.

Ian Rogers (3):
  perf disasm: Fix capstone memory leak
  perf probe: Fix libdw memory leak
  perf build: Fix !HAVE_DWARF_GETLOCATIONS_SUPPORT

 tools/perf/Makefile.config     |  6 ++++++
 tools/perf/util/disasm.c       | 11 +++++++----
 tools/perf/util/dwarf-aux.h    |  1 +
 tools/perf/util/probe-finder.c |  5 +++++
 4 files changed, 19 insertions(+), 4 deletions(-)

-- 
2.46.0.792.g87dc391469-goog


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-10-02 21:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-24  0:37 [PATCH v1 0/3] 2 memory fixes and a build fix Ian Rogers
2024-09-24  0:37 ` [PATCH v1 1/3] perf disasm: Fix capstone memory leak Ian Rogers
2024-09-24 18:38   ` Namhyung Kim
2024-09-24 19:51     ` Ian Rogers
2024-09-25  5:57       ` Namhyung Kim
2024-09-24  0:37 ` [PATCH v1 2/3] perf probe: Fix libdw " Ian Rogers
2024-09-24  9:17   ` James Clark
2024-09-24 18:39     ` Namhyung Kim
2024-09-24 19:47       ` Ian Rogers
2024-09-25  6:00         ` Namhyung Kim
2024-10-02 17:43   ` Namhyung Kim
2024-10-02 19:08     ` Ian Rogers
2024-10-02 21:53       ` Namhyung Kim
2024-09-24  0:37 ` [PATCH v1 3/3] perf build: Fix !HAVE_DWARF_GETLOCATIONS_SUPPORT Ian Rogers
2024-09-24  9:18 ` [PATCH v1 0/3] 2 memory fixes and a build fix James Clark
2024-09-24 18:25 ` Namhyung Kim
2024-10-01  5:11   ` Ian Rogers
2024-10-01 23:58     ` 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).