diff --git a/kratos/sources/profiler.cpp b/kratos/sources/profiler.cpp index 44ecd99c371..a2d9dc35b7b 100644 --- a/kratos/sources/profiler.cpp +++ b/kratos/sources/profiler.cpp @@ -207,7 +207,8 @@ void Profiler::Write(std::ostream& rStream) const const auto& r_location = p_item->mLocation; result.AddString("file", std::string(r_location.GetFileName())); result.AddInt("line", int(r_location.GetLineNumber())); - result.AddString("function", std::string(r_location.GetFunctionName())); + result.AddString("signature", std::string(r_location.GetFunctionName())); + result.AddString("function", std::string(r_location.CleanFunctionName())); result.AddInt("callCount", p_item->mCallCount); std::stringstream stream; diff --git a/kratos/utilities/profiler.h b/kratos/utilities/profiler.h index 238f6592877..55f2aca084e 100644 --- a/kratos/utilities/profiler.h +++ b/kratos/utilities/profiler.h @@ -71,20 +71,19 @@ class KRATOS_API(KRATOS_CORE) Profiler struct SourceLocationHash { - std::size_t operator()(const CodeLocation& r_argument) const + std::size_t operator()(const CodeLocation& rArgument) const { - std::string string(r_argument.GetFileName()); - string.append(std::to_string(r_argument.GetLineNumber())); - return std::hash()(string); + return std::hash()(rArgument.GetFileName() + rArgument.GetFunctionName()); } }; struct SourceLocationEquality { - bool operator()(const CodeLocation& r_lhs, - const CodeLocation& r_rhs) const + bool operator()(const CodeLocation& rLhs, + const CodeLocation& rRhs) const { - return (std::string(r_lhs.GetFileName()) == std::string(r_rhs.GetFileName())) && (r_lhs.GetLineNumber() == r_rhs.GetLineNumber()); + return (rLhs.GetFileName() == rRhs.GetFileName()) + && (rLhs.GetFunctionName() == rRhs.GetFunctionName()); } }; diff --git a/kratos/utilities/profiler_impl.h b/kratos/utilities/profiler_impl.h index c52b8d7721a..4b274586727 100644 --- a/kratos/utilities/profiler_impl.h +++ b/kratos/utilities/profiler_impl.h @@ -16,7 +16,6 @@ #include "utilities/profiler.h" // <== help the language server // System includes -#include #include