BPF List
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Vadim Fedorenko <vadfed@meta.com>
Cc: Borislav Petkov <bp@alien8.de>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Yonghong Song <yonghong.song@linux.dev>,
	Mykola Lysenko <mykolal@fb.com>, X86 ML <x86@kernel.org>,
	bpf <bpf@vger.kernel.org>, Peter Zijlstra <peterz@infradead.org>,
	Martin KaFai Lau <martin.lau@linux.dev>
Subject: Re: [PATCH bpf-next v11 3/4] selftests/bpf: add selftest to check bpf_get_cpu_time_counter jit
Date: Tue, 18 Mar 2025 08:45:13 +0000	[thread overview]
Message-ID: <58ebfd15-3cd9-4f73-a185-a572c52f08c3@linux.dev> (raw)
In-Reply-To: <CAADnVQKzXjC2-24V_dYiq_cCf8Df-Sm0Kf=keiyBrLKZ0yXeVg@mail.gmail.com>

On 18/03/2025 00:30, Alexei Starovoitov wrote:
> On Mon, Mar 17, 2025 at 3:50 PM Vadim Fedorenko <vadfed@meta.com> wrote:
>>
>> bpf_get_cpu_time_counter() is replaced with rdtsc instruction on x86_64.
>> Add tests to check that JIT works as expected.
>>
>> Acked-by: Eduard Zingerman <eddyz87@gmail.com>
>> Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
>> ---
>>   .../selftests/bpf/prog_tests/verifier.c       |   2 +
>>   .../selftests/bpf/progs/verifier_cpu_cycles.c | 104 ++++++++++++++++++
>>   2 files changed, 106 insertions(+)
>>   create mode 100644 tools/testing/selftests/bpf/progs/verifier_cpu_cycles.c
>>
>> diff --git a/tools/testing/selftests/bpf/prog_tests/verifier.c b/tools/testing/selftests/bpf/prog_tests/verifier.c
>> index e66a57970d28..d5e7e302a344 100644
>> --- a/tools/testing/selftests/bpf/prog_tests/verifier.c
>> +++ b/tools/testing/selftests/bpf/prog_tests/verifier.c
>> @@ -102,6 +102,7 @@
>>   #include "verifier_xdp_direct_packet_access.skel.h"
>>   #include "verifier_bits_iter.skel.h"
>>   #include "verifier_lsm.skel.h"
>> +#include "verifier_cpu_cycles.skel.h"
>>   #include "irq.skel.h"
>>
>>   #define MAX_ENTRIES 11
>> @@ -236,6 +237,7 @@ void test_verifier_bits_iter(void) { RUN(verifier_bits_iter); }
>>   void test_verifier_lsm(void)                  { RUN(verifier_lsm); }
>>   void test_irq(void)                          { RUN(irq); }
>>   void test_verifier_mtu(void)                 { RUN(verifier_mtu); }
>> +void test_verifier_cpu_cycles(void)          { RUN(verifier_cpu_cycles); }
>>
>>   static int init_test_val_map(struct bpf_object *obj, char *map_name)
>>   {
>> diff --git a/tools/testing/selftests/bpf/progs/verifier_cpu_cycles.c b/tools/testing/selftests/bpf/progs/verifier_cpu_cycles.c
>> new file mode 100644
>> index 000000000000..5b62e3690362
>> --- /dev/null
>> +++ b/tools/testing/selftests/bpf/progs/verifier_cpu_cycles.c
>> @@ -0,0 +1,104 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/* Copyright (c) 2022 Meta Inc. */
> 
> botched copy paste.

Ouch.

  reply	other threads:[~2025-03-18  8:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17 22:49 [PATCH bpf-next v11 0/4] bpf: add cpu time counter kfuncs Vadim Fedorenko
2025-03-17 22:49 ` [PATCH bpf-next v11 1/4] bpf: add bpf_get_cpu_time_counter kfunc Vadim Fedorenko
2025-03-18  0:23   ` Alexei Starovoitov
2025-03-18  8:17     ` Vadim Fedorenko
2025-03-18 15:56       ` Alexei Starovoitov
2025-03-17 22:49 ` [PATCH bpf-next v11 2/4] bpf: add bpf_cpu_time_counter_to_ns helper Vadim Fedorenko
2025-03-18  0:29   ` Alexei Starovoitov
2025-03-18  8:44     ` Vadim Fedorenko
2025-03-18 16:42       ` Alexei Starovoitov
2025-03-17 22:49 ` [PATCH bpf-next v11 3/4] selftests/bpf: add selftest to check bpf_get_cpu_time_counter jit Vadim Fedorenko
2025-03-18  0:30   ` Alexei Starovoitov
2025-03-18  8:45     ` Vadim Fedorenko [this message]
2025-03-17 22:49 ` [PATCH bpf-next v11 4/4] selftests/bpf: add usage example for cpu time counter kfuncs Vadim Fedorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58ebfd15-3cd9-4f73-a185-a572c52f08c3@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bp@alien8.de \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vadfed@meta.com \
    --cc=x86@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox