linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	 Mark Rutland <mark.rutland@arm.com>,
	 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,  Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	 Kan Liang <kan.liang@linux.intel.com>,
	Colin Ian King <colin.i.king@gmail.com>,
	 Casey Chen <cachen@purestorage.com>,
	Anne Macedo <retpolanne@posteo.net>,
	 Sun Haiyong <sunhaiyong@loongson.cn>,
	linux-perf-users@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/4] perf inject improvements
Date: Mon,  9 Sep 2024 13:37:36 -0700	[thread overview]
Message-ID: <20240909203740.143492-1-irogers@google.com> (raw)

Fix the existing build id injection by adding sample IDs on to the
synthesized events. This correctly orders the events and addresses
issues such as a profiled executable being replaced during its
execution.

Add a new --mmap2-buildid-all option that rewrites all mmap events as
mmap2 events containing build IDs. This removes the need for build_id
events.

Add a new -B option that like --mmap2-buildid-all synthesizes mmap2
with build id events. With -B the behavior is to do it lazily, so only
when a sample references the particular map. With system wide
profiling that synthesizes mmap events for all running processes the
perf.data file savings can be greater than 50%.

Reduce the memory footprint of perf inject by avoiding creating
symbols in the callchain, the symbols aren't used during perf inject
and necessitate the loading of dsos.

v2: Rename dso__inject* functions to tool__inject* addressing feedback
    from Arnaldo and a suggestion from Namhyung that the name should
    reflect the first argument's type. Rebase, in particular over the
    perf inject pipe mode fixes. Add Namhyung's acked-by.

Ian Rogers (4):
  perf inject: Fix build ID injection
  perf inject: Add new mmap2-buildid-all option
  perf inject: Lazy build-id mmap2 event insertion
  perf callchain: Allow symbols to be optional when resolving a
    callchain

 tools/perf/builtin-inject.c         | 304 +++++++++++++++++++++++-----
 tools/perf/tests/shell/pipe_test.sh |   2 +
 tools/perf/util/build-id.c          |   6 +-
 tools/perf/util/callchain.c         |   8 +-
 tools/perf/util/callchain.h         |   2 +-
 tools/perf/util/machine.c           |  92 +++++----
 tools/perf/util/machine.h           |  33 ++-
 tools/perf/util/map.c               |   1 +
 tools/perf/util/map.h               |  11 +
 tools/perf/util/synthetic-events.c  | 101 +++++++--
 tools/perf/util/synthetic-events.h  |  21 +-
 11 files changed, 468 insertions(+), 113 deletions(-)

-- 
2.46.0.598.g6f2099f65c-goog


             reply	other threads:[~2024-09-09 20:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-09 20:37 Ian Rogers [this message]
2024-09-09 20:37 ` [PATCH v2 1/4] perf inject: Fix build ID injection Ian Rogers
2024-09-09 20:37 ` [PATCH v2 2/4] perf inject: Add new mmap2-buildid-all option Ian Rogers
2024-09-09 20:37 ` [PATCH v2 3/4] perf inject: Lazy build-id mmap2 event insertion Ian Rogers
2024-09-09 20:37 ` [PATCH v2 4/4] perf callchain: Allow symbols to be optional when resolving a callchain Ian Rogers
2024-09-10 14:55 ` [PATCH v2 0/4] perf inject improvements Arnaldo Carvalho de Melo

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=20240909203740.143492-1-irogers@google.com \
    --to=irogers@google.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=cachen@purestorage.com \
    --cc=colin.i.king@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=retpolanne@posteo.net \
    --cc=sunhaiyong@loongson.cn \
    /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;
as well as URLs for NNTP newsgroup(s).