1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/tools
Wang Yaxin 2272dbc471 getdelays: fix error format characters
getdelays had a compilation issue because the format string was not
updated when the "delay min" was added.  For example, after adding the
"delay min" in printf, there were 7 strings but only 6 "%s" format
specifiers.  Similarly, after adding the 't->cpu_delay_total', there were
7 variables but only 6 format characters specifiers, causing compilation
issues as follows.  This commit fixes these issues to ensure that
getdelays compiles correctly.

root@xx:~/linux-next/tools/accounting$ make
getdelays.c:199:9: warning: format `%llu' expects argument of type
`long long unsigned int', but argument 8 has type `char *' [-Wformat=]
  199 |  printf("\n\nCPU   %15s%15s%15s%15s%15s%15s\n"
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.....
  216 |         "delay total", "delay average", "delay max", "delay min",
      |                                                      ~~~~~~~~~~~
      |                                                      |
      |                                                      char *
getdelays.c:200:21: note: format string is defined here
  200 |         "      %15llu%15llu%15llu%15llu%15.3fms%13.6fms\n"
      |                ~~~~~^
      |                     |
      |                     long long unsigned int
      |                %15s
getdelays.c:199:9: warning: format `%f' expects argument of type
`double', but argument 12 has type `long long unsigned int' [-Wformat=]
  199 |  printf("\n\nCPU   %15s%15s%15s%15s%15s%15s\n"
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.....
  220 |         (unsigned long long)t->cpu_delay_total,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         |
      |         long long unsigned int
.....

Link: https://lkml.kernel.org/r/20250208144400544RduNRhwIpT3m2JyRBqskZ@zte.com.cn
Fixes: f65c64f311 ("delayacct: add delay min to record delay peak")
Reviewed-by: xu xin <xu.xin16@zte.com.cn>
Signed-off-by: Wang Yaxin <wang.yaxin@zte.com.cn>
Signed-off-by: Kun Jiang <jiang.kun2@zte.com.cn>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Fan Yu <fan.yu9@zte.com.cn>
Cc: Peilin He <he.peilin@zte.com.cn>
Cc: Qiang Tu <tu.qiang35@zte.com.cn>
Cc: wangyong <wang.yong12@zte.com.cn>
Cc: ye xingchen <ye.xingchen@zte.com.cn>
Cc: Yunkai Zhang <zhang.yunkai@zte.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-02-17 22:40:02 -08:00
..
accounting getdelays: fix error format characters 2025-02-17 22:40:02 -08:00
arch arm64/sysreg/tools: Move TRFCR definitions to sysreg 2025-01-12 12:50:11 +00:00
bootconfig tools/bootconfig: Fix the wrong format specifier 2025-01-28 23:27:01 +09:00
bpf perf-tools changes for v6.14 2025-01-24 05:45:40 -08:00
build perf tools: Expose quiet/verbose variables in Makefile.perf 2025-01-16 10:59:20 -08:00
certs
cgroup
counter
crypto crypto: tools/ccp - Remove unused variable 2024-08-30 18:22:30 +08:00
debugging
firewire tools/firewire: Fix several incorrect format specifiers 2024-11-14 09:12:04 +09:00
firmware
gpio tools: gpio: Fix several incorrect format specifiers 2024-11-13 16:30:05 +01:00
hv tools/hv: reduce resource usage in hv_kvp_daemon 2024-12-09 18:44:15 +00:00
iio iio: Add channel type for attention 2024-11-03 20:33:43 +00:00
include KVM/arm64 updates for 6.14 2025-01-28 09:01:36 -08:00
kvm/kvm_stat
laptop
leds
lib perf-tools changes for v6.14 2025-01-24 05:45:40 -08:00
memory-model tools/memory-model: simple.txt: Fix stale reference to recipes-pairs.txt 2024-09-13 23:56:44 -07:00
mm tools/mm: fix build warnings with musl-libc 2025-02-17 22:40:02 -08:00
net tools: ynl: c: correct reverse decode of empty attrs 2025-01-27 14:30:23 -08:00
objtool - Move a warning about a lld.ld breakage into the verbose setting as said 2025-02-16 10:30:58 -08:00
pcmcia
perf perf-tools fixes for 6.14 2025-01-30 17:38:20 -08:00
power Turbostat 2025.02.02 updates since 2024.11.30 2025-02-02 10:49:13 -08:00
rcu tools/rcu: Remove RCU Tasks Rude asynchronous APIs from rcu-updaters.sh 2024-07-29 07:39:32 +05:30
sched_ext sched_ext: Fix the incorrect bpf_list kfunc API in common.bpf.h. 2025-02-13 06:47:08 -10:00
scripts perf tools: Create generic syscall table support 2025-01-09 12:49:49 -03:00
sound ASoC: dapm-graph: show path name for non-static routes 2024-08-23 11:03:00 +01:00
spi spi: spidev_test: add support for word delay 2024-11-07 15:25:50 +00:00
testing ARM: 2025-02-16 10:25:12 -08:00
thermal tools/thermal: Fix common realloc mistake 2024-11-15 14:29:03 +01:00
time
tracing rv: tools/rtla: Updates for 6.14 2025-01-26 14:25:58 -08:00
usb usbip: tools: Fix detach_port() invalid port error path 2024-10-29 04:23:23 +01:00
verification verification/dot2k: Implement event type detection 2024-12-27 14:41:01 -05:00
virtio Fix typo in vringh_test.c 2024-11-06 04:40:07 -05:00
wmi
workqueue
writeback
Makefile sched_ext: Add scx_simple and scx_example_qmap example schedulers 2024-06-18 10:09:17 -10:00