Re: [PATCH] add core dump file name pattern option for cpu id
From: Andrew Morton
Date: Tue Jul 27 2004 - 14:36:44 EST
Josh Aas <josha@xxxxxxx> wrote:
>
> ---------------------------------------------------------
> --- 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;
> }
> ---------------------------------------------------------
>
> Is there any reason this couldn't be taken into the kernel? I didn't get
> any response at all and it seems to be a safe and useful patch. Any
> feedback would be appreciated.
There's no guarantee at all that we're still running on the same CPU by the
time we get here.
Possibly do_coredump() could fish the relevant info out of the pt_regs in
some arch-dependent way, or it needs to be propagated down in some manner.
Either way, the patch will become more complex.
Any future revision of this patch should include an update to
Documentation/sysctl/kernel.txt:core_pattern please.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/