All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yauheni Kaliuta <ykaliuta@redhat.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Yonghong Song <yhs@fb.com>, bpf <bpf@vger.kernel.org>,
	Artem Savkov <asavkov@redhat.com>,
	Viktor Malik <vmalik@redhat.com>,
	Jerome Marchand <jmarchan@redhat.com>
Subject: Re: sys_enter tracepoint ctx structure
Date: Fri, 21 Apr 2023 00:40:34 +0300	[thread overview]
Message-ID: <xunyfs8uz0z1.fsf@redhat.com> (raw)
In-Reply-To: <CAADnVQK-Dig-5DB6tM_sgggyvqHUXSbBud0R=rAPWT2VRtQ-ZQ@mail.gmail.com> (Alexei Starovoitov's message of "Thu, 20 Apr 2023 13:54:26 -0700")

Hi, Alexei!

>>>>> On Thu, 20 Apr 2023 13:54:26 -0700, Alexei Starovoitov  wrote:
 > On Thu, Apr 20, 2023 at 1:37 PM Yauheni Kaliuta <ykaliuta@redhat.com> wrote:
 >> >>>>> On Thu, 20 Apr 2023 08:59:09 -0700, Alexei Starovoitov  wrote:
 >> >>
 >> >> Should perf_call_bpf_enter/exit (kernel/trace/trace_syscalls.c)
 >> >> use struct trace_event_raw_sys_enter/exit instead of locally
 >> >> crafted struct syscall_tp_t nowadays?
 >> 
 >> 
 >> > No. It needs syscall_tp_t.
 >> 
 >> > test_progs's vmlinux test
 >> >> expects it as the context.
 >> >>
 >> 
 >> > what do you mean? Pls share a code pointer?
 >> 
 >> https://github.com/torvalds/linux/blob/master/tools/testing/selftests/bpf/progs/test_vmlinux.c#L19
 >> 
 >> SEC("tp/syscalls/sys_enter_nanosleep")
 >> int handle__tp(struct trace_event_raw_sys_enter *args)

 > I see. That bit is correct and that's what bpftrace is doing
 > when attaching to syscalls.
 > What do you see in your patched RT kernel when you do:
 > cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_nanosleep/format
 > ?
 > Depending on the answer we might need to fix
 > the kernel side that has to use struct trace_entry
 > in syscall_tp_t instead of plain long long.

 # cat /sys/kernel/debug/tracing/events/syscalls/sys_enter_nanosleep/format
name: sys_enter_nanosleep
ID: 374
format:
        field:unsigned short common_type;       offset:0;       size:2; signed:0;
        field:unsigned char common_flags;       offset:2;       size:1; signed:0;
        field:unsigned char common_preempt_count;       offset:3;       size:1; signed:0;
        field:int common_pid;   offset:4;       size:4; signed:1;
        field:unsigned char common_preempt_lazy_count;  offset:8;       size:1; signed:0;

        field:int __syscall_nr; offset:12;      size:4; signed:1;
        field:struct __kernel_timespec * rqtp;  offset:16;      size:8; signed:0;
        field:struct __kernel_timespec * rmtp;  offset:24;      size:8; signed:0;

print fmt: "rqtp: 0x%08lx, rmtp: 0x%08lx", ((unsigned long)(REC->rqtp)), ((unsigned long)(REC->rmtp))



-- 
WBR,
Yauheni Kaliuta


  reply	other threads:[~2023-04-20 21:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 13:50 sys_enter tracepoint ctx structure Yauheni Kaliuta
     [not found] ` <CAADnVQ+JdPGV95Y30PskgdOomU2K0UXsoCydgqaJfJ5j4S8BtQ@mail.gmail.com>
2023-04-20 16:02   ` Fwd: " Alexei Starovoitov
2023-04-20 20:37   ` Yauheni Kaliuta
2023-04-20 20:54     ` Alexei Starovoitov
2023-04-20 21:40       ` Yauheni Kaliuta [this message]
2023-04-20 23:12         ` Alexei Starovoitov
2023-04-21 11:17           ` Yauheni Kaliuta
2023-04-21 16:02             ` Alexei Starovoitov
2023-04-23  9:04               ` Yauheni Kaliuta
2023-04-23 16:15                 ` Alexei Starovoitov

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=xunyfs8uz0z1.fsf@redhat.com \
    --to=ykaliuta@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=asavkov@redhat.com \
    --cc=bpf@vger.kernel.org \
    --cc=jmarchan@redhat.com \
    --cc=vmalik@redhat.com \
    --cc=yhs@fb.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.