From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Douglas Miller <dougmill@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [xmon PATCH 1/1] RFC: Add xmon command to dump process/task similar to ps(1)
Date: Wed, 11 Nov 2015 19:09:53 +1100 [thread overview]
Message-ID: <1447229393.31884.152.camel@kernel.crashing.org> (raw)
In-Reply-To: <56422051.8030505@linux.vnet.ibm.com>
On Tue, 2015-11-10 at 10:50 -0600, Douglas Miller wrote:
> +{
> + unsigned long tskv;
> + struct task_struct *tsk;
> +
> + if (scanhex(&tskv)) {
> + procshow((struct task_struct *)tskv);
> + } else {
> + for_each_process(tsk) {
> + procshow(tsk);
> + }
> + }
> +}
> +
The main thing is wrap it with the setjump magic that xmon uses for
other things that allows it to recover if you hit a bad pointer
along the way:
if (setjmp(bus_error_jmp) == 0) {
catch_memory_errors = 1;
sync();
... do your stuff...
sync();
}
catch_memory_errors = 0;
We could make some kind of helper or macro to factor that out
while it it ;-) (For bonus points !)
Cheers,
Ben.
next prev parent reply other threads:[~2015-11-11 8:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-10 15:31 [xmon PATCH 1/1] RFC: Add xmon command to dump process/task similar to ps(1) Douglas Miller
2015-11-10 16:50 ` Douglas Miller
2015-11-11 8:09 ` Benjamin Herrenschmidt [this message]
2015-11-13 15:58 ` Douglas Miller
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=1447229393.31884.152.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=dougmill@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.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 NNTP newsgroup(s).