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: Sun, 23 Apr 2023 12:04:40 +0300 [thread overview]
Message-ID: <xunybkjfyno7.fsf@redhat.com> (raw)
In-Reply-To: <CAADnVQKGrSvJHXbsqzEF=QSuePF5KzGUKeC_HWsY56bTTSRWMw@mail.gmail.com> (Alexei Starovoitov's message of "Fri, 21 Apr 2023 09:02:34 -0700")
Hi, Alexei!
>>>>> On Fri, 21 Apr 2023 09:02:34 -0700, Alexei Starovoitov wrote:
> On Fri, Apr 21, 2023 at 4:17 AM Yauheni Kaliuta <ykaliuta@redhat.com> wrote:
>> >>>>> On Thu, 20 Apr 2023 16:12:49 -0700, Alexei Starovoitov wrote:
>> > On Thu, Apr 20, 2023 at 2:40 PM Yauheni Kaliuta <ykaliuta@redhat.com> wrote:
>> >> >>>>> 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:
[...]
>> > Let's fix the kernel side too. Something like this should do it:
>>
>> > diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
>> > index 942ddbdace4a..7aa1f4299486 100644
>> > --- a/kernel/trace/trace_syscalls.c
>> > +++ b/kernel/trace/trace_syscalls.c
>> > @@ -555,7 +555,7 @@ static int perf_call_bpf_enter(struct
>> > trace_event_call *call, struct pt_regs *re
>> > struct syscall_trace_enter *rec)
>> > {
>> > struct syscall_tp_t {
>> > - unsigned long long regs;
>> > + struct trace_entry ent;
>> > unsigned long syscall_nr;
>> > unsigned long args[SYSCALL_DEFINE_MAXARGS];
>> > } param;
>> > @@ -657,7 +657,7 @@ static int perf_call_bpf_exit(struct
>> > trace_event_call *call, struct pt_regs *reg
>> > struct syscall_trace_exit *rec)
>> > {
>> > struct syscall_tp_t {
>> > - unsigned long long regs;
>> > + struct trace_entry ent;
>>
>>
>> > pls add build_bug_on that sizeof(ent) >= sizeof(void*).
>>
>> Ok. Should the line *(struct pt_regs **)¶m = regs; be commented somehow?
> commented out?
No, no :)
> No. It's mandatory.
> And the reason for build_bug_on existence... to make sure that there
> is enough space there.
Yes, it's clear for sure.
It can be not obvious why basically 'ent' is inited with
'regs'. Before it was called 'regs' at least.
--
WBR,
Yauheni Kaliuta
next prev parent reply other threads:[~2023-04-23 9:05 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
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 [this message]
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=xunybkjfyno7.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox