show thread as process

Denys Vlasenko vda.linux at googlemail.com
Sat Sep 19 20:29:11 UTC 2009


On Thursday 17 September 2009 10:24, Fabian Meier wrote:
> Hi
> 
> The behaviour of ps with linuxthreads is different from nptl. A thread is
> listed as a process with linuxthreads. With nptl you see only the real
> process.
> I modified props_scan so it can also work with threads(tasks) by scanning
> /proc/<process>/task/*. I also added a config option in ps for that feature.

+config FEATURE_PS_SHOW_THREADS
+       bool "Show thread as process"
+       default n
+       depends on PS
+       help
+         Show threads as if they were processes (as it was with linuxthreads)

It's better to create FEATURE_SHOW_THREADS with help text
"enables option -T for ps and a <corresponding option>
(or <corresponding> keyboard command) for top"


+/* ENABLE_FEATURE_PS_SHOW_THREADS */
+       DIR *task_dir;
+       bool is_last_task;
+/* END ENABLE_FEATURE_PS_SHOW_THREADS */

Yes, this really needs to be #ifdefed out.

Please try attached patch.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 8.patch
Type: text/x-diff
Size: 8205 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090919/3c6a894e/attachment.bin>


More information about the busybox mailing list