public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: [PATCH] Add --core-pattern option to eu-stack
Date: Thu, 30 Oct 2014 22:55:41 +0100	[thread overview]
Message-ID: <1414706141.18323.39.camel@bordewijk.wildebeest.org> (raw)
In-Reply-To: 1414680839.18323.36.camel@bordewijk.wildebeest.org

[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]

On Thu, 2014-10-09 at 23:25 +0200, Jan Kratochvil wrote:
> To backtrace crashed thread from Linux core_pattern handler a special operation
> similar to PTRACE_ATTACH needs to be done.  This is implemented as a demo in
> eu-stack's core_pattern function invoked by eu-stack's --core-pattern option.

Cute! And I saw the %i support made it into the mainline kernel:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b03023ecbdb76c1dec86b41ed80b123c22783220

I did have to lookup how to use this though. And I couldn't make it work
without adding an -o option to eu-stack to explicitly redirect output
since it seems you cannot use normal shell redirections
in /proc/sys/kernel/core_pattern. So I had to use something like
--output=/proc/%p/cwd/%i.stack. Where does the stdout of the
core_pattern end up otherwise?

It would probably be good to have a full example usage in the --help
message (and tell people to look at man 5 core).

> The code of core_pattern function has been suggested by Oleg Nesterov.

I was wondering if we could make this a little more generically usable
and call it --wait-exit or something like that. So people could also use
it outside the core_pattern if they just want to get a backtrace for a
known thread when it exits.

> +      if (opt_core_pattern == true && show_one_tid == false)
> +	argp_error (state,
> +		    N_("--core-pattern requires -1"));

Why this restriction?

Thanks,

Mark


             reply	other threads:[~2014-10-30 21:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 21:55 Mark Wielaard [this message]
2014-11-03 13:22 Mark Wielaard
2014-11-26 14:32 Jan Kratochvil
2014-11-26 14:44 Jan Kratochvil
2014-11-26 14:47 Jan Kratochvil
2014-11-26 20:08 Oleg Nesterov
2014-11-26 20:26 Jan Kratochvil
2014-11-26 20:57 Oleg Nesterov
2014-11-27 11:04 Mark Wielaard
2014-11-27 11:05 Mark Wielaard
2014-11-27 11:17 Mark Wielaard
2014-11-27 21:27 Jan Kratochvil
2014-11-27 21:41 Jan Kratochvil
2014-11-27 21:47 Jan Kratochvil
2014-11-28 14:27 Mark Wielaard
2014-11-28 14:44 Mark Wielaard
2014-11-28 15:04 Mark Wielaard

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=1414706141.18323.39.camel@bordewijk.wildebeest.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@lists.fedorahosted.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 read-only IMAP folder(s) and NNTP newsgroup(s).