Re: [PATCH v13 11/16] perf record: Introduce data transferred and compressed stats

From: Arnaldo Carvalho de Melo
Date: Mon Jan 24 2022 - 11:42:06 EST


Em Mon, Jan 24, 2022 at 12:28:18PM -0300, Arnaldo Carvalho de Melo escreveu:
> builtin-record.c:2141:4: note: in expansion of macro 'pr_debug'
> 2141 | pr_debug("written=%ld\n", thread_data[t].bytes_written);
> | ^~~~~~~~
> builtin-record.c:2141:24: note: format string is defined here
> 2141 | pr_debug("written=%ld\n", thread_data[t].bytes_written);
> | ~~^
> | |
> | long int
> | %lld
>
> Fixed with the following patch, no need to resend, I'll fix several
> other similar issues and put the result in a tmp.perf/thread branch
> while I review/test it.

Did it, with the fix it builds in all containers, now to test it and
review patch by patch one more time.

[acme@quaco perf]$ git push acme.korg perf/core:tmp.perf/threaded
Enumerating objects: 134, done.
Counting objects: 100% (134/134), done.
Delta compression using up to 8 threads
Compressing objects: 100% (55/55), done.
Writing objects: 100% (108/108), 23.64 KiB | 4.73 MiB/s, done.
Total 108 (delta 105), reused 55 (delta 53), pack-reused 0
remote: Resolving deltas: 100% (105/105), completed with 25 local objects.
remote: Recorded in the transparency log
remote: manifest: updated /pub/scm/linux/kernel/git/acme/linux.git
remote: Done in 0.06s
remote: Notifying frontends: dfw ams sin
To gitolite.kernel.org:/pub/scm/linux/kernel/git/acme/linux.git
* [new branch] perf/core -> tmp.perf/threaded
[acme@quaco perf]$

- Arnaldo

> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 0f8488d12f446b84..d19d0639c3f1abc0 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -2114,10 +2114,10 @@ static int record__stop_threads(struct record *rec)
> pr_debug("threads[%d]: samples=%lld, wakes=%ld, ", thread_data[t].tid,
> thread_data[t].samples, thread_data[t].waking);
> if (thread_data[t].bytes_transferred && thread_data[t].bytes_compressed)
> - pr_debug("trasferred=%ld, compressed=%ld\n",
> + pr_debug("transferred=%" PRIu64 ", compressed=%" PRIu64 "\n",
> thread_data[t].bytes_transferred, thread_data[t].bytes_compressed);
> else
> - pr_debug("written=%ld\n", thread_data[t].bytes_written);
> + pr_debug("written=%" PRIu64 "\n", thread_data[t].bytes_written);
> }
>
> return 0;

--

- Arnaldo