[PATCH] perf sample: Fix the wrong format specifier

liujing posted 1 patch 4 months, 2 weeks ago
tools/perf/util/cs-etm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] perf sample: Fix the wrong format specifier
Posted by liujing 4 months, 2 weeks ago
In the file tools/perf/util/cs-etm.c, queue_nr is of type unsigned
int and should be printed with %u.

Signed-off-by: liujing <liujing@cmss.chinamobile.com>
---
 tools/perf/util/cs-etm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index 30f4bb3e7fa3..d13575285b19 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -777,7 +777,7 @@ static void cs_etm__packet_dump(const char *pkt_string, void *data)
 	char queue_nr[64];
 
 	if (verbose)
-		snprintf(queue_nr, sizeof(queue_nr), "Qnr:%d; ", etmq->queue_nr);
+		snprintf(queue_nr, sizeof(queue_nr), "Qnr:%u; ", etmq->queue_nr);
 	else
 		queue_nr[0] = '\0';
 
-- 
2.27.0
Re: [PATCH] perf sample: Fix the wrong format specifier
Posted by Namhyung Kim 2 months, 3 weeks ago
On Mon, 22 Sep 2025 17:50:57 +0800, liujing wrote:
> In the file tools/perf/util/cs-etm.c, queue_nr is of type unsigned
> int and should be printed with %u.
> 
> 
Applied to perf-tools-next, thanks!

Best regards,
Namhyung
Re: [PATCH] perf sample: Fix the wrong format specifier
Posted by Mike Leach 4 months ago
On Mon, 22 Sept 2025 at 10:51, liujing <liujing@cmss.chinamobile.com> wrote:
>
> In the file tools/perf/util/cs-etm.c, queue_nr is of type unsigned
> int and should be printed with %u.
>
> Signed-off-by: liujing <liujing@cmss.chinamobile.com>
> ---
>  tools/perf/util/cs-etm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
> index 30f4bb3e7fa3..d13575285b19 100644
> --- a/tools/perf/util/cs-etm.c
> +++ b/tools/perf/util/cs-etm.c
> @@ -777,7 +777,7 @@ static void cs_etm__packet_dump(const char *pkt_string, void *data)
>         char queue_nr[64];
>
>         if (verbose)
> -               snprintf(queue_nr, sizeof(queue_nr), "Qnr:%d; ", etmq->queue_nr);
> +               snprintf(queue_nr, sizeof(queue_nr), "Qnr:%u; ", etmq->queue_nr);
>         else
>                 queue_nr[0] = '\0';
>
> --
> 2.27.0
>
>
>
>
Reviewed-by: Mike Leach <mike.leach@linaro.org>

-- 
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK