<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Dave Anderson wrote:
<blockquote TYPE=CITE>Guy Streeter wrote:
<blockquote TYPE=CITE>How can I find out what other tasks are threads of
(or with) a given
<br>task?
<p>--Guy</blockquote>
<p><br><tt>There's no direct command to do it. But, for example,</tt>
<br><tt>all threads of a task should have the same name and the</tt>
<br><tt>same task->tgid right?</tt>
<p><tt>So for example, I just executed a task named "mkthreads", pid 27610,</tt>
<br><tt>which in turn creates 10 threads of itself, all of which will have</tt>
<br><tt>the same task->tgid:</tt>
<p><tt>crash> foreach mkthreads task | grep -e COMMAND -e tgid</tt>
<br><tt>PID: 27610 TASK: ddb2c000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>PID: 27611 TASK: c82de000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>PID: 27612 TASK: d016a000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>PID: 27613 TASK: c3f2e000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>PID: 27614 TASK: db95e000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>PID: 27615 TASK: d6dfa000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>PID: 27616 TASK: ddad6000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>PID: 27617 TASK: cd1a4000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>PID: 27618 TASK: d45de000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>PID: 27619 TASK: cef58000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>PID: 27620 TASK: cdc38000 CPU: 0 COMMAND:
"mkthreads"</tt>
<br><tt> tgid = 27610,</tt>
<br><tt>crash></tt>
<p><tt>Dave</tt></blockquote>
I'll whip up a "ps -g" option for the next release, whlch will look
<br>like "ps -c" in that, for each task whose pid equals its tgid, will
<br>then list its threads indented underneath.
<p>(BTW, I've implemented your previous suggestion for a ps
<br>option to dump the full command line and all of a task's
<br>environment variable dumps as well...)
<p>Thanks,
<br> Dave
<br> </html>