[PATCH v1 0/3] perf probe: Support long symbol

Leo Yan posted 3 patches 1 month, 3 weeks ago
tools/perf/util/probe-event.c | 71 ++++++++++++++++++++++++++++++++---
1 file changed, 65 insertions(+), 6 deletions(-)
[PATCH v1 0/3] perf probe: Support long symbol
Posted by Leo Yan 1 month, 3 weeks ago
Currently, a probe supports event name maximum to a 64-byte length. The
event name comes from the probed symbol name, otherwise, user can
specify an event name.

In the case when user tries to inject a probe for a long symbol, e.g.
mangled symbol name in a C++ program, the kernel buffer cannot
accommodate it if the symbol name is longer than 64 bytes.

On the other hand, this series relies on the perf tool to resolve the
issue. When the tool detects user doesn't specify event name and the
probed symbol is longer than 64 bytes, it will generate a hashed event
name with 64-byte length to avoid failure.


Leo Yan (3):
  perf: Dynamically allocate buffer for event string
  perf probe: Check group string length
  perf probe: Generate hash event for long symbol

 tools/perf/util/probe-event.c | 71 ++++++++++++++++++++++++++++++++---
 1 file changed, 65 insertions(+), 6 deletions(-)

-- 
2.34.1
Re: [PATCH v1 0/3] perf probe: Support long symbol
Posted by Namhyung Kim 1 month, 2 weeks ago
Hello Leo,

On Mon, Oct 07, 2024 at 03:11:13PM +0100, Leo Yan wrote:
> Currently, a probe supports event name maximum to a 64-byte length. The
> event name comes from the probed symbol name, otherwise, user can
> specify an event name.
> 
> In the case when user tries to inject a probe for a long symbol, e.g.
> mangled symbol name in a C++ program, the kernel buffer cannot
> accommodate it if the symbol name is longer than 64 bytes.
> 
> On the other hand, this series relies on the perf tool to resolve the
> issue. When the tool detects user doesn't specify event name and the
> probed symbol is longer than 64 bytes, it will generate a hashed event
> name with 64-byte length to avoid failure.

Please CC Masami for probe related changes in the future.

Thanks,
Namhyung

> 
> 
> Leo Yan (3):
>   perf: Dynamically allocate buffer for event string
>   perf probe: Check group string length
>   perf probe: Generate hash event for long symbol
> 
>  tools/perf/util/probe-event.c | 71 ++++++++++++++++++++++++++++++++---
>  1 file changed, 65 insertions(+), 6 deletions(-)
> 
> -- 
> 2.34.1
>
Re: [PATCH v1 0/3] perf probe: Support long symbol
Posted by Masami Hiramatsu (Google) 1 month, 2 weeks ago
On Wed, 9 Oct 2024 18:12:52 -0700
Namhyung Kim <namhyung@kernel.org> wrote:

> Hello Leo,
> 
> On Mon, Oct 07, 2024 at 03:11:13PM +0100, Leo Yan wrote:
> > Currently, a probe supports event name maximum to a 64-byte length. The
> > event name comes from the probed symbol name, otherwise, user can
> > specify an event name.
> > 
> > In the case when user tries to inject a probe for a long symbol, e.g.
> > mangled symbol name in a C++ program, the kernel buffer cannot
> > accommodate it if the symbol name is longer than 64 bytes.
> > 
> > On the other hand, this series relies on the perf tool to resolve the
> > issue. When the tool detects user doesn't specify event name and the
> > probed symbol is longer than 64 bytes, it will generate a hashed event
> > name with 64-byte length to avoid failure.
> 
> Please CC Masami for probe related changes in the future.

Thanks Namhyung,

Let me find the patches.

> 
> Thanks,
> Namhyung
> 
> > 
> > 
> > Leo Yan (3):
> >   perf: Dynamically allocate buffer for event string
> >   perf probe: Check group string length
> >   perf probe: Generate hash event for long symbol
> > 
> >  tools/perf/util/probe-event.c | 71 ++++++++++++++++++++++++++++++++---
> >  1 file changed, 65 insertions(+), 6 deletions(-)
> > 
> > -- 
> > 2.34.1
> > 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>