All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf record: Fix "read LOST count failed" msg with sample read
@ 2023-03-01 15:04 kan.liang
  2023-03-01 17:27 ` Namhyung Kim
  0 siblings, 1 reply; 2+ messages in thread
From: kan.liang @ 2023-03-01 15:04 UTC (permalink / raw)
  To: acme, mingo, peterz, namhyung
  Cc: jolsa, irogers, linux-perf-users, linux-kernel, Kan Liang

From: Kan Liang <kan.liang@linux.intel.com>

Hundreds of "read LOST count failed" error messages may be displayed,
when the below command is launched.

perf record -e '{cpu/mem-loads-aux/,cpu/event=0xcd,umask=0x1/}:S' -a

According to the commit 89e3106fa25f ("libperf: Handle read format in
perf_evsel__read()"), the PERF_FORMAT_GROUP is only available for the
leader. However, the record__read_lost_samples() goes through every
entry of an evlist, which includes both leader and member. The member
event errors out and triggers the error message. Since there may be
hundreds of CPUs on a server, the message will be printed hundreds of
times, which is very annoying.

The message itself is correct, but the pr_err is a overkill. Other error
messages in the record__read_lost_samples() are all pr_debug. To make
the output format consistent, change the pr_err("read LOST count
failed\n"); to pr_debug("read LOST count failed\n");.
User can still get the message via -v option.

Fixes: e3a23261ad06 ("perf record: Read and inject LOST_SAMPLES events")
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
---
 tools/perf/builtin-record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 8374117e66f6..be7c0c29d15b 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1866,7 +1866,7 @@ static void __record__read_lost_samples(struct record *rec, struct evsel *evsel,
 	int id_hdr_size;
 
 	if (perf_evsel__read(&evsel->core, cpu_idx, thread_idx, &count) < 0) {
-		pr_err("read LOST count failed\n");
+		pr_debug("read LOST count failed\n");
 		return;
 	}
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] perf record: Fix "read LOST count failed" msg with sample read
  2023-03-01 15:04 [PATCH] perf record: Fix "read LOST count failed" msg with sample read kan.liang
@ 2023-03-01 17:27 ` Namhyung Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Namhyung Kim @ 2023-03-01 17:27 UTC (permalink / raw)
  To: kan.liang
  Cc: acme, mingo, peterz, jolsa, irogers, linux-perf-users, linux-kernel

Hi Kan,

On Wed, Mar 1, 2023 at 7:04 AM <kan.liang@linux.intel.com> wrote:
>
> From: Kan Liang <kan.liang@linux.intel.com>
>
> Hundreds of "read LOST count failed" error messages may be displayed,
> when the below command is launched.
>
> perf record -e '{cpu/mem-loads-aux/,cpu/event=0xcd,umask=0x1/}:S' -a
>
> According to the commit 89e3106fa25f ("libperf: Handle read format in
> perf_evsel__read()"), the PERF_FORMAT_GROUP is only available for the
> leader. However, the record__read_lost_samples() goes through every
> entry of an evlist, which includes both leader and member. The member
> event errors out and triggers the error message. Since there may be
> hundreds of CPUs on a server, the message will be printed hundreds of
> times, which is very annoying.
>
> The message itself is correct, but the pr_err is a overkill. Other error
> messages in the record__read_lost_samples() are all pr_debug. To make
> the output format consistent, change the pr_err("read LOST count
> failed\n"); to pr_debug("read LOST count failed\n");.
> User can still get the message via -v option.
>
> Fixes: e3a23261ad06 ("perf record: Read and inject LOST_SAMPLES events")
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/builtin-record.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 8374117e66f6..be7c0c29d15b 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -1866,7 +1866,7 @@ static void __record__read_lost_samples(struct record *rec, struct evsel *evsel,
>         int id_hdr_size;
>
>         if (perf_evsel__read(&evsel->core, cpu_idx, thread_idx, &count) < 0) {
> -               pr_err("read LOST count failed\n");
> +               pr_debug("read LOST count failed\n");
>                 return;
>         }
>
> --
> 2.35.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-01 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 15:04 [PATCH] perf record: Fix "read LOST count failed" msg with sample read kan.liang
2023-03-01 17:27 ` Namhyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.