All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	"Steinar H. Gunderson" <sesse@google.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf probe: Improve C++ support in arguments
Date: Wed, 1 Apr 2026 16:23:18 -0700	[thread overview]
Message-ID: <ac2o5h9MBxpKr6ST@google.com> (raw)
In-Reply-To: <ac2J9BRFsmzdJo2J@x1>

On Wed, Apr 01, 2026 at 06:11:16PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Apr 01, 2026 at 02:03:42PM -0700, Ian Rogers wrote:
> > On Fri, Dec 5, 2025 at 4:36 AM Steinar H. Gunderson <sesse@google.com> wrote:
> > >
> > > For purposes of specifying arguments in tracepoints, C++ classes
> > > work exactly like structs, and C++ references work almost exactly
> > > like pointers (they are dereferenced with . instead of ->).
> > > However, they use different tags in DWARF, which means you cannot
> > > use them in arguments.
> > >
> > > Implement support for both, based on the existing struct and pointer
> > > support. This allows us to to something like this in Chromium:
> > >
> > >   perf probe --exec content_shell --add 'PerformanceMark=\
> > > _ZN5blink15PerformanceMark6CreateEPNS_11ScriptStateERKNS_12\
> > > AtomicStringEPNS_22PerformanceMarkOptionsERNS_14ExceptionStateE \
> > > mark_name.string_.impl_.ptr_'
> > >
> > > even though mark_name is an class AtomicString&.
> > >
> > > We don't support advanced C++ features, such as operator overloading.
> > > Unfortunately, we also don't support C++-style strings where there
> > > is a separate length field instead of null-termination. We also cannot
> > > go past ptr_ in the example above (e.g. add ->length_), due to
> > > unrelated DWARF issues.
> > >
> > > Signed-off-by: Steinar H. Gunderson <sesse@google.com>
> > > Cc: Ian Rogers <irogers@google.com>
> > 
> > This change makes sense to me, Namhyung?
> 
> Agreed, and there are some other C++ specific (Go as well), like
> DW_TAG_rvalue_reference_type, that we may want to support, also it would
> be great to have some extra workload in 'perf test -w' to have a shell
> testing this feature, no?

Yep, that would be great.  I'm ok with the change but it needs to be
updated.  Also I think we need a helper to check the compound types.

Thanks,
Namhyung


      reply	other threads:[~2026-04-01 23:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05 12:36 [PATCH] perf probe: Improve C++ support in arguments Steinar H. Gunderson
2026-04-01 21:03 ` Ian Rogers
2026-04-01 21:11   ` Arnaldo Carvalho de Melo
2026-04-01 23:23     ` Namhyung Kim [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=ac2o5h9MBxpKr6ST@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sesse@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.