Implement kcmp syscall decoding

* kcmp.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/dummy.h (sys_kcmp): Remove stub alias.
* xlat/kcmp_types.in: New file.
This commit is contained in:
Дмитрий Левин 2015-11-22 18:35:27 +00:00
parent dcd00c3943
commit 7aa9c0d299
4 changed files with 39 additions and 1 deletions

View File

@ -82,6 +82,7 @@ strace_SOURCES = \
ipc_sem.c \
ipc_shm.c \
ipc_shmctl.c \
kcmp.c \
kexec.c \
keyctl.c \
ldt.c \

31
kcmp.c Normal file
View File

@ -0,0 +1,31 @@
#include "defs.h"
#include "xlat/kcmp_types.h"
SYS_FUNC(kcmp)
{
pid_t pid1 = tcp->u_arg[0];
pid_t pid2 = tcp->u_arg[1];
int type = tcp->u_arg[2];
unsigned long idx1 = tcp->u_arg[3];
unsigned long idx2 = tcp->u_arg[4];
tprintf("%d, %d, ", pid1, pid2);
printxval(kcmp_types, type, "KCMP_???");
switch(type) {
case KCMP_FILE:
tprintf(", %u, %u", (unsigned) idx1, (unsigned) idx2);
break;
case KCMP_FILES:
case KCMP_FS:
case KCMP_IO:
case KCMP_SIGHAND:
case KCMP_SYSVSEM:
case KCMP_VM:
break;
default:
tprintf(", %#lx, %#lx", idx1, idx2);
}
return RVAL_DECODED;
}

View File

@ -32,7 +32,6 @@
#endif
/* still unfinished */
#define sys_kcmp printargs
#define sys_kexec_file_load printargs
#define sys_lookup_dcookie printargs
#define sys_name_to_handle_at printargs

7
xlat/kcmp_types.in Normal file
View File

@ -0,0 +1,7 @@
KCMP_FILE 0
KCMP_VM 1
KCMP_FILES 2
KCMP_FS 3
KCMP_SIGHAND 4
KCMP_IO 5
KCMP_SYSVSEM 6