mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-04-24 15:54:41 +00:00
This makes breaking changes to add underscores to many non-standard
function names provided by the c library. MODE=tiny is now tinier and
we now use smaller locks that are better for tiny apps in this mode.
Some headers have been renamed to be in the same folder as the build
package, so it'll be easier to know which build dependency is needed.
Certain old misguided interfaces have been removed. Intel intrinsics
headers are now listed in libc/isystem (but not in the amalgamation)
to help further improve open source compatibility. Header complexity
has also been reduced. Lastly, more shell scripts are now available.
Compared to 6f7d0cb1c3
, some tiny corrections were made in libc/intrin/g_fds.c and libc/zipos/open.c including double semi colons and incorrect indentation for existing vista changes that were manually pulled from this commit previously.
55 lines
1.6 KiB
C
55 lines
1.6 KiB
C
#ifndef COSMOPOLITAN_LIBC_CALLS_STRACE_INTERNAL_H_
|
|
#define COSMOPOLITAN_LIBC_CALLS_STRACE_INTERNAL_H_
|
|
#include "libc/intrin/likely.h"
|
|
#include "libc/runtime/runtime.h"
|
|
|
|
#define _KERNTRACE 0 /* not configurable w/ flag yet */
|
|
#define _POLLTRACE 0 /* not configurable w/ flag yet */
|
|
#define _DATATRACE 1 /* not configurable w/ flag yet */
|
|
#define _NTTRACE 0 /* not configurable w/ flag yet */
|
|
|
|
#define STRACE_PROLOGUE "%rSYS %6P %'18T "
|
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
COSMOPOLITAN_C_START_
|
|
|
|
#ifdef SYSDEBUG
|
|
#define STRACE(FMT, ...) \
|
|
do { \
|
|
if (UNLIKELY(__strace > 0)) { \
|
|
__stracef(STRACE_PROLOGUE FMT "\n", ##__VA_ARGS__); \
|
|
} \
|
|
} while (0)
|
|
#else
|
|
#define STRACE(FMT, ...) (void)0
|
|
#endif
|
|
|
|
#if defined(SYSDEBUG) && _DATATRACE
|
|
#define DATATRACE(FMT, ...) STRACE(FMT, ##__VA_ARGS__)
|
|
#else
|
|
#define DATATRACE(FMT, ...) (void)0
|
|
#endif
|
|
|
|
#if defined(SYSDEBUG) && _POLLTRACE
|
|
#define POLLTRACE(FMT, ...) STRACE(FMT, ##__VA_ARGS__)
|
|
#else
|
|
#define POLLTRACE(FMT, ...) (void)0
|
|
#endif
|
|
|
|
#if defined(SYSDEBUG) && _KERNTRACE
|
|
#define KERNTRACE(FMT, ...) STRACE(FMT, ##__VA_ARGS__)
|
|
#else
|
|
#define KERNTRACE(FMT, ...) (void)0
|
|
#endif
|
|
|
|
#if defined(SYSDEBUG) && _NTTRACE
|
|
#define NTTRACE(FMT, ...) STRACE(FMT, ##__VA_ARGS__)
|
|
#else
|
|
#define NTTRACE(FMT, ...) (void)0
|
|
#endif
|
|
|
|
void __stracef(const char *, ...);
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
#endif /* COSMOPOLITAN_LIBC_CALLS_STRACE_INTERNAL_H_ */
|