mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joshua Aas <josha@sgi.com>
To: linux-kernel@vger.kernel.org
Subject: add core dump file name pattern option for cpu id
Date: Thu, 15 Jul 2004 15:14:43 -0500	[thread overview]
Message-ID: <1089922482.4644.7.camel@coetzee.americas.sgi.com> (raw)

Normally core dumps can be blamed on a program itself. However, core
dumps can also be the result of faulty hardware. Tracking down what CPU
a failure occurred on usually requires that hardware be powered off
piece by piece until no core dumps occur (on big machines this can take
a long time). Another option is to run the test pinned to each CPU until
the core dump occurs, but this can also take a long time on big
machines. It would be very beneficial if the kernel was capable of
making the CPU ID of the CPU the core dump occurred on available
somehow. The following patch adds an option (%c) to the core dump file
naming pattern convention for putting the CPU ID into core dump file
names.

Signed-off-by: Josh Aas <josha@sgi.com>

-----------------------------------------------------------------
--- a/fs/exec.c	2004-07-13 14:32:24.000000000 -0500
+++ b/fs/exec.c	2004-07-15 13:16:17.000000000 -0500
@@ -1276,6 +1276,14 @@ void format_corename(char *corename, con
 					goto out;
 				out_ptr += rc;
 				break;
+			/* cpu id */
+			case 'c':
+				rc = snprintf(out_ptr, out_end - out_ptr,
+					      "%d", smp_processor_id());
+				if (rc > out_end - out_ptr)
+					goto out;
+				out_ptr += rc;
+				break;
 			default:
 				break;
 			}
-----------------------------------------------------------------

-- 
Josh Aas
Silicon Graphics, Inc. (SGI)
Linux System Software
651-683-3068


             reply	other threads:[~2004-07-15 20:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-15 20:14 Joshua Aas [this message]
2004-07-22 19:07 ` Josh Aas

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=1089922482.4644.7.camel@coetzee.americas.sgi.com \
    --to=josha@sgi.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®