summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp
index db61bc2..44c377c 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -24,7 +24,13 @@
#include <unistd.h>
+#ifdef SCOPE_TRACING
thread_local int ScopeTrace::indent = 0;
+explicit ScopeTrace::ScopeTrace(char const *func) : f(func) {
+ fprintf(stderr, "%lu %*s%s -->\n", pthread_self(), 2 * indent++, "", this->f);
+}
+ScopeTrace::~ScopeTrace() { fprintf(stderr, "%lu %*s%s <--\n", pthread_self(), 2 * --indent, "", this->f); }
+#endif
unique_fd::~unique_fd() {
if (this->fd != -1) {