From: Eugene Syromyatnikov Date: Wed, 7 Feb 2018 01:11:54 +0000 (+0100) Subject: sparc, sparc64: implement kern_features decoder X-Git-Tag: v4.22~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b46d5b8caf9fa7d2bac88812416c49f062b62031;p=strace sparc, sparc64: implement kern_features decoder * sparc.c: New file. * Makefile.am (EXTRA_DIST): Add it. * linux/sparc/syscallent.h ([340]): Remove NF flag, set kern_features decoder. * linux/sparc64/syscallent.h ([340]): Likewise. * xlat/sparc_kern_features.in: New file. * NEWS: Mention this enhancement. Co-Authored-by: Dmitry V. Levin --- diff --git a/Makefile.am b/Makefile.am index 8f1108ad..d43b03c4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -293,6 +293,7 @@ strace_SOURCES = \ sock.c \ sockaddr.c \ socketutils.c \ + sparc.c \ sram_alloc.c \ stat.c \ stat.h \ diff --git a/NEWS b/NEWS index d65738b7..e26ccb9c 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ Noteworthy changes in release ?.?? (????-??-??) * Implemented block/character device number printing in -yy mode. * Known pixel/SDR format names are printed as comments for pixelformat fields in v4l2 structures. + * Enhanced decoding of kern_features syscall. * Bug fixes * Fixed build on m68k. diff --git a/linux/sparc/syscallent.h b/linux/sparc/syscallent.h index a1974c2d..b6a378a8 100644 --- a/linux/sparc/syscallent.h +++ b/linux/sparc/syscallent.h @@ -338,7 +338,7 @@ [337] = { 2, TD, SEN(setns), "setns" }, [338] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, [339] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, -[340] = { 0, PU|NF, SEN(printargs), "kern_features" }, +[340] = { 0, PU, SEN(kern_features), "kern_features" }, [341] = { 5, 0, SEN(kcmp), "kcmp" }, [342] = { 3, TD, SEN(finit_module), "finit_module" }, [343] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, diff --git a/linux/sparc64/syscallent.h b/linux/sparc64/syscallent.h index 0b3530e3..fc2e921f 100644 --- a/linux/sparc64/syscallent.h +++ b/linux/sparc64/syscallent.h @@ -336,7 +336,7 @@ [337] = { 2, TD, SEN(setns), "setns" }, [338] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, [339] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, -[340] = { 0, PU|NF, SEN(printargs), "kern_features" }, +[340] = { 0, PU, SEN(kern_features), "kern_features" }, [341] = { 5, 0, SEN(kcmp), "kcmp" }, [342] = { 3, TD, SEN(finit_module), "finit_module" }, [343] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, diff --git a/sparc.c b/sparc.c new file mode 100644 index 00000000..8e8c8a2c --- /dev/null +++ b/sparc.c @@ -0,0 +1,46 @@ +/* + * SPARC-specific syscall decoders. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "defs.h" + +#if defined SPARC || defined SPARC64 + +# include "xlat/sparc_kern_features.h" + +SYS_FUNC(kern_features) +{ + if (entering(tcp) || syserror(tcp)) + return 0; + + tcp->auxstr = sprintflags("", sparc_kern_features, + (kernel_ulong_t) tcp->u_rval); + return RVAL_HEX | RVAL_STR; +} + +#endif /* SPARC || SPARC64 */ diff --git a/xlat/sparc_kern_features.in b/xlat/sparc_kern_features.in new file mode 100644 index 00000000..6c4b2d70 --- /dev/null +++ b/xlat/sparc_kern_features.in @@ -0,0 +1 @@ +KERN_FEATURE_MIXED_MODE_STACK 1