aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/truss/i386-linux.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2016-01-26 19:07:09 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2016-01-26 19:07:09 +0000
commita5f14abfd231777ed4f1ab2e7d4aeeb4418156f2 (patch)
tree817dc34ebf9af56aa355e84eee2cf55753669285 /usr.bin/truss/i386-linux.c
parent4c1ca03b46d7bf883e75fc1643d9ddfd2c35ec0b (diff)
downloadsrc-a5f14abfd231777ed4f1ab2e7d4aeeb4418156f2.tar.gz
src-a5f14abfd231777ed4f1ab2e7d4aeeb4418156f2.zip
Add support to libsysdecode for decoding system call names.
A new sysdecode_syscallname() function accepts a system call code and returns a string of the corresponding name (or NULL if the code is unknown). To support different process ABIs, the new function accepts a value from a new sysdecode_abi enum as its first argument to select the ABI in use. Current ABIs supported include FREEBSD (native binaries), FREEBSD32, LINUX, LINUX32, and CLOUDABI64. Note that not all ABIs are supported by all platforms. In general, a given ABI is only supported if a platform can execute binaries for that ABI. To simplify the implementation, libsysdecode's build reuses the existing pre-generated files from the kernel source tree rather than duplicating new copies of said files during the build. kdump(1) and truss(1) now use these functions to map system call identifiers to names. For kdump(1), a new 'syscallname()' function consolidates duplicated code from ktrsyscall() and ktrsyscallret(). The Linux ABI no longer requires custom handling for ktrsyscall() and linux_ktrsyscall() has been removed as a result. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4823
Notes
Notes: svn path=/head/; revision=294849
Diffstat (limited to 'usr.bin/truss/i386-linux.c')
-rw-r--r--usr.bin/truss/i386-linux.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/truss/i386-linux.c b/usr.bin/truss/i386-linux.c
index 91662711676b..5fdae8ee958c 100644
--- a/usr.bin/truss/i386-linux.c
+++ b/usr.bin/truss/i386-linux.c
@@ -40,11 +40,10 @@ __FBSDID("$FreeBSD$");
#include <machine/psl.h>
#include <stdio.h>
+#include <sysdecode.h>
#include "truss.h"
-#include "i386-linux_syscalls.h"
-
static int
i386_linux_fetch_args(struct trussinfo *trussinfo, u_int narg)
{
@@ -131,8 +130,7 @@ i386_linux_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp)
static struct procabi i386_linux = {
"Linux ELF32",
- syscallnames,
- nitems(syscallnames),
+ LINUX,
i386_linux_fetch_args,
i386_linux_fetch_retval
};