diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-06-17 00:14:54 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-06-17 00:14:54 +0000 |
commit | 4198293b2568c3fa287e7bde71162e9d442f4305 (patch) | |
tree | 8cfbc1a406237f68a9a68a544eb0b3129d6312ea /tools | |
parent | 24d58133b7f7836aa02c66016f62b2a8d452ea18 (diff) | |
parent | f2eb97b2cded8209e6d0d35930507dcfcf5bc794 (diff) | |
download | src-4198293b2568c3fa287e7bde71162e9d442f4305.tar.gz src-4198293b2568c3fa287e7bde71162e9d442f4305.zip |
Merge ^/head r319801 through r320041.
Notes
Notes:
svn path=/projects/clang500-import/; revision=320042
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/geom_gpt/gctl_test.t | 17 | ||||
-rw-r--r-- | tools/test/ptrace/scescx.c | 26 |
2 files changed, 41 insertions, 2 deletions
diff --git a/tools/regression/geom_gpt/gctl_test.t b/tools/regression/geom_gpt/gctl_test.t index 9a954dee610e..f8bceaa2f52e 100644 --- a/tools/regression/geom_gpt/gctl_test.t +++ b/tools/regression/geom_gpt/gctl_test.t @@ -144,7 +144,17 @@ my $out = basename($cmd) . ".out"; # Make sure we have permission to use gctl... if (`$cmd` =~ "^FAIL Permission denied") { print "1..0 # SKIP insufficient permissions\n"; - unlink $cmd; + exit 0; +} + +my $debugflags_oid = 'kern.geom.debugflags'; +chomp(my $old_geom_debugflags = `sysctl -n $debugflags_oid`); +if ($? != 0) { + print "1..0 # SKIP could not query $debugflags_oid\n"; + exit 0; +} +if (system("sysctl $debugflags_oid=0") != 0) { + print "1..0 # SKIP could not set $debugflags_oid=0\n"; exit 0; } @@ -227,4 +237,7 @@ foreach my $key (sort keys %steps) { } $nr += 1; } -exit 0; +END { + system("sysctl $debugflags_oid=$old_geom_debugflags"); + unlink($cmd); +} diff --git a/tools/test/ptrace/scescx.c b/tools/test/ptrace/scescx.c index cdd8b6014946..782a43d69bf4 100644 --- a/tools/test/ptrace/scescx.c +++ b/tools/test/ptrace/scescx.c @@ -97,6 +97,11 @@ decode_pl_flags(struct ptrace_lwpinfo *lwpinfo) { PL_FLAG_EXEC, "EXEC" }, { PL_FLAG_SI, "SI" }, { PL_FLAG_FORKED, "FORKED" }, + { PL_FLAG_CHILD, "CHILD" }, + { PL_FLAG_BORN, "LWPBORN" }, + { PL_FLAG_EXITED, "LWPEXITED" }, + { PL_FLAG_VFORKED, "VFORKED" }, + { PL_FLAG_VFORK_DONE, "VFORKDONE" }, }; char de[32]; unsigned first, flags, i; @@ -176,12 +181,33 @@ get_pathname(pid_t pid) static void wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo) { + long *args; + int error, i; printf(TRACE "pid %d wait %s", pid, decode_wait_status(status)); if (lwpinfo != NULL) { printf(" event %s flags %s", decode_pl_event(lwpinfo), decode_pl_flags(lwpinfo)); + if ((lwpinfo->pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)) != 0) { + printf(" sc%d", lwpinfo->pl_syscall_code); + args = calloc(lwpinfo->pl_syscall_narg, sizeof(long)); + error = ptrace(PT_GET_SC_ARGS, lwpinfo->pl_lwpid, + (caddr_t)args, lwpinfo->pl_syscall_narg * + sizeof(long)); + if (error == 0) { + for (i = 0; i < (int)lwpinfo->pl_syscall_narg; + i++) { + printf("%c%#lx", i == 0 ? '(' : ',', + args[i]); + } + } else { + fprintf(stderr, "PT_GET_SC_ARGS failed: %s", + strerror(errno)); + } + printf(")"); + free(args); + } } printf("\n"); } |