]> granicus.if.org Git - strace/commitdiff
sparc, sparc64: implement kern_features decoder
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 7 Feb 2018 01:11:54 +0000 (02:11 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 27 Mar 2018 22:22:23 +0000 (22:22 +0000)
* 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 <ldv@altlinux.org>
Makefile.am
NEWS
linux/sparc/syscallent.h
linux/sparc64/syscallent.h
sparc.c [new file with mode: 0644]
xlat/sparc_kern_features.in [new file with mode: 0644]

index 8f1108ad9f1db9e500dd61a2aa952c51205393a0..d43b03c4e58b870d4faff51969adee4cd5802ec1 100644 (file)
@@ -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 d65738b75499c4f5dc08fc041a57315b3070189b..e26ccb9cfb6182730e9f09472c9b3e7ba4f16bf2 100644 (file)
--- 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.
index a1974c2d123748b2c612c006e7875e6978c2c3bd..b6a378a842863328bb644d48a55b43ab061000a9 100644 (file)
 [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"         },
index 0b3530e331b5b627f9f3cf4f5a8f285c119c22c0..fc2e921f3cf32803bd9fbf1ea00e50fa4d6eaa2d 100644 (file)
 [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 (file)
index 0000000..8e8c8a2
--- /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 (file)
index 0000000..6c4b2d7
--- /dev/null
@@ -0,0 +1 @@
+KERN_FEATURE_MIXED_MODE_STACK 1