* [PATCH] perf dso: Fix build when libunwind is enabled
@ 2024-07-15 9:47 James Clark
2024-07-15 16:56 ` Ian Rogers
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: James Clark @ 2024-07-15 9:47 UTC (permalink / raw)
To: linux-perf-users
Cc: James Clark, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
Liang, Kan, Athira Rajeev, Leo Yan, Yunseong Kim, linux-kernel
Now that symsrc_filename is always accessed through an accessor, we also
need a free() function for it to avoid the following compilation error:
util/unwind-libunwind-local.c:416:12: error: lvalue required as unary
‘&’ operand
416 | zfree(&dso__symsrc_filename(dso));
Fixes: 1553419c3c10 ("perf dso: Fix address sanitizer build")
Signed-off-by: James Clark <james.clark@linaro.org>
---
tools/perf/util/dso.c | 2 +-
tools/perf/util/dso.h | 5 +++++
tools/perf/util/unwind-libunwind-local.c | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 2340c4f6d0c2..67414944f245 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -1501,7 +1501,7 @@ void dso__delete(struct dso *dso)
auxtrace_cache__free(RC_CHK_ACCESS(dso)->auxtrace_cache);
dso_cache__free(dso);
dso__free_a2l(dso);
- zfree(&RC_CHK_ACCESS(dso)->symsrc_filename);
+ dso__free_symsrc_filename(dso);
nsinfo__zput(RC_CHK_ACCESS(dso)->nsinfo);
mutex_destroy(dso__lock(dso));
RC_CHK_FREE(dso);
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 878c1f441868..ed0068251c65 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -602,6 +602,11 @@ static inline void dso__set_symsrc_filename(struct dso *dso, char *val)
RC_CHK_ACCESS(dso)->symsrc_filename = val;
}
+static inline void dso__free_symsrc_filename(struct dso *dso)
+{
+ zfree(&RC_CHK_ACCESS(dso)->symsrc_filename);
+}
+
static inline enum dso_binary_type dso__symtab_type(const struct dso *dso)
{
return RC_CHK_ACCESS(dso)->symtab_type;
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index f6a6f6a91030..16c2b03831f3 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -413,7 +413,7 @@ static int read_unwind_spec_debug_frame(struct dso *dso,
__func__,
dso__symsrc_filename(dso),
debuglink);
- zfree(&dso__symsrc_filename(dso));
+ dso__free_symsrc_filename(dso);
}
dso__set_symsrc_filename(dso, debuglink);
} else {
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] perf dso: Fix build when libunwind is enabled
2024-07-15 9:47 [PATCH] perf dso: Fix build when libunwind is enabled James Clark
@ 2024-07-15 16:56 ` Ian Rogers
2024-07-15 17:32 ` Florian Fainelli
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Ian Rogers @ 2024-07-15 16:56 UTC (permalink / raw)
To: James Clark
Cc: linux-perf-users, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Liang, Kan,
Athira Rajeev, Leo Yan, Yunseong Kim, linux-kernel
On Mon, Jul 15, 2024 at 2:48 AM James Clark <james.clark@linaro.org> wrote:
>
> Now that symsrc_filename is always accessed through an accessor, we also
> need a free() function for it to avoid the following compilation error:
>
> util/unwind-libunwind-local.c:416:12: error: lvalue required as unary
> ‘&’ operand
> 416 | zfree(&dso__symsrc_filename(dso));
>
> Fixes: 1553419c3c10 ("perf dso: Fix address sanitizer build")
> Signed-off-by: James Clark <james.clark@linaro.org>
And I wonder how this ever built..
Reviewed-by: Ian Rogers <irogers@google.com>
Thanks!
Ian
> ---
> tools/perf/util/dso.c | 2 +-
> tools/perf/util/dso.h | 5 +++++
> tools/perf/util/unwind-libunwind-local.c | 2 +-
> 3 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
> index 2340c4f6d0c2..67414944f245 100644
> --- a/tools/perf/util/dso.c
> +++ b/tools/perf/util/dso.c
> @@ -1501,7 +1501,7 @@ void dso__delete(struct dso *dso)
> auxtrace_cache__free(RC_CHK_ACCESS(dso)->auxtrace_cache);
> dso_cache__free(dso);
> dso__free_a2l(dso);
> - zfree(&RC_CHK_ACCESS(dso)->symsrc_filename);
> + dso__free_symsrc_filename(dso);
> nsinfo__zput(RC_CHK_ACCESS(dso)->nsinfo);
> mutex_destroy(dso__lock(dso));
> RC_CHK_FREE(dso);
> diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
> index 878c1f441868..ed0068251c65 100644
> --- a/tools/perf/util/dso.h
> +++ b/tools/perf/util/dso.h
> @@ -602,6 +602,11 @@ static inline void dso__set_symsrc_filename(struct dso *dso, char *val)
> RC_CHK_ACCESS(dso)->symsrc_filename = val;
> }
>
> +static inline void dso__free_symsrc_filename(struct dso *dso)
> +{
> + zfree(&RC_CHK_ACCESS(dso)->symsrc_filename);
> +}
> +
> static inline enum dso_binary_type dso__symtab_type(const struct dso *dso)
> {
> return RC_CHK_ACCESS(dso)->symtab_type;
> diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
> index f6a6f6a91030..16c2b03831f3 100644
> --- a/tools/perf/util/unwind-libunwind-local.c
> +++ b/tools/perf/util/unwind-libunwind-local.c
> @@ -413,7 +413,7 @@ static int read_unwind_spec_debug_frame(struct dso *dso,
> __func__,
> dso__symsrc_filename(dso),
> debuglink);
> - zfree(&dso__symsrc_filename(dso));
> + dso__free_symsrc_filename(dso);
> }
> dso__set_symsrc_filename(dso, debuglink);
> } else {
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] perf dso: Fix build when libunwind is enabled
2024-07-15 9:47 [PATCH] perf dso: Fix build when libunwind is enabled James Clark
2024-07-15 16:56 ` Ian Rogers
@ 2024-07-15 17:32 ` Florian Fainelli
2024-07-17 19:45 ` Leo Yan
2024-07-24 20:26 ` Namhyung Kim
3 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2024-07-15 17:32 UTC (permalink / raw)
To: James Clark, linux-perf-users
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Liang, Kan, Athira Rajeev, Leo Yan,
Yunseong Kim, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
On 7/15/24 02:47, James Clark wrote:
> Now that symsrc_filename is always accessed through an accessor, we also
> need a free() function for it to avoid the following compilation error:
>
> util/unwind-libunwind-local.c:416:12: error: lvalue required as unary
> ‘&’ operand
> 416 | zfree(&dso__symsrc_filename(dso));
>
> Fixes: 1553419c3c10 ("perf dso: Fix address sanitizer build")
> Signed-off-by: James Clark <james.clark@linaro.org>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] perf dso: Fix build when libunwind is enabled
2024-07-15 9:47 [PATCH] perf dso: Fix build when libunwind is enabled James Clark
2024-07-15 16:56 ` Ian Rogers
2024-07-15 17:32 ` Florian Fainelli
@ 2024-07-17 19:45 ` Leo Yan
2024-07-24 20:26 ` Namhyung Kim
3 siblings, 0 replies; 5+ messages in thread
From: Leo Yan @ 2024-07-17 19:45 UTC (permalink / raw)
To: James Clark, linux-perf-users
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Liang, Kan, Athira Rajeev, Leo Yan,
Yunseong Kim, linux-kernel
On 7/15/2024 10:47 AM, James Clark wrote:
>
> Now that symsrc_filename is always accessed through an accessor, we also
> need a free() function for it to avoid the following compilation error:
>
> util/unwind-libunwind-local.c:416:12: error: lvalue required as unary
> ‘&’ operand
> 416 | zfree(&dso__symsrc_filename(dso));
>
> Fixes: 1553419c3c10 ("perf dso: Fix address sanitizer build")
> Signed-off-by: James Clark <james.clark@linaro.org>
Tested-by: Leo Yan <leo.yan@arm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] perf dso: Fix build when libunwind is enabled
2024-07-15 9:47 [PATCH] perf dso: Fix build when libunwind is enabled James Clark
` (2 preceding siblings ...)
2024-07-17 19:45 ` Leo Yan
@ 2024-07-24 20:26 ` Namhyung Kim
3 siblings, 0 replies; 5+ messages in thread
From: Namhyung Kim @ 2024-07-24 20:26 UTC (permalink / raw)
To: linux-perf-users, James Clark
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Ian Rogers,
Adrian Hunter, Liang, Kan, Athira Rajeev, Leo Yan, Yunseong Kim,
linux-kernel
On Mon, 15 Jul 2024 10:47:13 +0100, James Clark wrote:
> Now that symsrc_filename is always accessed through an accessor, we also
> need a free() function for it to avoid the following compilation error:
>
> util/unwind-libunwind-local.c:416:12: error: lvalue required as unary
> ‘&’ operand
> 416 | zfree(&dso__symsrc_filename(dso));
>
> [...]
Applied to perf-tools and the mainline. :)
Thanks,
Namhyung
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-24 20:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-15 9:47 [PATCH] perf dso: Fix build when libunwind is enabled James Clark
2024-07-15 16:56 ` Ian Rogers
2024-07-15 17:32 ` Florian Fainelli
2024-07-17 19:45 ` Leo Yan
2024-07-24 20:26 ` 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).