Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38496644rwd; Wed, 12 Jul 2023 08:25:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlEaj4c/QahyY5g94m3M6omASmNQwIAvwDTEBs5tDNFYd7FgpCkeeORF8WpUjzy3FrinU5zm X-Received: by 2002:a5d:595a:0:b0:314:1b64:1919 with SMTP id e26-20020a5d595a000000b003141b641919mr48666wri.4.1689175502146; Wed, 12 Jul 2023 08:25:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689175502; cv=none; d=google.com; s=arc-20160816; b=P1o1EQjtmTmYgoFvsnQgg72FRXorXdP+EmXJDZssVH/7HfSDN8LwD0eVmOZmC5zkXE IwsO02114z/aphne/dyyTY5V4a7tzcaWaihSsEA/cNDg9n6KbPWmglLHalstoHFWHCIU mlzMi+Oy4pnVCxCfc0GvlAZKgnMepxsi4IvutUGrLTsRAzp4lz1QIco6n9eW3TCSJ05e O6AlQxzOZU+nBqPP+U7tisAKhvBgZ5dvZIW9Uj7Od7oZDSHLPVQ7yDue1QvGSiLQDKZu tLcq+iTWeAb4jCY2JvuNwyN8AVf+y1qZJom5eacQuLNtfuqUARoxjgsbrmyEaHUG9wRx 73xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/H+XFKPC8Y5xjjIB6z4jmZFgXWxD1qGfV/usqzcEesQ=; fh=0+32i6zLWO5gR+XcL/1LtZWLLgqdHcCRZYawlbtmc60=; b=oe5T7qnPwwNbro0hQoIlsN6lE6k2JSPS7MAwdV9BdQEwIEMOQpjJ2/twYzWaCRAnkm lbwarxNpSpPEhQ7q2MRgxDB0HMcDxYUMbMqkrVubpkAODrOky/tVyr8QWmq4oLLNXgDa wqMhM1IPfvm8WpoMgEw8V0yxg9dYHHbDHBRFgDhwvqkbCZExgvYikgXcS9EEugngEboY jNXZdgdxEeWpVyoOVV91eueZrYj905WdMA/fu6p1TpXoDRB0Dc2PZvpe+jt29o/s/8yM 5TSKpjbibqzL7P/lRLqzg9Nbl2RYQh9VEykUlGwjMIS3pyEci0gfXxDGX01/BaM4hG2G j1ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=dtEjciHr; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x6-20020aa7d6c6000000b0051fde1c1bf7si2055025edr.417.2023.07.12.08.24.37; Wed, 12 Jul 2023 08:25:02 -0700 (PDT) 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=@gmail.com header.s=20221208 header.b=dtEjciHr; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232752AbjGLPL5 (ORCPT + 99 others); Wed, 12 Jul 2023 11:11:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbjGLPL4 (ORCPT ); Wed, 12 Jul 2023 11:11:56 -0400 Received: from mail-yw1-x1142.google.com (mail-yw1-x1142.google.com [IPv6:2607:f8b0:4864:20::1142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A00291BC9; Wed, 12 Jul 2023 08:11:55 -0700 (PDT) Received: by mail-yw1-x1142.google.com with SMTP id 00721157ae682-57eb0df5265so6570407b3.3; Wed, 12 Jul 2023 08:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689174715; x=1691766715; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/H+XFKPC8Y5xjjIB6z4jmZFgXWxD1qGfV/usqzcEesQ=; b=dtEjciHriK4KjQp+DlWxxLcpdalO4+DHz0p937NjJhg6WKGJpgAlHNykZ5TeX8KWpI qzh88l5BUG6AxEXlgT2XTvQHcx4TEN4aHpnat6+KnmyhX8lUlTenPKi28VbqOC8gy/i3 o7u1SxLb3u1DzUfmiBTRsi94vgmDSkpICCpO733O7uFralwEtGIZ6cigg4Y003mc6uDt lDDLeXdsMwPq4FaBxhlC+OQ1663VrkGGDFy17xni8zzHhgt/W7MNknT7lt9rcndjQfRw e2OHi9dfE10ZFH9DF4MEbGgLpZDRkgfv2EAP/Z5ocd+tp8kTddq8lzRpGF7QKTnhM2yu rrzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689174715; x=1691766715; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/H+XFKPC8Y5xjjIB6z4jmZFgXWxD1qGfV/usqzcEesQ=; b=RdfALDmN35/QqO6EQxXTgy5bw1RBl7EkSTLfXGtHLNJk5zVtrXi2Ju8edDnlH45x4O mQ3dqiWbFNTchv8T1Y43VnikAxwigS/1sTKO5/eRVXEFo43GhMAD4aeS968kSYJcVpDY xXzOjqkSTiLhnp+loIbge01UiH1fLbU3Y64wp2rxmFl/ciJtEV2XDzm73XXxbgHF09UQ mCWyXuNvQLYtUP3KHAFoaDquMHv3Cg80LeSNjK3M8MtAYggn6BGErt2WocpMsTkxSKUG bFjzNhsPJ+q4SRWGgB9y7UKBEguDp0gYiu0GRAslUwsUdynfTaq/HlsutAsy9O3J2zcg Zq6A== X-Gm-Message-State: ABy/qLYqdJAYW1dCS+2UrbWpclVJooGd1OrLsIKbKPPjcvYT9gmBUJoJ 1J5b4c2Zall9l6fH0XbUNXJ1xSvKBuuRT2YpgtU= X-Received: by 2002:a5b:b8e:0:b0:c60:bd1a:fea1 with SMTP id l14-20020a5b0b8e000000b00c60bd1afea1mr14933532ybq.57.1689174714649; Wed, 12 Jul 2023 08:11:54 -0700 (PDT) MIME-Version: 1.0 References: <20230712084746.833965-1-imagedong@tencent.com> <20230712084746.833965-4-imagedong@tencent.com> In-Reply-To: From: Menglong Dong Date: Wed, 12 Jul 2023 23:11:43 +0800 Message-ID: Subject: Re: [PATCH bpf-next v9 3/3] selftests/bpf: add testcase for TRACING with 6+ arguments To: Alexei Starovoitov Cc: Yonghong Song , Daniel Borkmann , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , David Ahern , Jiri Olsa , X86 ML , bpf , LKML , linux-arm-kernel , Menglong Dong Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Wed, Jul 12, 2023 at 10:54=E2=80=AFPM Alexei Starovoitov wrote: > > On Wed, Jul 12, 2023 at 1:50=E2=80=AFAM wrote: > > > > From: Menglong Dong > > > > Add fentry_many_args.c and fexit_many_args.c to test the fentry/fexit > > with 7/11 arguments. As this feature is not supported by arm64 yet, we > > disable these testcases for arm64 in DENYLIST.aarch64. We can combine > > them with fentry_test.c/fexit_test.c when arm64 is supported too. > > > > Correspondingly, add bpf_testmod_fentry_test7() and > > bpf_testmod_fentry_test11() to bpf_testmod.c > > > > Meanwhile, add bpf_modify_return_test2() to test_run.c to test the > > MODIFY_RETURN with 7 arguments. > > > > Add bpf_testmod_test_struct_arg_7/bpf_testmod_test_struct_arg_7 in > > bpf_testmod.c to test the struct in the arguments. > > > > And the testcases passed on x86_64: > > > > ./test_progs -t fexit > > Summary: 5/14 PASSED, 0 SKIPPED, 0 FAILED > > > > ./test_progs -t fentry > > Summary: 3/2 PASSED, 0 SKIPPED, 0 FAILED > > > > ./test_progs -t modify_return > > Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED > > > > ./test_progs -t tracing_struct > > Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED > > > > Signed-off-by: Menglong Dong > > Acked-by: Yonghong Song > > --- > > v9: > > - change the way to test fmod_ret > > v8: > > - split the testcases, and add fentry_many_args/fexit_many_args to > > DENYLIST.aarch64 > > v6: > > - add testcases to tracing_struct.c instead of fentry_test.c and > > fexit_test.c > > v5: > > - add testcases for MODIFY_RETURN > > v4: > > - use different type for args in bpf_testmod_fentry_test{7,12} > > - add testcase for grabage values in ctx > > v3: > > - move bpf_fentry_test{7,12} to bpf_testmod.c and rename them to > > bpf_testmod_fentry_test{7,12} meanwhile > > - get return value by bpf_get_func_ret() in > > "fexit/bpf_testmod_fentry_test12", as we don't change ___bpf_ctx_cast= () > > in this version > > --- > > net/bpf/test_run.c | 14 ++++- > > tools/testing/selftests/bpf/DENYLIST.aarch64 | 2 + > > .../selftests/bpf/bpf_testmod/bpf_testmod.c | 49 ++++++++++++++++- > > .../selftests/bpf/prog_tests/fentry_test.c | 43 +++++++++++++-- > > .../selftests/bpf/prog_tests/fexit_test.c | 43 +++++++++++++-- > > .../selftests/bpf/prog_tests/modify_return.c | 10 ++-- > > .../selftests/bpf/prog_tests/tracing_struct.c | 19 +++++++ > > .../selftests/bpf/progs/fentry_many_args.c | 39 ++++++++++++++ > > .../selftests/bpf/progs/fexit_many_args.c | 40 ++++++++++++++ > > .../selftests/bpf/progs/modify_return.c | 40 ++++++++++++++ > > .../selftests/bpf/progs/tracing_struct.c | 54 +++++++++++++++++++ > > 11 files changed, 340 insertions(+), 13 deletions(-) > > create mode 100644 tools/testing/selftests/bpf/progs/fentry_many_args.= c > > create mode 100644 tools/testing/selftests/bpf/progs/fexit_many_args.c > > > > diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c > > index 63b11f7a5392..7d47f53f20c1 100644 > > --- a/net/bpf/test_run.c > > +++ b/net/bpf/test_run.c > > @@ -565,6 +565,13 @@ __bpf_kfunc int bpf_modify_return_test(int a, int = *b) > > return a + *b; > > } > > > > +__bpf_kfunc int bpf_modify_return_test2(int a, int *b, short c, int d, > > + void *e, char f, int g) > > +{ > > + *b +=3D 1; > > + return a + *b + c + d + (long)e + f + g; > > +} > > + > > int noinline bpf_fentry_shadow_test(int a) > > { > > return a + 1; > > @@ -600,6 +607,7 @@ __diag_pop(); > > > > BTF_SET8_START(bpf_test_modify_return_ids) > > BTF_ID_FLAGS(func, bpf_modify_return_test) > > +BTF_ID_FLAGS(func, bpf_modify_return_test2) > > BTF_ID_FLAGS(func, bpf_fentry_test1, KF_SLEEPABLE) > > BTF_SET8_END(bpf_test_modify_return_ids) > > > > @@ -667,7 +675,11 @@ int bpf_prog_test_run_tracing(struct bpf_prog *pro= g, > > case BPF_MODIFY_RETURN: > > ret =3D bpf_modify_return_test(1, &b); > > if (b !=3D 2) > > - side_effect =3D 1; > > + side_effect++; > > + b =3D 2; > > + ret +=3D bpf_modify_return_test2(1, &b, 3, 4, (void *)5= , 6, 7); > > + if (b !=3D 2) > > + side_effect++; > > Looks better, but now two tests are failing: > Error: #85 get_func_args_test > Error: #252 trampoline_count > > See BPF CI. > > I suspect you haven't rerun the whole test_progs after your changes. > Please do so in the future. ......Yes, I didn't run the whole tests, and it seems that some other test cases also use the bpf_modify_return_test(). I'll run the whole test_progs, sorry for the bother...... Thanks! Menglong Dong