Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPL: properly install o2-log #12639

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Framework/Core/src/runDataProcessing.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2951,6 +2951,7 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,
}
}

static pid_t pid = getpid();
if (varmap.count("signposts")) {
auto signpostsToEnable = varmap["signposts"].as<std::string>();
auto matchingLogEnabler = [](char const* name, void* l, void* context) {
Expand All @@ -2961,6 +2962,8 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,
LOGP(info, "Enabling signposts for {}", *selectedName);
_o2_log_set_stacktrace(log, 1);
return false;
} else {
LOGP(info, "Signpost stream \"{}\" disabled. Enable it with o2-log -p {} -a {}", name, pid, (void*)&log->stacktrace);
}
return true;
};
Expand All @@ -2972,6 +2975,13 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,
o2_walk_logs(matchingLogEnabler, token);
token = strtok_r(nullptr, ",", &saveptr);
}
} else {
auto printAllSignposts = [](char const* name, void* l, void* context) {
auto* log = (_o2_log_t*)l;
LOGP(detail, "Signpost stream {} disabled. Enable it with o2-log -p {} -a {}", name, pid, (void*)&log->stacktrace);
return true;
};
o2_walk_logs(printAllSignposts, nullptr);
}

auto evaluateBatchOption = [&varmap]() -> bool {
Expand Down
1 change: 1 addition & 0 deletions Framework/Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ set_property(TARGET o2-test-framework-SignpostLogger PROPERTY RUNTIME_OUTPUT_DIR
set_property(TARGET o2-test-framework-ThreadSanitizer PROPERTY RUNTIME_OUTPUT_DIRECTORY ${outdir})
get_filename_component(bindir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/../bin ABSOLUTE)
set_property(TARGET o2-log PROPERTY RUNTIME_OUTPUT_DIRECTORY ${bindir})
install(TARGETS o2-log RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

add_test(NAME framework:foundation COMMAND o2-test-framework-foundation)

Expand Down
Loading