linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Oberparleiter <oberpar@linux.ibm.com>
Cc: Leon Romanovsky <leonro@nvidia.com>,
	linux-kernel@vger.kernel.org,
	Colin Ian King <colin.king@canonical.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH rdma-next 4/4] gcov: Don't print out-of-memory print for all failed files
Date: Wed,  2 Sep 2020 11:55:13 +0300	[thread overview]
Message-ID: <20200902085513.748149-5-leon@kernel.org> (raw)
In-Reply-To: <20200902085513.748149-1-leon@kernel.org>

From: Leon Romanovsky <leonro@nvidia.com>

Once GCOV fails to duplicate information, the following error is
printed:
 gcov: could not save data for '/home/leonro/src/kernel/drivers/infiniband/hw/mlx5/std_types.gcda' (out of memory)

In the event of out-of-memory such prints are seen for almost every kernel
file, so instead of spamming dmesg, we print the first failure and inform
the user that future prints are suppressed.

Cc: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 kernel/gcov/fs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c
index 82babf5aa077..b74d426ca99e 100644
--- a/kernel/gcov/fs.c
+++ b/kernel/gcov/fs.c
@@ -685,8 +685,9 @@ static void save_info(struct gcov_node *node, struct gcov_info *info)
 	else {
 		node->unloaded_info = gcov_info_dup(info);
 		if (!node->unloaded_info) {
-			pr_warn("could not save data for '%s' "
-				"(out of memory)\n",
+			pr_warn_once(
+				"could not save data for first file '%s' "
+				"(out of memory), other files are suppressed\n",
 				gcov_info_filename(info));
 		}
 	}
--
2.26.2


  parent reply	other threads:[~2020-09-02  8:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02  8:55 [PATCH -rc 0/4] Protect from GCC garbage input in GCOV Leon Romanovsky
2020-09-02  8:55 ` [PATCH rdma-next 1/4] gcov: Open-code kmemdup() to work correctly with kernel and user space pointers Leon Romanovsky
2020-09-02 17:38   ` Linus Torvalds
2020-09-02 17:46     ` Leon Romanovsky
2020-09-02 18:27       ` Linus Torvalds
2020-09-02 18:44         ` Leon Romanovsky
2020-09-02 19:04           ` Linus Torvalds
2020-09-02  8:55 ` [PATCH rdma-next 2/4] gcov: Use proper duplication routine for const pointer Leon Romanovsky
2020-09-03  8:56   ` Rasmus Villemoes
2020-09-03 10:38     ` Leon Romanovsky
2020-09-02  8:55 ` [PATCH rdma-next 3/4] gcov: Protect from uninitialized number of functions provided by GCC 10.2 Leon Romanovsky
2020-09-02 17:41   ` Linus Torvalds
2020-09-02  8:55 ` Leon Romanovsky [this message]
2020-09-02 17:42 ` [PATCH -rc 0/4] Protect from GCC garbage input in GCOV Linus Torvalds
2020-09-02 17:52   ` Leon Romanovsky
2020-09-02 18:24     ` Linus Torvalds
2020-09-02 18:28       ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200902085513.748149-5-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=colin.king@canonical.com \
    --cc=leonro@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oberpar@linux.ibm.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).