public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [FYI PATCH 1/1] perf tools: Update copy of libbpf's hashmap.c
@ 2022-03-29 14:46 Arnaldo Carvalho de Melo
  2022-03-29 16:25 ` Andrii Nakryiko
  0 siblings, 1 reply; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-03-29 14:46 UTC (permalink / raw)
  To: Mauricio Vásquez, Andrii Nakryiko
  Cc: Ian Rogers, Jiri Olsa, Namhyung Kim, Linux Kernel Mailing List

Just FYI, I'm carrying this patch in the perf tools tree.

- Arnaldo

---

To pick the changes in:

  fba60b171a032283 ("libbpf: Use IS_ERR_OR_NULL() in hashmap__free()")

That don't entail any changes in tools/perf.

This addresses this perf build warning:

  Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h'
  diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h

Not a kernel ABI, its just that this uses the mechanism in place for
checking kernel ABI files drift.

Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mauricio Vásquez <mauricio@kinvolk.io>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hashmap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/util/hashmap.c b/tools/perf/util/hashmap.c
index 3c20b126d60d869a..aeb09c2887162d16 100644
--- a/tools/perf/util/hashmap.c
+++ b/tools/perf/util/hashmap.c
@@ -75,7 +75,7 @@ void hashmap__clear(struct hashmap *map)
 
 void hashmap__free(struct hashmap *map)
 {
-	if (!map)
+	if (IS_ERR_OR_NULL(map))
 		return;
 
 	hashmap__clear(map);
@@ -238,4 +238,3 @@ bool hashmap__delete(struct hashmap *map, const void *key,
 
 	return true;
 }
-
-- 
2.35.1


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

* Re: [FYI PATCH 1/1] perf tools: Update copy of libbpf's hashmap.c
  2022-03-29 14:46 [FYI PATCH 1/1] perf tools: Update copy of libbpf's hashmap.c Arnaldo Carvalho de Melo
@ 2022-03-29 16:25 ` Andrii Nakryiko
  0 siblings, 0 replies; 2+ messages in thread
From: Andrii Nakryiko @ 2022-03-29 16:25 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Mauricio Vásquez, Andrii Nakryiko, Ian Rogers, Jiri Olsa,
	Namhyung Kim, Linux Kernel Mailing List

On Tue, Mar 29, 2022 at 7:46 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> Just FYI, I'm carrying this patch in the perf tools tree.
>

Cool. I have some tentative plans to do some more changes to hashmap
for improved API usability and performance, so you might need to pull
a few more patches in the near future.

> - Arnaldo
>
> ---
>
> To pick the changes in:
>
>   fba60b171a032283 ("libbpf: Use IS_ERR_OR_NULL() in hashmap__free()")
>
> That don't entail any changes in tools/perf.
>
> This addresses this perf build warning:
>
>   Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h'
>   diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h
>
> Not a kernel ABI, its just that this uses the mechanism in place for
> checking kernel ABI files drift.
>
> Cc: Andrii Nakryiko <andrii@kernel.org>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Mauricio Vásquez <mauricio@kinvolk.io>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  tools/perf/util/hashmap.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/hashmap.c b/tools/perf/util/hashmap.c
> index 3c20b126d60d869a..aeb09c2887162d16 100644
> --- a/tools/perf/util/hashmap.c
> +++ b/tools/perf/util/hashmap.c
> @@ -75,7 +75,7 @@ void hashmap__clear(struct hashmap *map)
>
>  void hashmap__free(struct hashmap *map)
>  {
> -       if (!map)
> +       if (IS_ERR_OR_NULL(map))
>                 return;
>
>         hashmap__clear(map);
> @@ -238,4 +238,3 @@ bool hashmap__delete(struct hashmap *map, const void *key,
>
>         return true;
>  }
> -
> --
> 2.35.1
>

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

end of thread, other threads:[~2022-03-29 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-29 14:46 [FYI PATCH 1/1] perf tools: Update copy of libbpf's hashmap.c Arnaldo Carvalho de Melo
2022-03-29 16:25 ` Andrii Nakryiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox