public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ethan Wilson <ethan.wilson@shiftmail.org>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: How to get kernel stack trace if process not blocked?
Date: Sun, 17 Aug 2014 12:06:48 +0200	[thread overview]
Message-ID: <53F07EB8.5060201@shiftmail.org> (raw)

Hello list,
cat /proc/pid/stack shows the kernel call stack of a process, and this 
is so good, but it will show just 0xffffffffffffffff if the process is 
running in kernel space and not blocked (sleeping).
With just an 0xffffffffffffffff  AFAIU it is also impossible to 
distinguish a process running in kernel space from a process running in 
user space.

It would be *very* useful to get the kernel stack trace for a running 
process, even if imprecise, or at least knowing the name of the kernel 
function executing now (top of the stack). Why is it not doable?

I tried to disable CONFIG_SCHED_OMIT_FRAME_POINTER but it didn't allow 
to print the stack from /proc/pid/stack anyway. What is the benefit of 
disabling such kernel option (i.e. having the frame pointer)?

I guessed that maybe with EIP from /proc/pid/stat it is possible to do 
something like that but I can't find much information on how to do that.

Thanks for any information
EW


                 reply	other threads:[~2014-08-17 10:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=53F07EB8.5060201@shiftmail.org \
    --to=ethan.wilson@shiftmail.org \
    --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