20 #ifndef _POSIX_KERNEL_LOGGING_H 21 #define _POSIX_KERNEL_LOGGING_H 23 #include "pedigree/kernel/process/Process.h" 24 #include "pedigree/kernel/process/Thread.h" 25 #include "pedigree/kernel/processor/Processor.h" 29 #define POSIX_VERBOSE_LOG(f, x) \ 32 auto ____tid = Processor::information().getCurrentThread()->getId(); \ 34 Processor::information().getCurrentThread()->getStateLevel(); \ 36 Processor::information().getCurrentThread()->getParent()->getId(); \ 38 "[" << f << ":\t" << Dec << ____pid << ":" << ____tid << "." \ 39 << ____level << Hex << "]\t" << x); \ 42 #define POSIX_VERBOSE_LOG(f, x) \ 45 NOTICE("[" << f << "]\t" << x); \ 51 #ifdef POSIX_LOG_FACILITIES 53 #if POSIX_LOG_FACILITIES & 1 54 #define POSIX_VERBOSE_FILE_SYSCALLS 57 #if POSIX_LOG_FACILITIES & 2 58 #define POSIX_VERBOSE_SYSTEM_SYSCALLS 61 #if POSIX_LOG_FACILITIES & 4 62 #define POSIX_VERBOSE_PTHREAD_SYSCALLS 65 #if POSIX_LOG_FACILITIES & 8 66 #define POSIX_VERBOSE_NET_SYSCALLS 69 #if POSIX_LOG_FACILITIES & 16 70 #define POSIX_VERBOSE_SIGNAL_SYSCALLS 73 #if POSIX_LOG_FACILITIES & 32 74 #define POSIX_VERBOSE_SUBSYSTEM 77 #if POSIX_LOG_FACILITIES & 64 78 #define POSIX_ULTRA_VERBOSE_SIGNAL_SYSCALLS 81 #if POSIX_LOG_FACILITIES & 128 82 #define POSIX_VERBOSE_SYSCALLS 85 #if POSIX_LOG_FACILITIES & 256 86 #define POSIX_VERBOSE_POLL_SYSCALLS 91 #ifdef POSIX_VERBOSE_SYSTEM_SYSCALLS 92 #define SC_NOTICE(x) POSIX_VERBOSE_LOG("sys", x) 97 #ifdef POSIX_VERBOSE_FILE_SYSCALLS 98 #define F_NOTICE(x) POSIX_VERBOSE_LOG("io", x) 103 #ifdef POSIX_VERBOSE_PTHREAD_SYSCALLS 104 #define PT_NOTICE(x) POSIX_VERBOSE_LOG("thr", x) 109 #ifdef POSIX_VERBOSE_NET_SYSCALLS 110 #define N_NOTICE(x) POSIX_VERBOSE_LOG("net", x) 115 #ifdef POSIX_VERBOSE_SIGNAL_SYSCALLS 116 #define SG_NOTICE(x) POSIX_VERBOSE_LOG("sig", x) 121 #ifdef POSIX_VERBOSE_SUBSYSTEM 122 #define PS_NOTICE(x) POSIX_VERBOSE_LOG("sub", x) 127 #ifdef POSIX_ULTRA_VERBOSE_SIGNAL_SYSCALLS 128 #define SG_VERBOSE_NOTICE(x) SG_NOTICE(x) 130 #define SG_VERBOSE_NOTICE(x) 133 #ifdef POSIX_VERBOSE_POLL_SYSCALLS 134 #define POLL_NOTICE(x) POSIX_VERBOSE_LOG("poll", x) 136 #define POLL_NOTICE(x) 139 #endif // _POSIX_KERNEL_LOGGING_H