Skip to content

Commit

Permalink
#1051: trace: Fix incorrect trace name for invoke and remove localInv…
Browse files Browse the repository at this point in the history
…oke function from trace module
  • Loading branch information
JacobDomagala committed Dec 14, 2020
1 parent a31022f commit 3cfcf22
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 31 deletions.
20 changes: 13 additions & 7 deletions src/vt/runnable/invoke.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ static std::string CreateEventName() {

std::vector<std::string> arg_types = {TE::getTypeName<Args>()...};
auto argsV = DU::join(",", arg_types);
auto valueName =
TE::lastNamedPfType(TE::prettyFunctionForValue<FunctionType, f>(), "T"
);
auto valueName = TE::getValueName<FunctionType, f>();
auto barename = TE::getBarename(valueName);

return DU::removeSpaces(barename + "(" + argsV + ")");
Expand Down Expand Up @@ -140,11 +138,19 @@ struct CallableWrapper<Ret (Class::*)(Args...), f> {
template <typename Callable, Callable f, typename... Args>
static trace::TraceProcessingTag BeginProcessingInvokeEvent() {
const auto trace_id = CallableWrapper<Callable, f>::GetTraceID();
const auto trace_event = theTrace()->localInvoke(trace_id);
const auto trace_event = theTrace()->messageCreation(trace_id, 0);
const auto from_node = theContext()->getNode();

return theTrace()->beginProcessing(trace_id, 0, trace_event, from_node);
}

template <typename Callable, Callable f, typename... Args>
static void EndProcessingInvokeEvent(trace::TraceProcessingTag processing_tag) {
theTrace()->endProcessing(processing_tag);

const auto trace_id = CallableWrapper<Callable, f>::GetTraceID();
theTrace()->messageCreation(trace_id, 0);
}
#endif

template <
Expand Down Expand Up @@ -180,7 +186,7 @@ util::Copyable<Callable> invoke(Args&&... args) {
const auto& returnVal = invokeImpl(f, std::forward<Args>(args)...);

#if vt_check_enabled(trace_enabled)
theTrace()->endProcessing(processing_tag);
EndProcessingInvokeEvent<Callable, f>(processing_tag);
#endif

return returnVal;
Expand All @@ -196,7 +202,7 @@ util::NotCopyable<Callable> invoke(Args&&... args) {
auto&& returnVal = invokeImpl(f, std::forward<Args>(args)...);

#if vt_check_enabled(trace_enabled)
theTrace()->endProcessing(processing_tag);
EndProcessingInvokeEvent<Callable, f>(processing_tag);
#endif

return std::move(returnVal);
Expand All @@ -212,7 +218,7 @@ util::IsVoidReturn<Callable> invoke(Args&&... args) {
invokeImpl(f, std::forward<Args>(args)...);

#if vt_check_enabled(trace_enabled)
theTrace()->endProcessing(processing_tag);
EndProcessingInvokeEvent<Callable, f>(processing_tag);
#endif
}

Expand Down
13 changes: 0 additions & 13 deletions src/vt/trace/trace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -635,19 +635,6 @@ void Trace::endIdle(double const time) {
emitTraceForTopProcessingEvent(time, TraceConstantsType::BeginProcessing);
}

TraceEventIDType
Trace::localInvoke(TraceEntryIDType const ep, double const time) {
if (not checkDynamicRuntimeEnabled()) {
return no_trace_event;
}

auto const type = TraceConstantsType::Creation;

NodeType const node = theContext()->getNode();

return logEvent(LogType{time, ep, type, node, 0});
}

TraceEventIDType Trace::messageCreation(
TraceEntryIDType const ep, TraceMsgLenType const len, double const time
) {
Expand Down
11 changes: 0 additions & 11 deletions src/vt/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,17 +384,6 @@ struct Trace : runtime::component::Component<Trace> {
double const time = getCurrentTime()
);

/**
* \brief Log a local function invoke
*
* \param[in] ep the registered function's event ID
* \param[in] time the time of the event
*
* \return the trace event ID
*/
TraceEventIDType
localInvoke(TraceEntryIDType const ep, double const time = getCurrentTime());

/**
* \brief Log a message send
*
Expand Down

0 comments on commit 3cfcf22

Please sign in to comment.