diff mbox series

[FFmpeg-devel,v2] tests/checkasm: add exclude_guest for non-x86 linux perf

Message ID 20240410084458.152389-1-jdek@itanimul.li
State New
Headers show
Series [FFmpeg-devel,v2] tests/checkasm: add exclude_guest for non-x86 linux perf | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

J. Dekker April 10, 2024, 8:44 a.m. UTC
The exclude_guest option only has an effect on x86. Omitting
'exclude_guest' defaults to zero which implies that you can count guest
events should you run one. Some non-x86 kernels just ignore it, while
others (e.g. the Asahi Linux kernels) require the user to explicitly set
the option to 1, i.e. the only behaviour that makes sense when counting
guest events isn't supported.

Signed-off-by: J. Dekker <jdek@itanimul.li>
---

 Made commit message clearer, no functional change since v1.

 tests/checkasm/checkasm.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Martin Storsjö April 10, 2024, 9:18 a.m. UTC | #1
On Wed, 10 Apr 2024, J. Dekker wrote:

> The exclude_guest option only has an effect on x86. Omitting
> 'exclude_guest' defaults to zero which implies that you can count guest
> events should you run one. Some non-x86 kernels just ignore it, while
> others (e.g. the Asahi Linux kernels) require the user to explicitly set
> the option to 1, i.e. the only behaviour that makes sense when counting
> guest events isn't supported.
>
> Signed-off-by: J. Dekker <jdek@itanimul.li>
> ---
>
> Made commit message clearer, no functional change since v1.
>
> tests/checkasm/checkasm.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
> index dcd2fd6957..8be6cb0f55 100644
> --- a/tests/checkasm/checkasm.c
> +++ b/tests/checkasm/checkasm.c
> @@ -742,6 +742,9 @@ static int bench_init_linux(void)
>         .disabled       = 1, // start counting only on demand
>         .exclude_kernel = 1,
>         .exclude_hv     = 1,
> +#if !ARCH_X86
> +        .exclude_guest  = 1,
> +#endif
>     };
>
>     printf("benchmarking with Linux Perf Monitoring API\n");
> -- 
> 2.44.0

Thanks, the updated commit message feels more readable to me at least.

I'm not familiar with the perf API, but I tested perf on an aarch64 
machine where perf benchmarking previously worked, and it still works 
after this change, so it seems ok.

// Martin
J. Dekker April 10, 2024, 11:38 a.m. UTC | #2
Martin Storsjö <martin@martin.st> writes:

> On Wed, 10 Apr 2024, J. Dekker wrote:
>
>> The exclude_guest option only has an effect on x86. Omitting
>> 'exclude_guest' defaults to zero which implies that you can count guest
>> events should you run one. Some non-x86 kernels just ignore it, while
>> others (e.g. the Asahi Linux kernels) require the user to explicitly set
>> the option to 1, i.e. the only behaviour that makes sense when counting
>> guest events isn't supported.
>>
>> Signed-off-by: J. Dekker <jdek@itanimul.li>
>> ---
>>
>> Made commit message clearer, no functional change since v1.
>>
>> tests/checkasm/checkasm.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
>> index dcd2fd6957..8be6cb0f55 100644
>> --- a/tests/checkasm/checkasm.c
>> +++ b/tests/checkasm/checkasm.c
>> @@ -742,6 +742,9 @@ static int bench_init_linux(void)
>>         .disabled       = 1, // start counting only on demand
>>         .exclude_kernel = 1,
>>         .exclude_hv     = 1,
>> +#if !ARCH_X86
>> +        .exclude_guest  = 1,
>> +#endif
>>     };
>>
>>     printf("benchmarking with Linux Perf Monitoring API\n");
>> -- 2.44.0
>
> Thanks, the updated commit message feels more readable to me at least.
>
> I'm not familiar with the perf API, but I tested perf on an aarch64 machine
> where perf benchmarking previously worked, and it still works after this
> change, so it seems ok.

Thanks, pushed.
diff mbox series

Patch

diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index dcd2fd6957..8be6cb0f55 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -742,6 +742,9 @@  static int bench_init_linux(void)
         .disabled       = 1, // start counting only on demand
         .exclude_kernel = 1,
         .exclude_hv     = 1,
+#if !ARCH_X86
+        .exclude_guest  = 1,
+#endif
     };
 
     printf("benchmarking with Linux Perf Monitoring API\n");