Skip to content
Snippets Groups Projects
Commit 7c907119 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

Merge branch 'tests' into 'master'

Tests

See merge request !22
parents 2e3cd780 23a00cd5
No related branches found
No related tags found
1 merge request!22Tests
Pipeline #51824 passed
......@@ -14,6 +14,8 @@ Checks: >
-readability-magic-numbers,
WarningsAsErrors: >
bugprone-*,
modernize-*,
clang-*,
readability-*,
performance-*,
......@@ -79,30 +79,22 @@ void worker_log(const std::string& prefix, const std::string& message);
template <LogSubsystem logSubsystem>
class Logger {
private:
static constexpr LogLevel getLevelFor(LogSubsystem system) {
static constexpr auto getLevelFor(LogSubsystem system) -> LogLevel {
switch (system) {
case LogSubsystem::PS:
return ALL;
case LogSubsystem::F:
return ALL;
case LogSubsystem::C:
return ALL;
case LogSubsystem::CM:
return ALL;
case LogSubsystem::DISP:
return ALL;
case LogSubsystem::SCHED:
return ALL;
case LogSubsystem::RUNTI:
return ALL;
case LogSubsystem::U_B_MPSC_Q:
return ALL;
default:
return ALL;
}
}
static constexpr char const* getTagFor(LogSubsystem system) {
static constexpr auto getTagFor(LogSubsystem system) -> char const* {
switch (system) {
case LogSubsystem::PS:
return "PS ";
......
......@@ -10,16 +10,19 @@
#include <sys/sysinfo.h> // for get_nprocs
#include <cstdlib> // for rand, srand, abort
#include <memory> // for __shared_ptr_access, shared_ptr
#include <cstring>
#include <memory> // for __shared_ptr_access, shared_ptr
#include <string> // for string
#include "Common.hpp" // for DIE_MSG_ERRNO, DIE, DIE_MSG
#include "ContextManager.hpp" // for ContextManager
#include "Debug.hpp" // for DBG, ABORT, LOGD, LOGE
#include "Dispatcher.hpp" // for Dispatcher
#include "Emper.hpp"
#include "Fiber.hpp" // for Fiber
#include "RuntimeStrategy.hpp" // for RuntimeStrategy
#include "RuntimeStrategyStats.hpp" // for RuntimeStrategyStats
#include "Fiber.hpp" // for Fiber
#include "RuntimeStrategy.hpp" // for RuntimeStrategy
#include "RuntimeStrategyStats.hpp" // for RuntimeStrategyStats
#include "lib/DebugUtil.hpp"
#include "strategies/ws/WsStrategy.hpp" // for WsStrategy, WsStrategy::INST...
#ifndef NDEBUG
......@@ -87,6 +90,13 @@ Runtime::Runtime(workerid_t workerCount, RuntimeStrategy& strategy, unsigned int
DIE_MSG("could not register printStats() with at_exit()");
}
}
const std::string stacktraceOnAbortsEnvVar("EMPER_STACKTRACE_ON_ABORTS");
const char* envValueEnableStacktraces = std::getenv(stacktraceOnAbortsEnvVar.c_str());
if (envValueEnableStacktraces && !std::strcmp(envValueEnableStacktraces, "true")) {
DBG(stacktraceOnAbortsEnvVar << " set to 'true': Enabling stacktrace on abort");
enableStacktraceOnAborts();
}
}
Runtime::~Runtime() {
......
......@@ -39,6 +39,7 @@ test_env = environment(
# memory will be initialized with 0x01, and that free'ed memory
# will be set to 0xFE (I think).
'MALLOC_PERTURB_': '1',
'EMPER_STACKTRACE_ON_ABORTS': 'true',
}
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment