mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +00:00
zdtm: show a process tree before and after c/r
Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
cc97a2d012
commit
1b234fd890
@@ -186,11 +186,15 @@ construct_root()
|
|||||||
{
|
{
|
||||||
local root=$1
|
local root=$1
|
||||||
local test_path=$2
|
local test_path=$2
|
||||||
|
local ps_path=`type -P ps`
|
||||||
local libdir=$root/lib
|
local libdir=$root/lib
|
||||||
local libdir2=$root/lib64
|
local libdir2=$root/lib64
|
||||||
|
|
||||||
|
mkdir $root/bin
|
||||||
|
cp $ps_path $root/bin
|
||||||
|
|
||||||
mkdir $libdir $libdir2
|
mkdir $libdir $libdir2
|
||||||
for i in `ldd $test_path | awk '{ print $1 }' | grep -v vdso`; do
|
for i in `ldd $test_path $ps_path | awk '/^\s/{ print $1 }' | grep -v vdso`; do
|
||||||
local lib=`basename $i`
|
local lib=`basename $i`
|
||||||
[ -f $libdir/$lib ] && continue ||
|
[ -f $libdir/$lib ] && continue ||
|
||||||
[ -f $i ] && cp $i $libdir && cp $i $libdir2 && continue ||
|
[ -f $i ] && cp $i $libdir && cp $i $libdir2 && continue ||
|
||||||
|
@@ -210,6 +210,13 @@ int ns_init(int argc, char **argv)
|
|||||||
ret = 1;
|
ret = 1;
|
||||||
waitpid(pid, &ret, 0);
|
waitpid(pid, &ret, 0);
|
||||||
|
|
||||||
|
|
||||||
|
pid = fork();
|
||||||
|
if (pid == 0) {
|
||||||
|
execl("/bin/ps", "ps", "axf", "-o", "pid,sid,comm", NULL);
|
||||||
|
} else if (pid > 0)
|
||||||
|
waitpid(pid, NULL, 0);
|
||||||
|
|
||||||
/* Daemonize */
|
/* Daemonize */
|
||||||
write(status_pipe, &ret, sizeof(ret));
|
write(status_pipe, &ret, sizeof(ret));
|
||||||
close(status_pipe);
|
close(status_pipe);
|
||||||
@@ -219,6 +226,12 @@ int ns_init(int argc, char **argv)
|
|||||||
/* suspend/resume */
|
/* suspend/resume */
|
||||||
test_waitsig();
|
test_waitsig();
|
||||||
|
|
||||||
|
pid = fork();
|
||||||
|
if (pid == 0) {
|
||||||
|
execl("/bin/ps", "ps", "axf", "-o", "pid,sid,comm", NULL);
|
||||||
|
} else if (pid > 0)
|
||||||
|
waitpid(pid, NULL, 0);
|
||||||
|
|
||||||
fd = open(pidfile, O_RDONLY);
|
fd = open(pidfile, O_RDONLY);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
fprintf(stderr, "open(%s) failed: %m\n", pidfile);
|
fprintf(stderr, "open(%s) failed: %m\n", pidfile);
|
||||||
|
Reference in New Issue
Block a user