Linux Trace Kernel
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: "Максим Морсков" <xxxa0c@mail.ru>
Cc: Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>
Subject: Re: tprobe event tracing error
Date: Mon, 26 Feb 2024 23:41:56 +0900	[thread overview]
Message-ID: <20240226234156.c6c647f5c005977327fde62c@kernel.org> (raw)
In-Reply-To: <1708954589.808811792@f182.i.mail.ru>

Hi,
(Cc: linux-kernel-trace ML for sharing this knowledge)

On Mon, 26 Feb 2024 16:36:29 +0300
Максим Морсков <xxxa0c@mail.ru> wrote:

> 
> Hello, dear Masami.
> I am researching Linux event tracing subsystem in part of tprobes,
> and found interesting behavior in kernel version 6.6:
>  
> echo  't:my_fchmodat sys_enter_fchmodat' | sudo tee ‘/sys/kernel/tracing/dynamic_events’
> bash: line 1: echo: write error: Invalid argument

Yeah, I understand that you are confused by this behavior, but it is
actually expected behavior. syscalls:* events looks like trace events
based on tracepoint, but those are software generated trace event.

You can find raw_syscalls:* trace events, that is based on the tracepoint,
and other syscalls:* are based on that raw_syscalls:* trace points.
(IOW, those are a kind of pre-compiled dynamic events)

e.g.

/sys/kernel/tracing # echo "t sys_enter \$arg*" >> dynamic_events 
/sys/kernel/tracing # cat dynamic_events 
t:tracepoints/sys_enter sys_enter regs=regs id=id

/sys/kernel/tracing # echo "t sys_enter_open \$arg*" >> dynamic_events 
sh: write error: Invalid argument
/sys/kernel/tracing # cat error_log 
[  227.981347] trace_fprobe: error: Tracepoint is not found
  Command: t sys_enter_open $arg*
             ^

So, tprobe can not find the hard-coded tracepoints for those dynamically
generated syscall trace events. But raw_syscall sys_enter/sys_exit are OK.

Thank you,

>  
> sudo cat /sys/kernel/tracing/error_log
> trace_fprobe: error: Tracepoint is not found 
>  Command: t:my_fchmodat sys_enter_fchmodat
>                                                     ^
>  
> But such tracepoint ( sys_enter_fchmodat ) exists in system:
> sudo perf list | grep chmod   
>  syscalls:sys_enter_ chmod                           [Tracepoint event] 
>  syscalls:sys_enter_f chmod                          [Tracepoint event] 
>  syscalls:sys_enter_f chmod at                        [Tracepoint event] 
>  syscalls:sys_enter_f chmod at2                       [Tracepoint event] 
>  syscalls:sys_exit_ chmod                            [Tracepoint event] 
>  syscalls:sys_exit_f chmod                           [Tracepoint event] 
>  syscalls:sys_exit_f chmod at                         [Tracepoint event] 
>  syscalls:sys_exit_f chmod at2                        [Tracepoint event]
>  
> sudo ls -lha /sys/kernel/tracing/events/syscalls/ | grep chmod
> drwxr-xr-x 1 root root 0 фев 26 16:07 sys_enter_ chmod
> drwxr-xr-x 1 root root 0 фев 26 16:07 sys_enter_f chmod
> drwxr-xr-x 1 root root 0 фев 26 16:07 sys_enter_f chmod at 
> drwxr-xr-x 1 root root 0 фев 26 16:07 sys_enter_f chmod at2 
> drwxr-xr-x 1 root root 0 фев 26 16:07 sys_exit_ chmod
> drwxr-xr-x 1 root root 0 фев 26 16:07 sys_exit_f chmod
> drwxr-xr-x 1 root root 0 фев 26 16:07 sys_exit_f chmod at 
> drwxr-xr-x 1 root root 0 фев 26 16:07 sys_exit_f chmod at2
>  
> My kernel config in the attachment.
> I noticed that you are developing event tracing tprobe subsystem.
> May be you could explain such behavior?
> Thank you in advance!
>  
> --
> Best regards
> Maksim Morskov

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

       reply	other threads:[~2024-02-26 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1708954589.808811792@f182.i.mail.ru>
2024-02-26 14:41 ` Masami Hiramatsu [this message]
2024-02-26 17:14   ` tprobe event tracing error Steven Rostedt
     [not found]     ` <1709130340.286978721@f107.i.mail.ru>
2024-02-28 15:52       ` Steven Rostedt
2024-02-28 15:58         ` Steven Rostedt

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=20240226234156.c6c647f5c005977327fde62c@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=xxxa0c@mail.ru \
    /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