[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200515065624.21658-1-irogers@google.com>
Date: Thu, 14 May 2020 23:56:16 -0700
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...omium.org>,
Kajol Jain <kjain@...ux.ibm.com>,
Andi Kleen <ak@...ux.intel.com>,
John Garry <john.garry@...wei.com>,
Jin Yao <yao.jin@...ux.intel.com>,
Kan Liang <kan.liang@...ux.intel.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Kim Phillips <kim.phillips@....com>,
Adrian Hunter <adrian.hunter@...el.com>,
Leo Yan <leo.yan@...aro.org>, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, bpf@...r.kernel.org
Cc: Stephane Eranian <eranian@...gle.com>,
Ian Rogers <irogers@...gle.com>
Subject: [PATCH 0/8] Copy hashmap to libapi, use in perf expr
Perf's expr code currently builds an array of strings then removes
duplicates. The array is larger than necessary and has recently been
increased in size. When this was done it was commented that a hashmap
would be preferable.
libbpf has a hashmap but libbpf isn't currently required to build
perf. To satisfy various concerns this change copies libbpf's hashmap
into libapi, it then adds a check in perf that the two are in sync.
Andrii's patch to hashmap from bpf-next is brought into this set to
fix issues with hashmap__clear.
Three minor changes to libbpf's hashmap are made that remove an unused
dependency, fix a compiler warning and make sure the hashmap isn't
part of the symbols in a static build of libbpf (dsos are handled by
the existing version script).
Two perf test are also brought in as they need refactoring to account
for the expr API change and it is expected they will land aheadof
this.
https://lore.kernel.org/lkml/20200513062236.854-2-irogers@google.com/
Tested with 'perf test' and make -C tools/perf build-test.
The hashmap change was originally part of an RFC:
https://lore.kernel.org/lkml/20200508053629.210324-1-irogers@google.com/
Andrii Nakryiko (1):
libbpf: Fix memory leak and possible double-free in hashmap__clear
Ian Rogers (7):
libbpf hashmap: Remove unused #include
libbpf hashmap: Fix signedness warnings
libbpf hashmap: Localize static hashmap__* symbols
tools lib/api: Copy libbpf hashmap to libapi
perf test: Provide a subtest callback to ask for the reason for
skipping a subtest
perf test: Improve pmu event metric testing
perf expr: Migrate expr ids table to a hashmap
tools/lib/api/Build | 1 +
tools/lib/api/hashmap.c | 238 ++++++++++++++++++++++++++++++++
tools/lib/api/hashmap.h | 177 ++++++++++++++++++++++++
tools/lib/bpf/Makefile | 2 +
tools/lib/bpf/hashmap.c | 10 +-
tools/lib/bpf/hashmap.h | 1 -
tools/perf/check-headers.sh | 4 +
tools/perf/tests/builtin-test.c | 18 ++-
tools/perf/tests/expr.c | 40 +++---
tools/perf/tests/pmu-events.c | 169 ++++++++++++++++++++++-
tools/perf/tests/tests.h | 4 +
tools/perf/util/expr.c | 129 +++++++++--------
tools/perf/util/expr.h | 22 ++-
tools/perf/util/expr.y | 22 +--
tools/perf/util/metricgroup.c | 87 ++++++------
tools/perf/util/stat-shadow.c | 49 ++++---
16 files changed, 793 insertions(+), 180 deletions(-)
create mode 100644 tools/lib/api/hashmap.c
create mode 100644 tools/lib/api/hashmap.h
--
2.26.2.761.g0e0b3e54be-goog
Powered by blists - more mailing lists