From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
LKML <linux-kernel@vger.kernel.org>,
Stephane Eranian <eranian@google.com>,
Ian Rogers <irogers@google.com>
Subject: [PATCHSET v3 0/6] perf inject: Speed build-id injection
Date: Mon, 28 Sep 2020 16:52:40 +0900 [thread overview]
Message-ID: <20200928075246.853729-1-namhyung@kernel.org> (raw)
Hello,
This is the new version of speed up build-id injection. As this is
to improve performance, I've added a benchmark for it. Please look at
the usage in the first commit.
By default, it measures average processing time of 100 MMAP2 events
and 10000 SAMPLE events. Below is the current result on my laptop.
$ perf bench internals inject-build-id
# Running 'internals/inject-build-id' benchmark:
Average build-id injection took: 23.885 msec (+- 0.114 msec)
Average time per event: 2.342 usec (+- 0.011 usec)
Average memory usage: 7864 KB (+- 10 KB)
With this patchset applied, it got this:
$ perf bench internals inject-build-id
# Running 'internals/inject-build-id' benchmark:
Average build-id injection took: 18.182 msec (+- 0.126 msec)
Average time per event: 1.783 usec (+- 0.012 usec)
Average memory usage: 7334 KB (+- 6 KB)
Average build-id-all injection took: 17.520 msec (+- 0.046 msec)
Average time per event: 1.718 usec (+- 0.005 usec)
Average memory usage: 7418 KB (+- 2 KB)
Real usecases might be different as it depends on the number of
mmap/sample events as well as how many DSOs are actually hit.
The benchmark result now includes memory footprint in terms of maximum
RSS. Also I've fixed a bug in the benchmark code not to read all the
required bytes and return early. With that, sadly, some speedup in
the build-id-all injection was gone, but it's still slightly faster
while uses more memory.
In addition, I dropped the last patch for now which changes build-id
handling when -b option is not used. As this can impact build-id-all
performance, I'll think about it more and come up with something later.
This code is available at 'perf/inject-speedup-v3' branch on
git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git
Changes from v2:
- fix benchmark to read required data
- add Acked-by from Jiri and Ian
- pass map flag to check huge pages (Jiri)
- add comments on some functions (Ian)
- show memory (max-RSS) usage in the benchmark (Ian)
- drop build-id marking patch at the last (Adrian)
Namhyung Kim (6):
perf bench: Add build-id injection benchmark
perf inject: Add missing callbacks in perf_tool
perf inject: Enter namespace when reading build-id
perf inject: Do not load map/dso when injecting build-id
perf inject: Add --buildid-all option
perf bench: Run inject-build-id with --buildid-all option too
tools/perf/Documentation/perf-inject.txt | 6 +-
tools/perf/bench/Build | 1 +
tools/perf/bench/bench.h | 1 +
tools/perf/bench/inject-buildid.c | 457 +++++++++++++++++++++++
tools/perf/builtin-bench.c | 1 +
tools/perf/builtin-inject.c | 199 ++++++++--
tools/perf/util/build-id.h | 4 +
tools/perf/util/map.c | 17 +-
tools/perf/util/map.h | 14 +
9 files changed, 645 insertions(+), 55 deletions(-)
create mode 100644 tools/perf/bench/inject-buildid.c
--
2.28.0.681.g6f77f65b4e-goog
next reply other threads:[~2020-09-28 7:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 7:52 Namhyung Kim [this message]
2020-09-28 7:52 ` [PATCH 1/6] perf bench: Add build-id injection benchmark Namhyung Kim
2020-09-29 15:40 ` Namhyung Kim
2020-09-28 7:52 ` [PATCH 2/6] perf inject: Add missing callbacks in perf_tool Namhyung Kim
2020-09-28 7:52 ` [PATCH 3/6] perf inject: Enter namespace when reading build-id Namhyung Kim
2020-09-28 7:52 ` [PATCH 4/6] perf inject: Do not load map/dso when injecting build-id Namhyung Kim
2020-09-28 7:52 ` [PATCH 5/6] perf inject: Add --buildid-all option Namhyung Kim
2020-09-28 7:52 ` [PATCH 6/6] perf bench: Run inject-build-id with --buildid-all option too Namhyung Kim
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=20200928075246.853729-1-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®