runners: A number of stack/heap measurement tweaks
- Renamed BENCH_STACK/HEAP -> BENCH_STACK/HEAP_WATERMARK
- Renamed BENCH_YES_STACK/HEAP -> BENCH_STACK/HEAP
- Tweaked stack/heap watermarks to hopefully be easier to access when
debugging. Now also exposed as global variables
(bench_stack/heap_watermark).
I considered changing BENCH_STACK/HEAP_WATERMARK to be the variable
itself, to be consistent with TEST_PLS, but decided against it:
1. BENCH_STACK_CURRENT() is a bit magic in that it relies on
__attribute__((noinline)) to force a new stack frame. This wouldn't
really be possible with a variable.
2. TEST_PLS is at least constant from the _current run_'s perspective.
This isn't true for the stack/heap watermarks.
- Reworked internals a bit to hopefully be simpler
This commit is contained in:
+16
-16
@@ -83,11 +83,11 @@ code = '''
|
||||
BENCH_STOP("write", written);
|
||||
|
||||
// report the total stack/heap usage after the benchmark
|
||||
#ifdef BENCH_YES_STACK
|
||||
BENCH_RESULT("stack", written, BENCH_STACK());
|
||||
#ifdef BENCH_STACK
|
||||
BENCH_RESULT("stack", written, BENCH_STACK_WATERMARK());
|
||||
#endif
|
||||
#ifdef BENCH_YES_HEAP
|
||||
BENCH_RESULT("heap", written, BENCH_HEAP());
|
||||
#ifdef BENCH_HEAP
|
||||
BENCH_RESULT("heap", written, BENCH_HEAP_WATERMARK());
|
||||
#endif
|
||||
|
||||
// find the total disk usage after the benchmark
|
||||
@@ -144,11 +144,11 @@ code = '''
|
||||
BENCH_STOP("write", written);
|
||||
|
||||
// report the total stack/heap usage after the benchmark
|
||||
#ifdef BENCH_YES_STACK
|
||||
BENCH_RESULT("stack", written, BENCH_STACK());
|
||||
#ifdef BENCH_STACK
|
||||
BENCH_RESULT("stack", written, BENCH_STACK_WATERMARK());
|
||||
#endif
|
||||
#ifdef BENCH_YES_HEAP
|
||||
BENCH_RESULT("heap", written, BENCH_HEAP());
|
||||
#ifdef BENCH_HEAP
|
||||
BENCH_RESULT("heap", written, BENCH_HEAP_WATERMARK());
|
||||
#endif
|
||||
|
||||
// find the total disk usage after the benchmark
|
||||
@@ -223,11 +223,11 @@ code = '''
|
||||
BENCH_STOP("write", written);
|
||||
|
||||
// report the total stack/heap usage after the benchmark
|
||||
#ifdef BENCH_YES_STACK
|
||||
BENCH_RESULT("stack", written, BENCH_STACK());
|
||||
#ifdef BENCH_STACK
|
||||
BENCH_RESULT("stack", written, BENCH_STACK_WATERMARK());
|
||||
#endif
|
||||
#ifdef BENCH_YES_HEAP
|
||||
BENCH_RESULT("heap", written, BENCH_HEAP());
|
||||
#ifdef BENCH_HEAP
|
||||
BENCH_RESULT("heap", written, BENCH_HEAP_WATERMARK());
|
||||
#endif
|
||||
|
||||
// find the total disk usage after the benchmark
|
||||
@@ -292,11 +292,11 @@ code = '''
|
||||
BENCH_STOP("write", written);
|
||||
|
||||
// report the total stack/heap usage after the benchmark
|
||||
#ifdef BENCH_YES_STACK
|
||||
BENCH_RESULT("stack", written, BENCH_STACK());
|
||||
#ifdef BENCH_STACK
|
||||
BENCH_RESULT("stack", written, BENCH_STACK_WATERMARK());
|
||||
#endif
|
||||
#ifdef BENCH_YES_HEAP
|
||||
BENCH_RESULT("heap", written, BENCH_HEAP());
|
||||
#ifdef BENCH_HEAP
|
||||
BENCH_RESULT("heap", written, BENCH_HEAP_WATERMARK());
|
||||
#endif
|
||||
|
||||
// find the total disk usage after the benchmark
|
||||
|
||||
Reference in New Issue
Block a user