[PATCH] event/core.c: fix warning format specifier to use %llu instead of %lld for u64 values.

Ryan Chung posted 1 patch 2 months, 1 week ago
kernel/events/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] event/core.c: fix warning format specifier to use %llu instead of %lld for u64 values.
Posted by Ryan Chung 2 months, 1 week ago
Updates the perf duration warning to use the unsigned 64‑bit format specifier `%llu` instead of `%lld`, ensuring the format matches the `u64` types.

No functional change intended.

Signed-off-by: Ryan Chung <seokwoo.chung130@gmail.com>
---
 kernel/events/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 22fdf0c187cd..b8d7c4a64c44 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -602,7 +602,7 @@ static u64 __report_allowed;
 static void perf_duration_warn(struct irq_work *w)
 {
 	printk_ratelimited(KERN_INFO
-		"perf: interrupt took too long (%lld > %lld), lowering "
+		"perf: interrupt took too long (%llu > %llu), lowering "
 		"kernel.perf_event_max_sample_rate to %d\n",
 		__report_avg, __report_allowed,
 		sysctl_perf_event_sample_rate);
@@ -655,7 +655,7 @@ void perf_sample_event_took(u64 sample_len_ns)
 	perf_sample_period_ns = NSEC_PER_SEC / sysctl_perf_event_sample_rate;
 
 	if (!irq_work_queue(&perf_duration_work)) {
-		early_printk("perf: interrupt took too long (%lld > %lld), lowering "
+		early_printk("perf: interrupt took too long (%llu > %llu), lowering "
 			     "kernel.perf_event_max_sample_rate to %d\n",
 			     __report_avg, __report_allowed,
 			     sysctl_perf_event_sample_rate);
-- 
2.43.0

Re: [PATCH] event/core.c: fix warning format specifier to use %llu instead of %lld for u64 values.
Posted by Ryan Chung 1 month, 3 weeks ago
Hi all,

Just wondering if there’s any feedback on this patch.

Thanks,
Ryan Chung

On Tue, Jul 29, 2025 at 04:06:03PM +0900, Ryan Chung wrote:
> Updates the perf duration warning to use the unsigned 64‑bit format specifier `%llu` instead of `%lld`, ensuring the format matches the `u64` types.
> 
> No functional change intended.
> 
> Signed-off-by: Ryan Chung <seokwoo.chung130@gmail.com>
> ---
>  kernel/events/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 22fdf0c187cd..b8d7c4a64c44 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -602,7 +602,7 @@ static u64 __report_allowed;
>  static void perf_duration_warn(struct irq_work *w)
>  {
>  	printk_ratelimited(KERN_INFO
> -		"perf: interrupt took too long (%lld > %lld), lowering "
> +		"perf: interrupt took too long (%llu > %llu), lowering "
>  		"kernel.perf_event_max_sample_rate to %d\n",
>  		__report_avg, __report_allowed,
>  		sysctl_perf_event_sample_rate);
> @@ -655,7 +655,7 @@ void perf_sample_event_took(u64 sample_len_ns)
>  	perf_sample_period_ns = NSEC_PER_SEC / sysctl_perf_event_sample_rate;
>  
>  	if (!irq_work_queue(&perf_duration_work)) {
> -		early_printk("perf: interrupt took too long (%lld > %lld), lowering "
> +		early_printk("perf: interrupt took too long (%llu > %llu), lowering "
>  			     "kernel.perf_event_max_sample_rate to %d\n",
>  			     __report_avg, __report_allowed,
>  			     sysctl_perf_event_sample_rate);
> -- 
> 2.43.0
>