mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Brennan <stephen.s.brennan@oracle.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>,
	linux-perf-users@vger.kernel.org, Ian Rogers <irogers@google.com>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-kernel@vger.kernel.org,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>
Subject: Re: [PATCH] tools: perf: allow opt-in "no-dso." files in /dev/shm
Date: Tue, 03 Nov 2026 08:46:13 -0800	[thread overview]
Message-ID: <87zevpq2wa.fsf@oracle.com> (raw)
In-Reply-To: <20261013213842.1870582-1-stephen.s.brennan@oracle.com>

Hello,

A friendly ping on this patch. I know it's a bit niche but it would
resolve some real user issues with how perf handles POSIX shared memory
regions.

Thanks,
Stephen

Stephen Brennan <stephen.s.brennan@oracle.com> writes:
> Applications can place JIT-compiled code in POSIX shared memory so that
> multiple processes can execute the same code. On Linux, these shared
> memory objects appear as file mappings under /dev/shm.
>
> Perf uses /tmp/perf-$pid.map to resolve symbols for executable SysV
> shared memory mappings, but it treats /dev/shm mappings as ordinary
> DSOs. As a result, applications which provide perf-map symbols for JIT
> code in POSIX shared memory don't get those symbols resolved, while they
> do with SysV shared memory.
>
> It would be incorrect to classify every /dev/shm mapping as no-DSO
> memory though, because /dev/shm is just a tmpfs mount, and it can
> contain ELF files.
>
> Add a filename prefix "/dev/shm/no-dso." which is recognized by
> is_no_dso_memory(). Applications can opt-in by naming their shared
> memory objects "no-dso.<name>". Executable mappings with this prefix
> will use the perf-map file, while other /dev/shm mappings will keep the
> existing behavior. This allows applications that already emit perf maps
> to use POSIX shared memory for JIT code, without needing to implement
> jitdump support.
>
> Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
> ---
>  tools/perf/util/map.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
> index fb0279810ae99..c2e31be232c88 100644
> --- a/tools/perf/util/map.h
> +++ b/tools/perf/util/map.h
> @@ -258,6 +258,8 @@ static inline int is_no_dso_memory(const char *filename)
>  {
>  	return !strncmp(filename, "[stack", 6) ||
>  	       !strncmp(filename, "/SYSV", 5)  ||
> +	       !strncmp(filename, "/dev/shm/no-dso.",
> +	                sizeof("/dev/shm/no-dso.") - 1) ||
>  	       !strcmp(filename, "[heap]");
>  }
>  
> -- 
> 2.52.0

      reply	other threads:[~2026-11-03 16:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 21:38 Stephen Brennan
2026-11-03 16:46 ` Stephen Brennan [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=87zevpq2wa.fsf@oracle.com \
    --to=stephen.s.brennan@oracle.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --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 \
    /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®