34 #define _STRUCTURED_PROC 1
37 #include <sys/types.h>
38 #include <sys/procfs.h>
39 #ifdef HAVE_SYS_SYSCALL_H
40 #include <sys/syscall.h>
42 #ifdef HAVE_SYS_FAULT_H
43 #include <sys/fault.h>
66 #define MAX_SYSCALLS 262
102 #ifdef SYS_afs_syscall
111 #ifdef SYS_alt_sigpending
117 #ifdef SYS_async_daemon
156 #ifdef SYS_cacheflush
159 #ifdef SYS_cancelblock
165 #ifdef SYS_cg_current
177 #ifdef SYS_cg_processors
198 #ifdef SYS_clock_getres
201 #ifdef SYS_clock_gettime
204 #ifdef SYS_clock_settime
249 #ifdef SYS_exec_with_loader
327 #ifdef SYS_fstatvfs64
336 #ifdef SYS_ftruncate64
345 #ifdef SYS_get_sysinfo
348 #ifdef SYS_getaddressconf
351 #ifdef SYS_getcontext
357 #ifdef SYS_getdents64
360 #ifdef SYS_getdirentries
363 #ifdef SYS_getdomainname
366 #ifdef SYS_getdtablesize
384 #ifdef SYS_gethostname
402 #ifdef SYS_getpagesize
405 #ifdef SYS_getpeername
420 #ifdef SYS_getpriority
426 #ifdef SYS_getrlimit64
435 #ifdef SYS_getsockname
438 #ifdef SYS_getsockopt
441 #ifdef SYS_gettimeofday
456 #ifdef SYS_install_utrap
483 #ifdef SYS_ksigaction
486 #ifdef SYS_ksigprocmask
537 #ifdef SYS_lwp_cond_broadcast
538 syscall_table[SYS_lwp_cond_broadcast] =
"lwp_cond_broadcast";
540 #ifdef SYS_lwp_cond_signal
543 #ifdef SYS_lwp_cond_wait
546 #ifdef SYS_lwp_continue
549 #ifdef SYS_lwp_create
555 #ifdef SYS_lwp_getprivate
564 #ifdef SYS_lwp_mutex_init
567 #ifdef SYS_lwp_mutex_lock
570 #ifdef SYS_lwp_mutex_trylock
573 #ifdef SYS_lwp_mutex_unlock
576 #ifdef SYS_lwp_private
582 #ifdef SYS_lwp_sema_post
585 #ifdef SYS_lwp_sema_trywait
588 #ifdef SYS_lwp_sema_wait
591 #ifdef SYS_lwp_setprivate
594 #ifdef SYS_lwp_sigredirect
597 #ifdef SYS_lwp_suspend
663 #ifdef SYS_msfs_syscall
708 #ifdef SYS_ngetpeername
711 #ifdef SYS_ngetsockname
726 #ifdef SYS_ntp_adjtime
729 #ifdef SYS_ntp_gettime
738 #ifdef SYS_old_accept
744 #ifdef SYS_old_getpeername
747 #ifdef SYS_old_getpgrp
750 #ifdef SYS_old_getsockname
753 #ifdef SYS_old_killpg
762 #ifdef SYS_old_recvfrom
765 #ifdef SYS_old_recvmsg
771 #ifdef SYS_old_sendmsg
774 #ifdef SYS_old_sigblock
777 #ifdef SYS_old_sigsetmask
780 #ifdef SYS_old_sigvec
786 #ifdef SYS_old_vhangup
825 #ifdef SYS_pid_unblock
855 #ifdef SYS_priocntllst
858 #ifdef SYS_priocntlset
861 #ifdef SYS_priocntlsys
867 #ifdef SYS_processor_bind
870 #ifdef SYS_processor_exbind
873 #ifdef SYS_processor_info
882 #ifdef SYS_proplist_syscall
933 #ifdef SYS_resolvepath
987 #ifdef SYS_set_program_attributes
988 syscall_table[SYS_set_program_attributes] =
"set_program_attributes";
990 #ifdef SYS_set_speculative
993 #ifdef SYS_set_sysinfo
996 #ifdef SYS_setcontext
999 #ifdef SYS_setdomainname
1011 #ifdef SYS_setgroups
1014 #ifdef SYS_sethostid
1017 #ifdef SYS_sethostname
1020 #ifdef SYS_setitimer
1032 #ifdef SYS_setpriority
1041 #ifdef SYS_setrlimit
1044 #ifdef SYS_setrlimit64
1050 #ifdef SYS_setsockopt
1053 #ifdef SYS_settimeofday
1062 #ifdef SYS_sgifastpath
1089 #ifdef SYS_sigaction
1092 #ifdef SYS_sigaltstack
1095 #ifdef SYS_sigaltstack
1104 #ifdef SYS_signotify
1107 #ifdef SYS_signotifywait
1110 #ifdef SYS_sigpending
1116 #ifdef SYS_sigprocmask
1122 #ifdef SYS_sigreturn
1125 #ifdef SYS_sigsendset
1128 #ifdef SYS_sigsendsys
1131 #ifdef SYS_sigsetmask
1137 #ifdef SYS_sigsuspend
1146 #ifdef SYS_sigwaitprim
1152 #ifdef SYS_so_socket
1155 #ifdef SYS_so_socketpair
1158 #ifdef SYS_sockconfig
1164 #ifdef SYS_socketpair
1188 #ifdef SYS_statvfs64
1197 #ifdef SYS_subsys_info
1218 #ifdef SYS_sysconfig
1236 #ifdef SYS_systeminfo
1245 #ifdef SYS_timedwait
1248 #ifdef SYS_timer_create
1251 #ifdef SYS_timer_delete
1254 #ifdef SYS_timer_getoverrun
1257 #ifdef SYS_timer_gettime
1260 #ifdef SYS_timer_settime
1269 #ifdef SYS_truncate64
1299 #ifdef SYS_usleep_thread
1305 #ifdef SYS_utc_adjtime
1308 #ifdef SYS_utc_gettime
1366 fprintf (file,
"<Unknown syscall %d> ", num);
1383 if (prismember (sysset, i))
1387 fprintf (file,
"\n");
1404 { 0,
"<no signal>",
"no signal" },
1409 { SIGINT,
"SIGINT",
"Interrupt (rubout)" },
1410 { SIGILL,
"SIGILL",
"Illegal instruction" },
1411 { SIGABRT,
"SIGABRT",
"used by abort()" },
1412 { SIGFPE,
"SIGFPE",
"Floating point exception" },
1413 { SIGSEGV,
"SIGSEGV",
"Segmentation violation" },
1414 { SIGTERM,
"SIGTERM",
"Software termination signal from kill" },
1419 { SIGHUP,
"SIGHUP",
"Hangup" },
1422 { SIGQUIT,
"SIGQUIT",
"Quit (ASCII FS)" },
1425 { SIGTRAP,
"SIGTRAP",
"Trace trap" },
1428 { SIGIOT,
"SIGIOT",
"IOT instruction" },
1431 { SIGEMT,
"SIGEMT",
"EMT instruction" },
1434 { SIGKILL,
"SIGKILL",
"Kill" },
1437 { SIGBUS,
"SIGBUS",
"Bus error" },
1440 { SIGSYS,
"SIGSYS",
"Bad argument to system call" },
1443 { SIGPIPE,
"SIGPIPE",
"Write to pipe with no one to read it" },
1446 { SIGALRM,
"SIGALRM",
"Alarm clock" },
1449 { SIGUSR1,
"SIGUSR1",
"User defined signal 1" },
1452 { SIGUSR2,
"SIGUSR2",
"User defined signal 2" },
1455 { SIGCHLD,
"SIGCHLD",
"Child status changed" },
1458 { SIGCLD,
"SIGCLD",
"Child status changed" },
1461 { SIGPWR,
"SIGPWR",
"Power-fail restart" },
1464 { SIGWINCH,
"SIGWINCH",
"Window size change" },
1467 { SIGURG,
"SIGURG",
"Urgent socket condition" },
1470 { SIGPOLL,
"SIGPOLL",
"Pollable event" },
1473 { SIGIO,
"SIGIO",
"Socket I/O possible" },
1476 { SIGSTOP,
"SIGSTOP",
"Stop, not from tty" },
1480 { SIGTSTP,
"SIGTSTP",
"User stop from tty" },
1483 { SIGCONT,
"SIGCONT",
"Stopped process has been continued" },
1486 { SIGTTIN,
"SIGTTIN",
"Background tty read attempted" },
1489 { SIGTTOU,
"SIGTTOU",
"Background tty write attempted" },
1492 { SIGVTALRM,
"SIGVTALRM",
"Virtual timer expired" },
1495 { SIGPROF,
"SIGPROF",
"Profiling timer expired" },
1498 { SIGXCPU,
"SIGXCPU",
"Exceeded CPU limit" },
1501 { SIGXFSZ,
"SIGXFSZ",
"Exceeded file size limit" },
1504 { SIGWAITING,
"SIGWAITING",
"Process's LWPs are blocked" },
1507 { SIGLWP,
"SIGLWP",
"Used by thread library" },
1510 { SIGFREEZE,
"SIGFREEZE",
"Used by CPR" },
1513 { SIGTHAW,
"SIGTHAW",
"Used by CPR" },
1516 { SIGCANCEL,
"SIGCANCEL",
"Used by libthread" },
1519 { SIGLOST,
"SIGLOST",
"Resource lost" },
1522 { SIG32,
"SIG32",
"Reserved for kernel usage (Irix)" },
1525 { SIGPTINTR,
"SIGPTINTR",
"Posix 1003.1b" },
1528 { SIGTRESCHED,
"SIGTRESCHED",
"Posix 1003.1b" },
1531 { SIGINFO,
"SIGINFO",
"Information request" },
1534 { SIGRESV,
"SIGRESV",
"Reserved by Digital for future use" },
1537 { SIGAIO,
"SIGAIO",
"Asynchronous I/O signal" },
1550 for (i = 0; i <
sizeof (
signal_table) /
sizeof (signal_table[0]); i++)
1551 if (signo == signal_table[i].
value)
1553 fprintf (file,
"%s", signal_table[i].
name);
1555 fprintf (file,
": %s\n", signal_table[i].
desc);
1557 fprintf (file,
" ");
1560 fprintf (file,
"Unknown signal %d%c", signo, verbose ?
'\n' :
' ');
1580 for (i = 0; i < NSIG; i++)
1581 if (prismember (sigset, i))
1585 fprintf (file,
"\n");
1602 { FLTILL,
"FLTILL",
"Illegal instruction" },
1605 { FLTPRIV,
"FLTPRIV",
"Privileged instruction" },
1608 { FLTBPT,
"FLTBPT",
"Breakpoint trap" },
1611 { FLTTRACE,
"FLTTRACE",
"Trace trap" },
1614 { FLTACCESS,
"FLTACCESS",
"Memory access fault" },
1617 { FLTBOUNDS,
"FLTBOUNDS",
"Memory bounds violation" },
1620 { FLTIOVF,
"FLTIOVF",
"Integer overflow" },
1623 { FLTIZDIV,
"FLTIZDIV",
"Integer zero divide" },
1626 { FLTFPE,
"FLTFPE",
"Floating-point exception" },
1629 { FLTSTACK,
"FLTSTACK",
"Unrecoverable stack fault" },
1632 { FLTPAGE,
"FLTPAGE",
"Recoverable page fault" },
1635 { FLTPCINVAL,
"FLTPCINVAL",
"Invalid PC exception" },
1638 { FLTWATCH,
"FLTWATCH",
"User watchpoint" },
1641 { FLTKWATCH,
"FLTKWATCH",
"Kernel watchpoint" },
1644 { FLTSCWATCH,
"FLTSCWATCH",
"Hit a store conditional on a watched page" },
1654 fprintf (file,
"%s", fault_table[i].
name);
1656 fprintf (file,
": %s\n", fault_table[i].
desc);
1658 fprintf (file,
" ");
1668 for (i = 0; i < ARRAY_SIZE (fault_table); i++)
1669 if (faultno == fault_table[i].
value)
1675 fprintf (file,
"Unknown hardware fault %d%c",
1676 faultno, verbose ?
'\n' :
' ');
1696 for (i = 0; i < ARRAY_SIZE (fault_table); i++)
1697 if (prismember (fltset, fault_table[i].
value))
1701 fprintf (file,
"\n");
void proc_prettyprint_actionset(struct sigaction *actions, int verbose)
static struct trans signal_table[]
void proc_prettyprint_syscalls(sysset_t *sysset, int verbose)
void proc_prettyprint_syscall(int num, int verbose)
void proc_prettyprint_fault(int faultno, int verbose)
void proc_prettyfprint_faultset(FILE *file, fltset_t *fltset, int verbose)
void proc_prettyprint_signalset(sigset_t *sigset, int verbose)
void proc_prettyprint_signal(int signo, int verbose)
static void init_syscall_table(void)
void proc_prettyprint_faultset(fltset_t *fltset, int verbose)
void proc_prettyfprint_syscalls(FILE *file, sysset_t *sysset, int verbose)
void _initialize_proc_events(void)
void proc_prettyfprint_signal(FILE *file, int signo, int verbose)
static void prettyfprint_faulttable_entry(FILE *file, int i, int verbose)
void proc_prettyfprint_fault(FILE *file, int faultno, int verbose)
void proc_prettyfprint_signalset(FILE *file, sigset_t *sigset, int verbose)
void proc_prettyfprint_syscall(FILE *file, int num, int verbose)
static char * syscall_table[MAX_SYSCALLS]