• Andrew Vagin's avatar
    pstree: use rbtree to find a specified pid (v3) · 42205175
    Andrew Vagin authored
    Currently we enumirate all children of the init task and
    if a task isn't a session leader, we create a helper,
    collect all children with this sid to the children list of this helper.
    
    When all children of the init task has been enumirated, we try to find
    a session leader for each helper.
    
    We use this way to enumirate all tasks only once.
    
    Now we are going to collect all tasks in rbtree, so we can find
    a sessial leader when we need it. It will not affect performance,
    because without searching a session leader, we can't add a helper
    to the tree.
    
    v2: rename lookup_pid to pstree_pid_by_virt
        use pstree_pid_by_virt in pstree_item_by_virt
    v3: handle session leaders in this patch too
    Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    42205175
Name
Last commit
Last update
Documentation Loading commit data...
contrib Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
lib Loading commit data...
scripts Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...