[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <172909876148.288721.10451526265503632803.b4-ty@kernel.org>
Date: Wed, 16 Oct 2024 10:12:41 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ian Rogers <irogers@...gle.com>, Kan Liang <kan.liang@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>
Cc: Jiri Olsa <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>,
Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, linux-perf-users@...r.kernel.org,
bpf@...r.kernel.org
Subject: Re: [PATCH 1/2] perf tools: Fix possible compiler warnings in
hashmap
On Wed, 09 Oct 2024 13:20:08 -0700, Namhyung Kim wrote:
> The hashmap__for_each_entry[_safe] is accessing 'map' as if it's a
> pointer. But it does without parentheses so passing a static hash map
> with an ampersand (like &slab_hash below) caused compiler warnings due
> to unmatched types.
>
> In file included from util/bpf_lock_contention.c:5:
> util/bpf_lock_contention.c: In function ‘exit_slab_cache_iter’:
> linux/tools/perf/util/hashmap.h:169:32: error: invalid type argument of ‘->’ (have ‘struct hashmap’)
> 169 | for (bkt = 0; bkt < map->cap; bkt++) \
> | ^~
> util/bpf_lock_contention.c:105:9: note: in expansion of macro ‘hashmap__for_each_entry’
> 105 | hashmap__for_each_entry(&slab_hash, cur, bkt)
> | ^~~~~~~~~~~~~~~~~~~~~~~
> /home/namhyung/project/linux/tools/perf/util/hashmap.h:170:31: error: invalid type argument of ‘->’ (have ‘struct hashmap’)
> 170 | for (cur = map->buckets[bkt]; cur; cur = cur->next)
> | ^~
> util/bpf_lock_contention.c:105:9: note: in expansion of macro ‘hashmap__for_each_entry’
> 105 | hashmap__for_each_entry(&slab_hash, cur, bkt)
> | ^~~~~~~~~~~~~~~~~~~~~~~
>
> [...]
Applied to perf-tools-next, thanks!
Best regards,
Namhyung
Powered by blists - more mailing lists