Make some systemic improvements

- add vdso dump utility
- tests now log stack usage
- rename g_ftrace to __ftrace
- make internal spinlocks go faster
- add conformant c11 atomics library
- function tracing now logs stack usage
- make function call tracing thread safe
- add -X unsecure (no ssl) mode to redbean
- munmap() has more consistent behavior now
- pacify fsync() calls on python unit tests
- make --strace flag work better in redbean
- start minimizing and documenting compiler flags
This commit is contained in:
Justine Tunney 2022-05-18 16:41:29 -07:00
parent c6bbca55e9
commit 9208c83f7a
141 changed files with 1948 additions and 1411 deletions

View file

@ -18,4 +18,25 @@
*/
#include "libc/runtime/runtime.h"
int g_ftrace;
/**
* Function tracing enabled state.
*
* After ftrace_install() has been called, the logging of C function
* calls may be controlled by changing this variable. If `__ftrace` is
* greater than zero, functions are logged. Otherwise, they aren't.
*
* By convention, functions wishing to disable function tracing for a
* short time period should say:
*
* void foo() {
* --__ftrace;
* bar();
* ++__ftrace;
* }
*
* This way you still have some flexibility to force function tracing,
* by setting `__ftrace` to a higher number like `2` or `200`. Even
* though under normal circumstances, `__ftrace` should only be either
* zero or one.
*/
_Atomic(int) __ftrace;