From patchwork Tue Feb 7 05:51:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Tao X-Patchwork-Id: 53700 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2669598wrn; Mon, 6 Feb 2023 21:56:15 -0800 (PST) X-Google-Smtp-Source: AK7set+NHN5dVtp2kYDvCDGLyZziWoqmYi0i0WkjlU/kfms8aeFvBdNH765gIDNKFIXgmzMKL7kK X-Received: by 2002:a17:907:7f8c:b0:861:7a02:1046 with SMTP id qk12-20020a1709077f8c00b008617a021046mr2813058ejc.37.1675749375796; Mon, 06 Feb 2023 21:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675749375; cv=none; d=google.com; s=arc-20160816; b=ZS8LF3WigIZz1SvriGErHsKinpog3ZqLEVugX6WwQWI1Vw63Yc8KHUf4CIqMXowdzO f4ra6/ilfTOqaq/FaETZyOfSxDJWzDR9W7ehBVJM1P7gGCPIhXeO9qK7crLrVbBfKrO8 EK5Y/RtniWG+MjQ/553lqypY8KP8io/jH82XP7XTcA78RCV4V2C/XzpeHMmB9GAfwPKr t3hxLHRc2A1hRydWzxf+dQUzsVsuuhd50EQ+IQYty9zBFepiamQkYVTEtvFVvx0nEFv/ h8IeRk2UYsidiqhYrNnbfyaRoDVW62OGb8a8oKlQ1WrrJJ+stPJcQxjqEGOdTS5pHimc oKug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :subject:cc:to:from:message-id:dkim-signature; bh=Uu61Vvpzjinsk/7u3/2Vpkwh2/C9o/qwdZRPl3mAju0=; b=bK2YkWTuSq0mHmY/dD8gEKEFP0jN+hXbS1Gpkh9oB7cOezJq3Tpp4GNleE///FATit A/IawFyFO2SD4xLWghJLzD1YYBlrw2hFqPuMJatVBCtZY78tLCzB1QHq5sxIzvckL2FO TwxVanFnjysoJiogFl7PL6fVe+n9z8a0bYqOQboTs5+syDEIN4gzG54XMjK8TPrp2Q4z yPK/EyQPhWQexg6rrT6rxF+RSllShkbtNqS/CNLZ5eYpfEbMjt1dLWmZrU/GTBLewq2z +fRao00/chvA0xwCVwWUFWOsxaeBIeEgJriW16+IPABqxCq7vfGFIl5cpjtDUmZZHThz YuSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b="k/28aNCZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ma25-20020a1709079f1900b0089dcdd2c208si6866900ejc.921.2023.02.06.21.55.52; Mon, 06 Feb 2023 21:56:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b="k/28aNCZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbjBGFv4 (ORCPT + 99 others); Tue, 7 Feb 2023 00:51:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbjBGFvx (ORCPT ); Tue, 7 Feb 2023 00:51:53 -0500 Received: from out203-205-221-240.mail.qq.com (out203-205-221-240.mail.qq.com [203.205.221.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC8E24688; Mon, 6 Feb 2023 21:51:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1675749108; bh=Uu61Vvpzjinsk/7u3/2Vpkwh2/C9o/qwdZRPl3mAju0=; h=From:To:Cc:Subject:Date; b=k/28aNCZ1pbZo/hziwCSRJIUND6/wtWkgTZYt8y5Wne7zhTcGIoThOXThT2CDHtZH dHv9efK4tz5Tm+sywDdTuRknyrWMJgENIiPcVxhYGcQNzm/CPbBjm2A+4SbOCN2xAT KZEBQD2rm16AOwxjfEwkCBoUp66A71If3znTu0t0= Received: from localhost.localdomain ([39.156.73.13]) by newxmesmtplogicsvrszc1-0.qq.com (NewEsmtp) with SMTP id CECA622A; Tue, 07 Feb 2023 13:51:44 +0800 X-QQ-mid: xmsmtpt1675749104t5lb8r96s Message-ID: X-QQ-XMAILINFO: MfWa+adQHcqu+8EeLx0JfjUibiXx6BH1nky7gewpqUpbCit5tXLw7ZM97tuebC JDsGBtRhHUZn+vAw8CVyztAWNOusoMiJECiPyTf7q+kiP6GJaC8qkxEO2cGrzxTswH208L179I4j lLls9pAM6hCJwnBPsgVNKmqQqP1CJfHKiySD0UEe9YNBizMxY9d9E2IAUqLm8DiBEVv96M2h+AqF o2r6K4ip7RZTdLUQS9liHjTCxGDv+c/X1ESN0EU9jtAVSa+Cp9cdEteAr74YafNbFrZQSyotfFIF Ied0z+S9YRPkiyRgEg7Tjxv+EOKqbWnfi4L5/3oY65hZpFBTkqdR2bBX462ncPTDJVEmj4e69TKg hfzZH4eShxjPmtm22p5gqiatZ+nKo0eBgmdZOBOi8Ar0oB3FqtMCFUeWJMoqLmQW+gRbzIsz6drT cJJx6/uQVTHKhH+zkpKNjQxlyV09QwLZ1fUiRYwMZJY7qgudiqNezI5o/xw9VXtGM3gFylHhRfFI FDRITUY7lE56bi0jDbiA2a6jcHmUrDUQIrj3Q5s+Ug96po0E68999C9f1Ax2kLQpOfv6pi1evzy+ u1+Qp9noah2MbSzXXFkqIVeyPEBoOgVsjOUJUWllmh976XhweHUdviBWBIsBKCuD8ymrbwq8kuqZ KjNcOeq5/5W8O43R30BxUTheGUWN3cInKnqsgoxVoM4UHg6kLOkZ8SzAg+kBXdtl0HdKf6L2es76 dfNGCVlvBf/IkyEBFP3XhySW5Wi/zKjAs0tN6PjIOQqTy8I3n361CmueOuP/VskXeRuMKV4TlNw1 mc/cXMIZXy2RVXHvETx/GtlX+Kei8n5BzDbmroC1FU3c7TZsv1cvXF3r66HG1O3RawS2mL6q3n/E Bipiw1MwS9ATcZjCfN7eKeFsY81z4jgfvfrQf7x6+UEwvZUypjaOCqqZb0wDHXTk0IOkwMx8qJRQ 9bNZD6oPdUyxzo25P/6E4tHWVCCeyK0WzU+S+oSyg= From: Rong Tao To: ast@kernel.org Cc: Rong Tao , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org (open list:BPF [GENERAL] (Safe Dynamic Programs and Tools)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] samples: bpf: syscall_tp: Add syscall openat2 enter/exit tracepoint Date: Tue, 7 Feb 2023 13:51:43 +0800 X-OQ-MSGID: <20230207055143.37936-1-rtoax@foxmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, HELO_DYNAMIC_IPADDR,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757150577278590440?= X-GMAIL-MSGID: =?utf-8?q?1757150577278590440?= From: Rong Tao commit fe3300897cbf("samples: bpf: fix syscall_tp due to unused syscall") add openat() syscall trapoints, this submit support openat2(). Signed-off-by: Rong Tao --- samples/bpf/syscall_tp_kern.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/samples/bpf/syscall_tp_kern.c b/samples/bpf/syscall_tp_kern.c index 50231c2eff9c..e7121dd1ee37 100644 --- a/samples/bpf/syscall_tp_kern.c +++ b/samples/bpf/syscall_tp_kern.c @@ -58,6 +58,13 @@ int trace_enter_open_at(struct syscalls_enter_open_args *ctx) return 0; } +SEC("tracepoint/syscalls/sys_enter_openat2") +int trace_enter_open_at2(struct syscalls_enter_open_args *ctx) +{ + count(&enter_open_map); + return 0; +} + SEC("tracepoint/syscalls/sys_exit_open") int trace_enter_exit(struct syscalls_exit_open_args *ctx) { @@ -71,3 +78,10 @@ int trace_enter_exit_at(struct syscalls_exit_open_args *ctx) count(&exit_open_map); return 0; } + +SEC("tracepoint/syscalls/sys_exit_openat2") +int trace_enter_exit_at2(struct syscalls_exit_open_args *ctx) +{ + count(&exit_open_map); + return 0; +}