From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6869CC77B76 for ; Sun, 23 Apr 2023 09:05:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbjDWJFd (ORCPT ); Sun, 23 Apr 2023 05:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjDWJFc (ORCPT ); Sun, 23 Apr 2023 05:05:32 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECAAF171B for ; Sun, 23 Apr 2023 02:04:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682240684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3TXGg3hQ04PmG79s7294A+LB9+PdXN6D+hDAMvjCPsE=; b=FMBe3UBee1b25ypV8eqK19nFMw+27ZC2GgJHPxBUBL5uxzD+k+dGIVfKAMYnoXkzp7iRM4 iOQV6pC2AVVfPXyaB0FX82q87Y6kRBmYbQLK6+S/P2yF6ZdXZ5xA7mazQ4uq58jHoKoBND CEavM/82zPSnDQ5obxIl+LmlXUOcnw8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-611-_dkSWrPKNsCmCjakLL4B7g-1; Sun, 23 Apr 2023 05:04:43 -0400 X-MC-Unique: _dkSWrPKNsCmCjakLL4B7g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F0B501C05AB7; Sun, 23 Apr 2023 09:04:42 +0000 (UTC) Received: from astarta.redhat.com (unknown [10.39.192.158]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7C2D1121318; Sun, 23 Apr 2023 09:04:41 +0000 (UTC) From: Yauheni Kaliuta To: Alexei Starovoitov Cc: Yonghong Song , bpf , Artem Savkov , Viktor Malik , Jerome Marchand Subject: Re: sys_enter tracepoint ctx structure References: Date: Sun, 23 Apr 2023 12:04:40 +0300 In-Reply-To: (Alexei Starovoitov's message of "Fri, 21 Apr 2023 09:02:34 -0700") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Hi, Alexei! >>>>> On Fri, 21 Apr 2023 09:02:34 -0700, Alexei Starovoitov wrote: > On Fri, Apr 21, 2023 at 4:17=E2=80=AFAM Yauheni Kaliuta wrote: >> >>>>> On Thu, 20 Apr 2023 16:12:49 -0700, Alexei Starovoitov wrote: >> > On Thu, Apr 20, 2023 at 2:40=E2=80=AFPM Yauheni Kaliuta wrote: >> >> >>>>> On Thu, 20 Apr 2023 13:54:26 -0700, Alexei Starovoitov wrote: >> >> > On Thu, Apr 20, 2023 at 1:37=E2=80=AFPM Yauheni Kaliuta wrote: >> >> >> >>>>> On Thu, 20 Apr 2023 08:59:09 -0700, Alexei Starovoitov wro= te: [...] >> > Let's fix the kernel side too. Something like this should do it: >>=20 >> > diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_sysca= lls.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; >>=20 >>=20 >> > pls add build_bug_on that sizeof(ent) >=3D sizeof(void*). >>=20 >> Ok. Should the line *(struct pt_regs **)¶m =3D regs; be commented s= omehow? > 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. --=20 WBR, Yauheni Kaliuta