From: Jiri Olsa <jolsa@redhat•com>
To: Ian Rogers <irogers@google•com>
Cc: Peter Zijlstra <peterz@infradead•org>,
Ingo Molnar <mingo@redhat•com>,
Arnaldo Carvalho de Melo <acme@kernel•org>,
Mark Rutland <mark.rutland@arm•com>,
Alexander Shishkin <alexander.shishkin@linux•intel.com>,
Namhyung Kim <namhyung@kernel•org>,
Alexei Starovoitov <ast@kernel•org>,
Daniel Borkmann <daniel@iogearbox•net>,
Martin KaFai Lau <kafai@fb•com>, Song Liu <songliubraving@fb•com>,
Yonghong Song <yhs@fb•com>, Andrii Nakryiko <andriin@fb•com>,
John Fastabend <john.fastabend@gmail•com>,
KP Singh <kpsingh@chromium•org>, Kajol Jain <kjain@linux•ibm.com>,
Andi Kleen <ak@linux•intel.com>,
John Garry <john.garry@huawei•com>,
Jin Yao <yao.jin@linux•intel.com>,
Kan Liang <kan.liang@linux•intel.com>,
Cong Wang <xiyou.wangcong@gmail•com>,
Kim Phillips <kim.phillips@amd•com>,
Adrian Hunter <adrian.hunter@intel•com>,
Leo Yan <leo.yan@linaro•org>,
linux-kernel@vger•kernel.org, netdev@vger•kernel.org,
bpf@vger•kernel.org, Stephane Eranian <eranian@google•com>
Subject: Re: [PATCH v2 7/7] perf expr: Migrate expr ids table to a hashmap
Date: Sat, 16 May 2020 00:41:39 +0200 [thread overview]
Message-ID: <20200515224139.GB3577540@krava> (raw)
In-Reply-To: <20200515165007.217120-8-irogers@google.com>
On Fri, May 15, 2020 at 09:50:07AM -0700, Ian Rogers wrote:
SNIP
> diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c
> index 8b4ce704a68d..f64ab91c432b 100644
> --- a/tools/perf/util/expr.c
> +++ b/tools/perf/util/expr.c
> @@ -4,25 +4,76 @@
> #include "expr.h"
> #include "expr-bison.h"
> #include "expr-flex.h"
> +#include <linux/kernel.h>
>
> #ifdef PARSER_DEBUG
> extern int expr_debug;
> #endif
>
> +static size_t key_hash(const void *key, void *ctx __maybe_unused)
> +{
> + const char *str = (const char *)key;
> + size_t hash = 0;
> +
> + while (*str != '\0') {
> + hash *= 31;
> + hash += *str;
> + str++;
> + }
> + return hash;
> +}
> +
> +static bool key_equal(const void *key1, const void *key2,
> + void *ctx __maybe_unused)
> +{
> + return !strcmp((const char *)key1, (const char *)key2);
should that be strcasecmp ? would it affect the key_hash as well?
jirka
next prev parent reply other threads:[~2020-05-15 22:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-15 16:50 [PATCH v2 0/7] Copy hashmap to tools/perf/util, use in perf expr Ian Rogers
2020-05-15 16:50 ` [PATCH v2 1/7] libbpf: Fix memory leak and possible double-free in hashmap__clear Ian Rogers
2020-05-15 16:50 ` [PATCH v2 2/7] libbpf hashmap: Remove unused #include Ian Rogers
2020-05-15 19:39 ` Andrii Nakryiko
2020-05-15 16:50 ` [PATCH v2 3/7] libbpf hashmap: Fix signedness warnings Ian Rogers
2020-05-15 19:40 ` Andrii Nakryiko
2020-05-15 16:50 ` [PATCH v2 4/7] tools lib/api: Copy libbpf hashmap to tools/perf/util Ian Rogers
2020-05-15 19:41 ` Andrii Nakryiko
2020-05-15 16:50 ` [PATCH v2 5/7] perf test: Provide a subtest callback to ask for the reason for skipping a subtest Ian Rogers
2020-05-15 16:50 ` [PATCH v2 6/7] perf test: Improve pmu event metric testing Ian Rogers
2020-05-15 16:50 ` [PATCH v2 7/7] perf expr: Migrate expr ids table to a hashmap Ian Rogers
2020-05-15 19:39 ` Andrii Nakryiko
2020-05-15 22:03 ` Ian Rogers
2020-05-15 19:41 ` Jiri Olsa
2020-05-15 21:35 ` Ian Rogers
2020-05-15 22:41 ` Jiri Olsa
2020-05-15 22:41 ` Jiri Olsa [this message]
2020-05-15 22:59 ` Ian Rogers
2020-05-15 17:00 ` [PATCH v2 0/7] Copy hashmap to tools/perf/util, use in perf expr Arnaldo Carvalho de Melo
2020-05-15 19:42 ` Andrii Nakryiko
2020-05-15 21:18 ` arnaldo.melo
2020-05-15 21:47 ` Ian Rogers
2020-05-15 23:09 ` Daniel Borkmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200515224139.GB3577540@krava \
--to=jolsa@redhat$(echo .)com \
--cc=acme@kernel$(echo .)org \
--cc=adrian.hunter@intel$(echo .)com \
--cc=ak@linux$(echo .)intel.com \
--cc=alexander.shishkin@linux$(echo .)intel.com \
--cc=andriin@fb$(echo .)com \
--cc=ast@kernel$(echo .)org \
--cc=bpf@vger$(echo .)kernel.org \
--cc=daniel@iogearbox$(echo .)net \
--cc=eranian@google$(echo .)com \
--cc=irogers@google$(echo .)com \
--cc=john.fastabend@gmail$(echo .)com \
--cc=john.garry@huawei$(echo .)com \
--cc=kafai@fb$(echo .)com \
--cc=kan.liang@linux$(echo .)intel.com \
--cc=kim.phillips@amd$(echo .)com \
--cc=kjain@linux$(echo .)ibm.com \
--cc=kpsingh@chromium$(echo .)org \
--cc=leo.yan@linaro$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=mark.rutland@arm$(echo .)com \
--cc=mingo@redhat$(echo .)com \
--cc=namhyung@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=peterz@infradead$(echo .)org \
--cc=songliubraving@fb$(echo .)com \
--cc=xiyou.wangcong@gmail$(echo .)com \
--cc=yao.jin@linux$(echo .)intel.com \
--cc=yhs@fb$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox