Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38490455rwd; Wed, 12 Jul 2023 08:19:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlH+5qK30+LGOE4/8FClaOQaBQH0796M/L22aXftSTE2n9lmoAG7hisxykuYt/pZDfPD0hhi X-Received: by 2002:a2e:9c95:0:b0:2b6:c16a:db06 with SMTP id x21-20020a2e9c95000000b002b6c16adb06mr17265379lji.39.1689175193725; Wed, 12 Jul 2023 08:19:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689175193; cv=none; d=google.com; s=arc-20160816; b=cnpaXtRah7VygMHz1mamJDDfYixx2Eaj8UvDqONPaSW8FnEArG705YnwYuXVwdXDvM i1uoX7WWos++Dx+cBmZaeni84NM3zB0ieI/nUYyPlyHlT3LlLg1TncdTfHRfVsSvBtMk JkLNpEcaZw6llX8bWCGLKoqEipP4KiVyIfx6FZ26jB0JurLDopqP9c7OG5GptaL6DlbT 4ghHbiDpdpA7UVtfLpkjDIh5QwHoq47uU9rcvbt1KVP4/k1EnDsb27BeLvwVO2u9H3d3 7ah4v9rbqGhY9VmdLnaBOrooKiVnSkSTXqCKG2Q5HD51pP57/zmwbzgkayAwjTgcvcqp FHiw== 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=wuD0fZnGZjlCDJR6lREdeMnKB9PqpH7PglGgOZrLCEg=; fh=EVqzeQdXh2nms73ZYd6Gqs3ngCd2kfgjPO6FuLuD7O4=; b=Yjh54c5vwPgFN8/3Kt6qN0PfXRH+AZTtn7NTvafq4yNROr1DyfhS1LVymxNbG0nkEE 8i2nipBJONVvNbirZvdsUR5Ui4l9sYipm5UI5pujqgzmoiTY2yifuAyag1UC1mAxQtZz KAUSKdKUpx53c+B71bIroZ/DSCil6ubgEKpt9OGrS+4EovWC2YjXv8BsdWaj9J0RnPxN 5oQSkeidC1nqv+CLLPQK2UQkckfKk3uNNRPzoQUhee24R9E9e/FOu08eFgaLVjxcDier f2ni5sLV+GjOQpx6x4amhMthwhajUn8lIAPNvPXprl28XdI5gY1520KanGXYVdK3HvAQ ClSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Tzz6c9mB; 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 k17-20020a17090646d100b00992c8f94336si4886698ejs.233.2023.07.12.08.19.29; Wed, 12 Jul 2023 08:19:53 -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=Tzz6c9mB; 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 S231237AbjGLOzB (ORCPT + 99 others); Wed, 12 Jul 2023 10:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjGLOy7 (ORCPT ); Wed, 12 Jul 2023 10:54:59 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB4419A0; Wed, 12 Jul 2023 07:54:58 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2b701e41cd3so116783451fa.3; Wed, 12 Jul 2023 07:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689173697; x=1691765697; 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=wuD0fZnGZjlCDJR6lREdeMnKB9PqpH7PglGgOZrLCEg=; b=Tzz6c9mBIqg//mIFCbu6eA9gfU+y/sPx3E8LwY3cK/HVRvvinzlWPze5+BuG4ku3rz 83M/czrKTdqeBy6anscv2AhyKHM+c/vcq4JglX8Yhgoc7YzclPVsJ6aeVDmE9z7Ph/ZP b7nDU+0ABDLQCk9fEq7RJQogmeLvIbKARHanOIBfkK+10BMl4HWqGvwjTQsltiXfU/SK WJcm7BC5ri8b1duyOVus0l0ZxxRpC0854AUzstDHarkS9mLCZjhU3Pna6LH9Dr53VYPd uOu5JThRGporhr+Ob0zKlhjibVpKLrSwM1sA/iMFv1YzJF2px709q/i2ODjJomt+aMFZ Q+tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689173697; x=1691765697; 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=wuD0fZnGZjlCDJR6lREdeMnKB9PqpH7PglGgOZrLCEg=; b=Jc7x8JaVcP62ci3wDdjgx14Kx2CwoZyqq6gn4bbtakyz5f9aOcCgEM83nAh3iHwxs0 wjpBK+Pu94dLbG1UnZ9sS4STcNPCxRvHkB5TjkiwO8ayDAFrkofJp/RRViBk+BAok7dr 565f5MqAC5eYWwHS36BYPbXOM2ZH5OqZhWY2nHTgSP9fSdQ0kvgajdJ91wXHLGB3/kXb n9cQFC5IrX6zwszi3cZ7pJ/FqlBUvrs6QX053vXnfuJ92QucJf8TZNYx3YEtygVHckaU r1VER9UhXevD7PCaTo/LO94CWr5RYrW/ZJaYn79mvwABlx0RFtZmi7O+OyUxdU8V8zko 18tQ== X-Gm-Message-State: ABy/qLZF6uWdAMkw1naVEJPcKy/LdsukVv14sMHu4j2Sg8HQU4KbKAQG +fdbV2JHODt8Osr12MqxP3okcuNComdV+DiIPd8= X-Received: by 2002:a05:651c:104b:b0:2b6:fe75:b8f3 with SMTP id x11-20020a05651c104b00b002b6fe75b8f3mr16619412ljm.29.1689173696507; Wed, 12 Jul 2023 07:54:56 -0700 (PDT) MIME-Version: 1.0 References: <20230712084746.833965-1-imagedong@tencent.com> <20230712084746.833965-4-imagedong@tencent.com> In-Reply-To: <20230712084746.833965-4-imagedong@tencent.com> From: Alexei Starovoitov Date: Wed, 12 Jul 2023 07:54:45 -0700 Message-ID: Subject: Re: [PATCH bpf-next v9 3/3] selftests/bpf: add testcase for TRACING with 6+ arguments To: Menglong Dong 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_BLOCKED,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 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 *prog, > 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.