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

@ -22,6 +22,7 @@
#include "libc/calls/struct/sigset.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/intrin/kprintf.h"
#include "libc/intrin/spinlock.h"
#include "libc/macros.internal.h"
#include "libc/nexgen32e/threaded.h"
@ -40,20 +41,26 @@
#define ENTRIES 256
char locks[THREADS];
volatile bool ready;
_Atomic(bool) ready;
volatile uint64_t A[THREADS * ENTRIES];
void OnChld(int sig) {
// do nothing
}
dontinline void Pause(void) {
__builtin_ia32_pause();
}
dontinline void Generate(int i) {
A[i] = rand64();
}
int Thrasher(void *arg) {
int i, id = (intptr_t)arg;
while (!ready) {
__builtin_ia32_pause();
}
while (!ready) Pause();
for (i = 0; i < ENTRIES; ++i) {
A[id * ENTRIES + i] = rand64();
Generate(id * ENTRIES + i);
}
_spunlock(locks + id);
return 0;