From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EE121363 for ; Fri, 10 Nov 2023 02:23:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="MZrsAb3e" Received: from out-176.mta0.migadu.com (out-176.mta0.migadu.com [IPv6:2001:41d0:1004:224b::b0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D003420B for ; Thu, 9 Nov 2023 18:23:32 -0800 (PST) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1699583010; 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=/1WlOoIci7egeLN8bFPY4JFeTuNURMPYyWiYjAnI/To=; b=MZrsAb3ekPlGFXhfGbUN5NdNsqFO10VIBIbIegDpZBiY0MGsMXy2MdhaVYWpnOHuXBN0lL 2Euzk58mLQHiXpPGet8LsauKjtYkrNrVcZG94nZjzHEwqQPV+utHWhep02rtm51wcjwbcI zApXXRd4liCdI9YVtFuaXB/EJmSciwQ= Date: Thu, 9 Nov 2023 18:23:26 -0800 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v11 13/13] selftests/bpf: test case for register_bpf_struct_ops(). Content-Language: en-US To: thinker.li@gmail.com Cc: sinquersw@gmail.com, kuifeng@meta.com, bpf@vger.kernel.org, ast@kernel.org, song@kernel.org, kernel-team@meta.com, andrii@kernel.org, drosen@google.com References: <20231106201252.1568931-1-thinker.li@gmail.com> <20231106201252.1568931-14-thinker.li@gmail.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <20231106201252.1568931-14-thinker.li@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 11/6/23 12:12 PM, thinker.li@gmail.com wrote: > From: Kui-Feng Lee > > Create a new struct_ops type called bpf_testmod_ops within the bpf_testmod > module. When a struct_ops object is registered, the bpf_testmod module will > invoke test_2 from the module. > > Signed-off-by: Kui-Feng Lee > --- > .../selftests/bpf/bpf_testmod/bpf_testmod.c | 59 +++++++ > .../selftests/bpf/bpf_testmod/bpf_testmod.h | 5 + > .../bpf/prog_tests/test_struct_ops_module.c | 144 ++++++++++++++++++ > .../selftests/bpf/progs/struct_ops_module.c | 30 ++++ > .../testing/selftests/bpf/progs/testmod_btf.c | 26 ++++ > 5 files changed, 264 insertions(+) > create mode 100644 tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c > create mode 100644 tools/testing/selftests/bpf/progs/struct_ops_module.c > create mode 100644 tools/testing/selftests/bpf/progs/testmod_btf.c > > diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c > index a5e246f7b202..418e10311c33 100644 > --- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c > +++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c > @@ -1,5 +1,6 @@ > // SPDX-License-Identifier: GPL-2.0 > /* Copyright (c) 2020 Facebook */ > +#include > #include > #include > #include > @@ -522,11 +523,66 @@ BTF_ID_FLAGS(func, bpf_kfunc_call_test_static_unused_arg) > BTF_ID_FLAGS(func, bpf_kfunc_call_test_offset) > BTF_SET8_END(bpf_testmod_check_kfunc_ids) > > +#ifdef CONFIG_DEBUG_INFO_BTF_MODULES I don't think it is needed. It should have been enabled (directly/indirectly) by the selftests/bpf/config already. [ ... ]