]> granicus.if.org Git - strace/blobdiff - system.c
2003-07-28 Daniel Jacobowitz <drow@mvista.com>
[strace] / system.c
index 31768ad027dbd2b045c27b40f908c37bcad5336c..4c1aa59486fb363309f4d304f33841a49d66817d 100644 (file)
--- a/system.c
+++ b/system.c
@@ -72,7 +72,7 @@ struct pt_regs;
 #include <linux/utsname.h>
 #endif
 
-#ifdef HAVE_ASM_SYSMIPS_H
+#ifdef MIPS
 #include <asm/sysmips.h>
 #endif
 
@@ -2008,6 +2008,132 @@ struct tcb *tcp;
        return 0;
 }
 
+#ifdef HAVE_SYS_NSCSYS_H
+
+struct cred;
+#include <sys/nscsys.h>
+
+static struct xlat ssi_cmd [] = {
+       { SSISYS_BADOP, "SSISYS_BADOP"  },
+       { SSISYS_LDLVL_INIT,"SSISYS_LDLVL_INIT"},
+       { SSISYS_LDLVL_GETVEC,"SSISYS_LDLVL_GETVEC"},
+       { SSISYS_LDLVL_PUTVEC,"SSISYS_LDLVL_PUTVEC"},
+       { SSISYS_LDLVL_PUTRCMDS,"SSISYS_LDLVL_PUTRCMDS"},
+       { SSISYS_LDLVL_SETREXEC,"SSISYS_LDLVL_SETREXEC"},
+       { SSISYS_CMS_CLUSTERID,"SSISYS_CMS_CLUSTERID"},
+       { SSISYS_CFS_STATVFS,"SSISYS_CFS_STATVFS"},
+       { SSISYS_NODE_GETNUM,"SSISYS_NODE_GETNUM"},
+       { SSISYS_NODE_TABLE,"SSISYS_NODE_TABLE"},
+       { SSISYS_NODE_DOWN,"SSISYS_NODE_DOWN"},
+       { SSISYS_RECLAIM_CHILD,"SSISYS_RECLAIM_CHILD"},
+       { SSISYS_IPC_GETINFO,"SSISYS_IPC_GETINFO"},
+       { SSISYS_ICS_TEST,"SSISYS_ICS_TEST"},
+       { SSISYS_NODE_PID,"SSISYS_NODE_PID"},
+       { SSISYS_ISLOCAL,"SSISYS_ISLOCAL"},
+       { SSISYS_CFS_ISSTACKED,"SSISYS_CFS_ISSTACKED"},
+       { SSISYS_DNET_SYNC,"SSISYS_DNET_SYNC"},
+       { SSISYS_CFS_WAIT_MODE,"SSISYS_CFS_WAIT_MODE"},
+       { SSISYS_CFS_UMOUNT,"SSISYS_CFS_UMOUNT"},
+       { SSISYS_LLSTAT,"SSISYS_LLSTAT" },
+       { SSISYS_LTS_PERFTEST,"SSISYS_LTS_PERFTEST"},
+       { SSISYS_LTS_CONFIG,"SSISYS_LTS_CONFIG"},
+       { SSISYS_SNET_PERFTEST,"SSISYS_SNET_PERFTEST"},
+       { SSISYS_IGNORE_HALFUP,"SSISYS_IGNORE_HALFUP"},
+       { SSISYS_NODE_ROOTDEV,"SSISYS_NODE_ROOTDEV"},
+       { SSISYS_GET_PRIMARY,"SSISYS_GET_PRIMARY"},
+       { SSISYS_GET_SECONDARY,"SSISYS_GET_SECONDARY"},
+       { SSISYS_GET_ROOTDISK,"SSISYS_GET_ROOTDISK"},
+       { SSISYS_CLUSTERNODE_NUM,"SSISYS_CLUSTERNODE_NUM"},
+       { SSISYS_CLUSTER_MEMBERSHIP,"SSISYS_CLUSTER_MEMBERSHIP"},
+       { SSISYS_CLUSTER_DETAILEDTRANS,"SSISYS_CLUSTER_DETAILEDTRANS"},
+       { SSISYS_CLUSTERNODE_INFO,"SSISYS_CLUSTERNODE_INFO"},
+       { SSISYS_CLUSTERNODE_SETINFO,"SSISYS_CLUSTERNODE_SETINFO"},
+       { SSISYS_CLUSTERNODE_AVAIL,"SSISYS_CLUSTERNODE_AVAIL"},
+       { SSISYS_CLUSTER_MAXNODES,"SSISYS_CLUSTER_MAXNODES"},
+       { SSISYS_SET_MEMPRIO,"SSISYS_SET_MEMPRIO"},
+       { SSISYS_GET_USERS,"SSISYS_GET_USERS"},
+       { SSISYS_FORCE_ROOT_NODE,"SSISYS_FORCE_ROOT_NODE"},
+       { SSISYS_CVIP_SET,"SSISYS_CVIP_SET"},
+       { SSISYS_CVIP_GET,"SSISYS_CVIP_GET"},
+       { SSISYS_GET_NODE_COUNTS,"SSISYS_GET_NODE_COUNTS"},
+       { SSISYS_GET_TRANSPORT,"SSISYS_GET_TRANSPORT"},
+       { 0,            NULL            },
+};
+
+int sys_ssisys (tcp)
+struct tcb *tcp;
+{
+       struct ssisys_iovec iov;
+       cls_nodeinfo_args_t cni;
+       clusternode_info_t info;
+
+       if (entering (tcp)) {
+               ts_reclaim_child_inargs_t trc;
+               if (tcp->u_arg[1] != sizeof iov ||
+                   umove (tcp, tcp->u_arg[0], &iov) < 0)
+               {
+                       tprintf ("%#lx, %ld", tcp->u_arg[0], tcp->u_arg[1]);
+                       return 0;
+               }
+               tprintf ("{id=");
+               printxval(ssi_cmd, iov.tio_id.id_cmd, "SSISYS_???");
+               tprintf (":%d", iov.tio_id.id_ver);
+               switch (iov.tio_id.id_cmd) {
+                   case SSISYS_RECLAIM_CHILD:
+                       if (iov.tio_udatainlen != sizeof trc ||
+                           umove (tcp, (long) iov.tio_udatain, &trc) < 0)
+                               goto bad;
+                       tprintf (", in={pid=%ld, start=%ld}",
+                                trc.trc_pid, trc.trc_start);
+                       break;
+                   case SSISYS_CLUSTERNODE_INFO:
+                       if (iov.tio_udatainlen != sizeof cni ||
+                           umove (tcp, (long) iov.tio_udatain, &cni) < 0)
+                               goto bad;
+                       tprintf (", in={node=%ld, len=%d}",
+                                cni.nodenum, cni.info_len);
+                       break;
+                   default:
+                   bad:
+                       if (iov.tio_udatainlen) {
+                               tprintf (", in=[/* %d bytes */]",
+                                        iov.tio_udatainlen);
+                       }
+               }
+       }
+       else {
+               if (tcp->u_arg[1] != sizeof iov ||
+                   umove (tcp, tcp->u_arg[0], &iov) < 0)
+                   goto done;
+               switch (iov.tio_id.id_cmd) {
+                   case SSISYS_CLUSTERNODE_INFO:
+                       if (iov.tio_udatainlen != sizeof cni ||
+                           umove (tcp, (long) iov.tio_udatain, &cni) < 0)
+                               goto bad_out;
+                       if (cni.info_len != sizeof info || 
+                           iov.tio_udataoutlen != sizeof &info ||
+                           umove (tcp, (long) iov.tio_udataout, &info) < 0)
+                               goto bad_out;
+                       tprintf (", out={node=%ld, cpus=%d, online=%d}",
+                                info.node_num, info.node_totalcpus,
+                                info.node_onlinecpus);
+                       break;
+                       
+                   default:
+                   bad_out:
+                       if (iov.tio_udataoutlen) {
+                               tprintf (", out=[/* %d bytes */]",
+                                        iov.tio_udataoutlen);
+                       }
+               }
+           done:
+               tprintf ("}, %ld", tcp->u_arg[1]);
+       }
+       return 0;
+}
+
+#endif
+
 #endif /* UNIXWARE > 2 */
 
 #ifdef MIPS
@@ -2016,7 +2142,7 @@ struct tcb *tcp;
 #define __NEW_UTS_LEN 64
 #endif
 
-static struct xlat xlat_sysmips[] = {
+static struct xlat sysmips_operations[] = {
        { SETNAME,              "SETNAME"       },
        { FLUSH_CACHE,          "FLUSH_CACHE"   },
        { MIPS_FIXADE,          "MIPS_FIXADE"   },
@@ -2029,22 +2155,21 @@ int sys_sysmips(tcp)
 struct tcb *tcp;
 {
        if (entering(tcp)) {
-               printxval(xlat_sysmips, tcp->u_arg[0], "???");
-               tprintf(", ");
+               printxval(sysmips_operations, tcp->u_arg[0], "???");
                if (!verbose(tcp)) {
-                       tprintf("%d, %d, %d", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
+                       tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
                } else if (tcp->u_arg[0]==SETNAME) {
-                       char nodename[__NEW_UTS_LEN+1];
-                       if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN+1), nodename) < 0)
+                       char nodename[__NEW_UTS_LEN + 1];
+                       if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1), nodename) < 0)
                                tprintf(", %#lx", tcp->u_arg[1]);
                        else
                                tprintf(", \"%s\"", nodename);
-               } else if (tcp->u_arg[0]==MIPS_ATOMIC_SET) {
-                       tprintf(", %#lx, 0x%x", tcp->u_arg[1], tcp->u_arg[2]);
-               } else if (tcp->u_arg[0]==MIPS_FIXADE) {
-                       tprintf(", 0x%x", tcp->u_arg[1]);
+               } else if (tcp->u_arg[0] == MIPS_ATOMIC_SET) {
+                       tprintf(", %#lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]);
+               } else if (tcp->u_arg[0] == MIPS_FIXADE) {
+                       tprintf(", 0x%lx", tcp->u_arg[1]);
                } else {
-                       tprintf("%d, %d, %d", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
+                       tprintf("%ld, %ld, %ld", tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
                }
        }