From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796214868; b=IwEZ9KvxXeV6/NqkJZ6CZcaWahzhqCjPpqcqvPeY9DAzBR8ziuv+llRUtgTCzeAi+J61 RtaBVgpMR27WCOUguXCHJADjGplmhjR5bkXIyk8XS7S1tAFg+wHYjHxPgKuNw+yEHMeyr EE+EgZG3qKUO9OtloFtBETqCFL6ltpIqnIZdoPpcl7S9SbelzLRa8B7Q21Tq6luUF/ITf 4EYb7axmkMSytdZ1DjFo8L99qwZhQNUgGfLXpCsBH0Sm4MvWdHmXstXqLLYjvoSsaUom1 LVne82AVOv3MWjjoNGp6BdCcQTD+pzMP8pe66ljp1CANm8RG0CMt1FNdSQw7rIJ+Zdg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796214868; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=z1zufvv5D54y/m/fAacg1ianFfg6hHYRLjGmzXeHoi0=; b=HzF2NOc8iZj+aNEkDGFoa+WuSsauH9IfvFrlylnLq3c++gxxGShQ8UxdpGPrc/CDUYHE pw811WpRk3+UW/v0F/vBC/7XPZHpZwMvJOz5UdIT7HeezXSV0G/Fw7S9DXKTE9E1lKi9w u2mmFFUXZHmvs+CpPoHPgtbSxu7QfpvJFdr06k217yxJk/Q68Lhxd40Jn5VSL/VTMUFpx gHK4ugW3wQiqTyzAOC/V614jvyozXt1NJ/epRHj7el80EtDWFOJONy1ENVto4dsrs29r5 uavBP0BSuRBXNvSoGRKOdomwi1WQ5G18cTAah4xDd/4YJmbjmiEklrVUJLoJRAYkzMQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mFmAFHPh; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 908D9606A322; Wed, 2 Dec 2026 12:34:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=mFmAFHPh Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B21F1F0089A; Wed, 2 Dec 2026 12:34:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796214868; bh=z1zufvv5D54y/m/fAacg1ianFfg6hHYRLjGmzXeHoi0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mFmAFHPhBD9o1Zmzov0SyPKwuSr2LkUJRb2P60Egj6gE5FxrWaSLfNKXIv1jP7Bn8 Ll5BBaj1YKh5etSYYUJGLI5q464PJGoLFmpcK/pkHH2cN8AUBPc+o4JWta5UbDgISk KGTM4ubuqQQJwLqZH2lBqUP9vky1W9Rhng7TsKVqrl0wSfsGcGkTzmIh/3ZCPQUFAm Nk5QCQiD7H0ydxEsK4YFzjTXCTKpY4vGuJlMkKQHFuzfpAQ8PuQ0PeUPfkBNB+vUsj RgmtG43Y8DFcFbiUCcEUEtsOzj4BjxBNAgUu895B1fw2OO1/UYUIbBp+ZwgRMZhjF9 QEsj1PU8H7KUA== From: Jiri Olsa To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Masami Hiramatsu Cc: bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Song Liu , Yonghong Song , Quentin Monnet , Alan Maguire Subject: [PATCH RFC bpf-next 22/31] selftests/bpf: Add inlined functions to bpf_testmod Date: Wed, 2 Dec 2026 13:30:26 +0100 Message-ID: <20261202123035.10335-23-jolsa@kernel.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261202123035.10335-1-jolsa@kernel.org> References: <20261202123035.10335-1-jolsa@kernel.org> X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add always inlined functions and their callers to bpf_testmod module for kprobe multi inline tests, the callers are triggered through bpf_testmod_test_read: bpf_testmod_kprobe_multi_inline_test - calls inline bpf_testmod_kprobe_multi_inline_args_test - calls inline_args Signed-off-by: Jiri Olsa --- .../selftests/bpf/test_kmods/bpf_testmod.c | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c index 86d25638a727..8a0a8ee83703 100644 --- a/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c +++ b/tools/testing/selftests/bpf/test_kmods/bpf_testmod.c @@ -166,6 +166,31 @@ bpf_testmod_test_union_arg_2(int a, union bpf_testmod_union_arg_2 b) return bpf_testmod_test_struct_arg_result; } +/* Inlined function for kprobe multi inline tests. */ +static __always_inline int bpf_testmod_kprobe_multi_inline(int a) +{ + /* Keep an instruction in the inline site. */ + asm volatile("nop"); + return a + 1; +} + +noinline int bpf_testmod_kprobe_multi_inline_test(int a) +{ + return bpf_testmod_kprobe_multi_inline(a); +} + +/* Inlined function with arguments for kprobe multi inline args test. */ +static __always_inline long bpf_testmod_kprobe_multi_inline_args(int a, long b, void *c) +{ + asm volatile("nop"); + return a + b + (long)c; +} + +noinline long bpf_testmod_kprobe_multi_inline_args_test(int a, long b, void *c) +{ + return bpf_testmod_kprobe_multi_inline_args(a, b, c); +} + noinline int bpf_testmod_test_arg_ptr_to_struct(struct bpf_testmod_struct_arg_1 *a) { bpf_testmod_test_struct_arg_result = a->a; @@ -828,6 +853,9 @@ bpf_testmod_test_read(struct file *file, struct kobject *kobj, (void)bpf_testmod_test_arg_ptr_to_struct(&struct_arg1_2); + (void)bpf_testmod_kprobe_multi_inline_test(1); + (void)bpf_testmod_kprobe_multi_inline_args_test(1, 2, (void *)3); + #ifdef __SIZEOF_INT128__ (void)bpf_testmod_test_int128_ret(i); (void)bpf_testmod_test_int128_arg((__int128)1, 2, 3); -- 2.56.1