All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@redhat.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	lkml <linux-kernel@vger.kernel.org>,
	systemtap <systemtap@sources.redhat.com>,
	DLE <dle-develop@lists.sourceforge.net>,
	Oleg Nesterov <oleg@redhat.com>,
	Roland McGrath <roland@redhat.com>,
	Jason Baron <jbaron@redhat.com>
Subject: Re: [PATCH v2] [RFC] tracepoint: Add signal coredump tracepoint
Date: Mon, 07 Dec 2009 10:25:48 -0500	[thread overview]
Message-ID: <4B1D1E7C.8000806@redhat.com> (raw)
In-Reply-To: <2f11576a0912042318u4c9c90cetb4ce136e977c2596@mail.gmail.com>

KOSAKI Motohiro wrote:
> 2009/12/3 Masami Hiramatsu<mhiramat@redhat.com>:
>> Add signal coredump tracepoint which shows signal number,
>> mm->flags, limits, pointer to file structure and core
>> file name.
>>
>> This tracepoint requirement comes mainly from the viewpoint of
>> administrators. Since now we have introduced many coredump
>> configurations (e.g. dumpable, coredump_filter, core_pattern,
>> etc) and some of them can be modified by users, it will be hard
>> to know what was actually dumped (or not dumped) after some
>> problem happened on the system. For example, a process didn't
>> generated core, coredump doesn't have some sections, etc.
>> In those cases, the coredump tracepoint can help us to know
>> why the core file is so big or small, or not generated, by
>> recording all configurations for all processes on the system.
>> That will reduce system-administration cost.
>
> AFAIK, not-dumped case is important than dump successful case.
> IOW, admin need to know why the crashed process was not dumped.

Certainly, failure cases are important, but also, the cases
that dumped-core doesn't or does include some sections
are also important.

> This tracepoint doesn't cover all failure case. especially
> binfmt->core_dump() et.al.
> IOW, this tracepoint seems too specialized piped-coredump feature.

Hmm, so would you mean that after calling binfmt->core_dump()
is better place?

> What do you think this tracepoint's use case?

Frankly to say, our first attempt was tracing mm->flags because
it can be changed by users without asking, and they sometimes
ask why core is not perfect or why core file is so big.

Perhaps, covering all of those failure cases and succeed cases,
gives better information for them. In that case, we might better
tweak execution(goto) path to leave some error code on retval.

e.g.
         if (IS_ERR(file))
                 goto fail_dropcount;
+	retval = -EBADF;
         inode = file->f_path.dentry->d_inode;
         if (inode->i_nlink > 1)
                 goto close_fail;        /* multiple links - don't dump */
         if (!ispipe && d_unhashed(file->f_path.dentry))
                 goto close_fail;

         /* AK: actually i see no reason to not allow this for named pipes etc.,
            but keep the previous behaviour for now. */
         if (!ispipe && !S_ISREG(inode->i_mode))
                 goto close_fail;
         /*
          * Dont allow local users get cute and trick others to coredump
          * into their pre-created files:
          */
+	retval = -EPERM;
         if (inode->i_uid != current_fsuid())
                 goto close_fail;
+	retval = -EINVAL;
         if (!file->f_op)
                 goto close_fail;
         if (!file->f_op->write)
                 goto close_fail;
+	retval = -EEXIST;
         if (!ispipe && do_truncate(file->f_path.dentry, 0, 0, file) != 0)
                 goto close_fail;


Thank you,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com


  reply	other threads:[~2009-12-07 15:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 22:12 + binfmt-introduce-coredump-parameter-structure.patch added to -mm tree akpm
2009-11-26  8:53 ` KOSAKI Motohiro
2009-11-26 15:50   ` Masami Hiramatsu
2009-11-26 16:51     ` Oleg Nesterov
2009-11-29  3:59       ` Masami Hiramatsu
2009-11-29  4:39       ` [PATCH v2] mm: Introduce coredump parameter structure Masami Hiramatsu
2009-11-29  4:41       ` Masami Hiramatsu
2009-11-29 15:10         ` [PATCH][RFC] tracepoint: signal coredump (Re: [PATCH v2] mm: Introduce coredump parameter structure) Masami Hiramatsu
2009-12-02 20:46           ` [PATCH v2] [RFC] tracepoint: Add signal coredump tracepoint Masami Hiramatsu
2009-12-03 10:39             ` Ingo Molnar
2009-12-03 11:32               ` Masami Hiramatsu
2009-12-05  7:16                 ` Ingo Molnar
2009-12-07 17:19                   ` Masami Hiramatsu
2009-12-05  7:18             ` KOSAKI Motohiro
2009-12-07 15:25               ` Masami Hiramatsu [this message]
2009-12-08  1:51                 ` KOSAKI Motohiro
2009-12-08 20:40                   ` [PATCH v3] " Masami Hiramatsu
2009-12-09  5:34                     ` KOSAKI Motohiro
2009-12-09 16:07                       ` Masami Hiramatsu
2009-12-09 16:16                         ` Masami Hiramatsu
2009-12-09 20:38                           ` [PATCH v4] " Masami Hiramatsu
2009-12-10  0:09                             ` KOSAKI Motohiro
2009-12-02  0:18         ` [PATCH v2] mm: Introduce coredump parameter structure Andrew Morton
2009-12-02  0:27           ` KOSAKI Motohiro
2009-12-02  0:29           ` Masami Hiramatsu
2009-12-02  9:50             ` Ingo Molnar
2009-12-02 18:07               ` Masami Hiramatsu
2009-12-02  0:41           ` [PATCH v2] [RESEND] " Masami Hiramatsu

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=4B1D1E7C.8000806@redhat.com \
    --to=mhiramat@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dle-develop@lists.sourceforge.net \
    --cc=jbaron@redhat.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=roland@redhat.com \
    --cc=systemtap@sources.redhat.com \
    /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 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.