[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231118024858.1567039-2-yangjihong1@huawei.com>
Date: Sat, 18 Nov 2023 02:48:56 +0000
From: Yang Jihong <yangjihong1@...wei.com>
To: <peterz@...radead.org>, <mingo@...hat.com>, <acme@...nel.org>,
<mark.rutland@....com>, <alexander.shishkin@...ux.intel.com>,
<jolsa@...nel.org>, <namhyung@...nel.org>, <irogers@...gle.com>,
<adrian.hunter@...el.com>, <avagin@...gle.com>,
<daniel.diaz@...aro.org>, <linux-perf-users@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: <yangjihong1@...wei.com>
Subject: [PATCH 1/3] perf kwork: Fix a build error on 32-bit
lkft reported a build error for 32-bit system:
builtin-kwork.c: In function 'top_print_work':
builtin-kwork.c:1646:28: error: format '%ld' expects argument of
type 'long int', but argument 3 has type 'u64' {aka 'long long
unsigned int'} [-Werror=format=]
1646 | ret += printf(" %*ld ", PRINT_PID_WIDTH, work->id);
| ~~~^ ~~~~~~~~
| | |
| long int u64
{aka long long unsigned int}
| %*lld
cc1: all warnings being treated as errors
make[3]: *** [/builds/linux/tools/build/Makefile.build:106:
/home/tuxbuild/.cache/tuxmake/builds/1/build/builtin-kwork.o] Error 1
Fix it.
Fixes: 55c40e505234 ("perf kwork top: Introduce new top utility")
Reported-by: Linux Kernel Functional Testing <lkft@...aro.org>
Signed-off-by: Yang Jihong <yangjihong1@...wei.com>
---
tools/perf/builtin-kwork.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-kwork.c b/tools/perf/builtin-kwork.c
index f007a9b27065..0092b9b39611 100644
--- a/tools/perf/builtin-kwork.c
+++ b/tools/perf/builtin-kwork.c
@@ -1643,7 +1643,7 @@ static int top_print_work(struct perf_kwork *kwork __maybe_unused, struct kwork_
/*
* pid
*/
- ret += printf(" %*ld ", PRINT_PID_WIDTH, work->id);
+ ret += printf(" %*" PRIu64 " ", PRINT_PID_WIDTH, work->id);
/*
* tgid
--
2.34.1
Powered by blists - more mailing lists