Print this page
11689 ::refstr would be useful
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Jason King <jason.king@joyent.com>


4065             opt_dec ? "0t%lld\n" : "%#llr\n";
4066 
4067         mdb_printf(fmt, result);
4068         return (DCMD_OK);
4069 }
4070 
4071 void
4072 time_help(void)
4073 {
4074         mdb_printf("Prints the system time in nanoseconds.\n\n"
4075             "::time will return the timestamp at which we dropped into, \n"
4076             "if called from, kmdb(1); the core dump's high resolution \n"
4077             "time if inspecting one; or the running hires time if we're \n"
4078             "looking at a live system.\n\n"
4079             "Switches:\n"
4080             "  -d   report times in decimal\n"
4081             "  -l   prints the number of clock ticks since system boot\n"
4082             "  -x   report times in hexadecimal\n");
4083 }
4084 


4085 static const mdb_dcmd_t dcmds[] = {
4086 
4087         /* from genunix.c */
4088         { "as2proc", ":", "convert as to proc_t address", as2proc },
4089         { "binding_hash_entry", ":", "print driver names hash table entry",
4090                 binding_hash_entry },
4091         { "callout", "?[-r|n] [-s|l] [-xhB] [-t | -ab nsec [-dkD]]"
4092             " [-C addr | -S seqid] [-f name|addr] [-p name| addr] [-T|L [-E]]"
4093             " [-FivVA]",
4094             "display callouts", callout, callout_help },
4095         { "calloutid", "[-d|v] xid", "print callout by extended id",
4096             calloutid, calloutid_help },
4097         { "class", NULL, "print process scheduler classes", class },
4098         { "cpuinfo", "?[-v]", "print CPUs and runnable threads", cpuinfo },
4099         { "did2thread", "? kt_did", "find kernel thread for this id",
4100                 did2thread },
4101         { "errorq", "?[-v]", "display kernel error queues", errorq },
4102         { "fd", ":[fd num]", "get a file pointer from an fd", fd },
4103         { "flipone", ":", "the vik_rev_level 2 special", flipone },
4104         { "lminfo", NULL, "print lock manager information", lminfo },
4105         { "ndi_event_hdl", "?", "print ndi_event_hdl", ndi_event_hdl },
4106         { "panicinfo", NULL, "print panic information", panicinfo },
4107         { "pid2proc", "?", "convert PID to proc_t address", pid2proc },
4108         { "project", NULL, "display kernel project(s)", project },
4109         { "ps", "[-fltzTP]", "list processes (and associated thr,lwp)", ps,
4110             ps_help },
4111         { "pflags", NULL, "display various proc_t flags", pflags },
4112         { "pgrep", "[-x] [-n | -o] pattern",
4113                 "pattern match against all processes", pgrep },
4114         { "ptree", NULL, "print process tree", ptree },

4115         { "sysevent", "?[-sv]", "print sysevent pending or sent queue",
4116                 sysevent},
4117         { "sysevent_channel", "?", "print sysevent channel database",
4118                 sysevent_channel},
4119         { "sysevent_class_list", ":", "print sysevent class list",
4120                 sysevent_class_list},
4121         { "sysevent_subclass_list", ":",
4122                 "print sysevent subclass list", sysevent_subclass_list},
4123         { "system", NULL, "print contents of /etc/system file", sysfile },
4124         { "task", NULL, "display kernel task(s)", task },
4125         { "time", "[-dlx]", "display system time", time, time_help },
4126         { "vnode2path", ":[-F]", "vnode address to pathname", vnode2path },
4127         { "whereopen", ":", "given a vnode, dumps procs which have it open",
4128             whereopen },
4129 
4130         /* from bio.c */
4131         { "bufpagefind", ":addr", "find page_t on buf_t list", bufpagefind },
4132 
4133         /* from bitset.c */
4134         { "bitset", ":", "display a bitset", bitset, bitset_help },




4065             opt_dec ? "0t%lld\n" : "%#llr\n";
4066 
4067         mdb_printf(fmt, result);
4068         return (DCMD_OK);
4069 }
4070 
4071 void
4072 time_help(void)
4073 {
4074         mdb_printf("Prints the system time in nanoseconds.\n\n"
4075             "::time will return the timestamp at which we dropped into, \n"
4076             "if called from, kmdb(1); the core dump's high resolution \n"
4077             "time if inspecting one; or the running hires time if we're \n"
4078             "looking at a live system.\n\n"
4079             "Switches:\n"
4080             "  -d   report times in decimal\n"
4081             "  -l   prints the number of clock ticks since system boot\n"
4082             "  -x   report times in hexadecimal\n");
4083 }
4084 
4085 extern int cmd_refstr(uintptr_t, uint_t, int, const mdb_arg_t *);
4086 
4087 static const mdb_dcmd_t dcmds[] = {
4088 
4089         /* from genunix.c */
4090         { "as2proc", ":", "convert as to proc_t address", as2proc },
4091         { "binding_hash_entry", ":", "print driver names hash table entry",
4092                 binding_hash_entry },
4093         { "callout", "?[-r|n] [-s|l] [-xhB] [-t | -ab nsec [-dkD]]"
4094             " [-C addr | -S seqid] [-f name|addr] [-p name| addr] [-T|L [-E]]"
4095             " [-FivVA]",
4096             "display callouts", callout, callout_help },
4097         { "calloutid", "[-d|v] xid", "print callout by extended id",
4098             calloutid, calloutid_help },
4099         { "class", NULL, "print process scheduler classes", class },
4100         { "cpuinfo", "?[-v]", "print CPUs and runnable threads", cpuinfo },
4101         { "did2thread", "? kt_did", "find kernel thread for this id",
4102                 did2thread },
4103         { "errorq", "?[-v]", "display kernel error queues", errorq },
4104         { "fd", ":[fd num]", "get a file pointer from an fd", fd },
4105         { "flipone", ":", "the vik_rev_level 2 special", flipone },
4106         { "lminfo", NULL, "print lock manager information", lminfo },
4107         { "ndi_event_hdl", "?", "print ndi_event_hdl", ndi_event_hdl },
4108         { "panicinfo", NULL, "print panic information", panicinfo },
4109         { "pid2proc", "?", "convert PID to proc_t address", pid2proc },
4110         { "project", NULL, "display kernel project(s)", project },
4111         { "ps", "[-fltzTP]", "list processes (and associated thr,lwp)", ps,
4112             ps_help },
4113         { "pflags", NULL, "display various proc_t flags", pflags },
4114         { "pgrep", "[-x] [-n | -o] pattern",
4115                 "pattern match against all processes", pgrep },
4116         { "ptree", NULL, "print process tree", ptree },
4117         { "refstr", NULL, "print string from a refstr_t", cmd_refstr, NULL },
4118         { "sysevent", "?[-sv]", "print sysevent pending or sent queue",
4119                 sysevent},
4120         { "sysevent_channel", "?", "print sysevent channel database",
4121                 sysevent_channel},
4122         { "sysevent_class_list", ":", "print sysevent class list",
4123                 sysevent_class_list},
4124         { "sysevent_subclass_list", ":",
4125                 "print sysevent subclass list", sysevent_subclass_list},
4126         { "system", NULL, "print contents of /etc/system file", sysfile },
4127         { "task", NULL, "display kernel task(s)", task },
4128         { "time", "[-dlx]", "display system time", time, time_help },
4129         { "vnode2path", ":[-F]", "vnode address to pathname", vnode2path },
4130         { "whereopen", ":", "given a vnode, dumps procs which have it open",
4131             whereopen },
4132 
4133         /* from bio.c */
4134         { "bufpagefind", ":addr", "find page_t on buf_t list", bufpagefind },
4135 
4136         /* from bitset.c */
4137         { "bitset", ":", "display a bitset", bitset, bitset_help },