public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>, 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: Re: [PATCHSET v4 0/6] perf inject: Speed build-id injection
Date: Tue, 13 Oct 2020 09:11:54 -0300	[thread overview]
Message-ID: <20201013121154.GA560293@kernel.org> (raw)
In-Reply-To: <20201012070214.2074921-1-namhyung@kernel.org>

Em Mon, Oct 12, 2020 at 04:02:08PM +0900, Namhyung Kim escreveu:
> 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: 25.789 msec (+- 0.202 msec)
>     Average time per event: 2.528 usec (+- 0.020 usec)
>     Average memory usage: 8411 KB (+- 7 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: 20.838 msec (+- 0.093 msec)
>     Average time per event: 2.043 usec (+- 0.009 usec)
>     Average memory usage: 8261 KB (+- 0 KB)
>     Average build-id-all injection took: 19.361 msec (+- 0.118 msec)
>     Average time per event: 1.898 usec (+- 0.012 usec)
>     Average memory usage: 7440 KB (+- 0 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 update the benchmark code to use timestamp so that it
> can be queued to the ordered_events (and flushed at the end).  It's
> also important how well it sorts the input events in the queue so I
> randomly chose a timestamp at the beginning of each MMAP event
> injection to resemble actual behavior.
> 
> As I said in other thread, perf inject currently doesn't flush the
> input events and processes all at the end.  This gives a good speedup
> but spends more memory (in proprotion to the input size).  While the
> build-id-all injection bypasses the queue so it uses less memory as
> well as faster processing.  The downside is that it'll mark all DSOs
> as hit so later processing steps (like perf report) likely handle them
> unnecessarily.

Thanks, tested and applied, first patchkit I process using that b4 tool,
cool!

- Arnaldo
 
> 
> This code is available at 'perf/inject-speedup-v4' branch on
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git
> 
> 
> Changes from v3:
>  - add timestamp to the synthesized events in the benchmark
>  - add a separate thread to read pipe in the benchmark
> 
> 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
> 
> 
> *** BLURB HERE ***
> 
> 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        | 476 +++++++++++++++++++++++
>  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, 664 insertions(+), 55 deletions(-)
>  create mode 100644 tools/perf/bench/inject-buildid.c
> 
> -- 
> 2.28.0.1011.ga647a8990f-goog
> 

-- 

- Arnaldo

      parent reply	other threads:[~2020-10-13 12:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12  7:02 [PATCHSET v4 0/6] perf inject: Speed build-id injection Namhyung Kim
2020-10-12  7:02 ` [PATCH 1/6] perf bench: Add build-id injection benchmark Namhyung Kim
2020-10-12  7:02 ` [PATCH 2/6] perf inject: Add missing callbacks in perf_tool Namhyung Kim
2020-10-12  7:02 ` [PATCH 3/6] perf inject: Enter namespace when reading build-id Namhyung Kim
2020-10-12  7:02 ` [PATCH 4/6] perf inject: Do not load map/dso when injecting build-id Namhyung Kim
2020-10-12  7:02 ` [PATCH 5/6] perf inject: Add --buildid-all option Namhyung Kim
2020-10-12  7:02 ` [PATCH 6/6] perf bench: Run inject-build-id with --buildid-all option too Namhyung Kim
2020-10-13 12:11 ` Arnaldo Carvalho de Melo [this message]

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=20201013121154.GA560293@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --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 \
    --cc=namhyung@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