From: Alexander Monakov Date: Fri, 12 Jul 2013 19:13:47 +0000 (+0400) Subject: common/backtrace: move namespace trace -> os X-Git-Url: https://git.cworth.org/git?p=apitrace;a=commitdiff_plain;h=725863464a48c153f9e706ad4f5172bb0de7cea2 common/backtrace: move namespace trace -> os --- diff --git a/common/os_backtrace.cpp b/common/os_backtrace.cpp index eb809e0..7f19495 100644 --- a/common/os_backtrace.cpp +++ b/common/os_backtrace.cpp @@ -38,8 +38,9 @@ #include #include "os.hpp" +using trace::Id; -namespace trace { +namespace os { /* * Pascal string (with zero terminator optionally omitted) @@ -110,7 +111,7 @@ bool backtrace_is_needed(const char* fname) { return backtraceFunctionNamePrefixes.contain(fname); } -} /* namespace trace */ +} /* namespace os */ #if defined(ANDROID) @@ -118,7 +119,7 @@ bool backtrace_is_needed(const char* fname) { #include "os.hpp" #include -namespace trace { +namespace os { /* The following two declarations are copied from Android sources */ @@ -269,6 +270,8 @@ std::vector get_backtrace() { return backtraceProvider.parseBacktrace(backtraceProvider.getBacktrace()); } +} /* namespace os */ + /* end ANDROID */ #elif defined(__ELF__) @@ -280,7 +283,7 @@ std::vector get_backtrace() { #include -namespace trace { +namespace os { @@ -383,8 +386,9 @@ std::vector get_backtrace() { return backtraceProvider.getParsedBacktrace(); } -#endif /* LINUX */ -} /* namespace trace */ +} /* namespace os */ + +#endif /* __ELF__ */ #endif /* ANDROID or LINUX */ diff --git a/common/os_backtrace.hpp b/common/os_backtrace.hpp index bfb0ffd..43dbb41 100644 --- a/common/os_backtrace.hpp +++ b/common/os_backtrace.hpp @@ -31,7 +31,9 @@ #include "trace_model.hpp" -namespace trace { +namespace os { + +using trace::RawStackFrame; #if defined(ANDROID) || defined(__ELF__) @@ -51,6 +53,6 @@ static inline bool backtrace_is_needed(const char*) { #endif -} /* namespace trace */ +} /* namespace os */ #endif diff --git a/common/trace_writer_local.cpp b/common/trace_writer_local.cpp index a592cb8..529f83b 100644 --- a/common/trace_writer_local.cpp +++ b/common/trace_writer_local.cpp @@ -173,8 +173,8 @@ unsigned LocalWriter::beginEnter(const FunctionSig *sig, bool fake) { assert(this_thread_num); unsigned thread_id = this_thread_num - 1; unsigned call_no = Writer::beginEnter(sig, thread_id); - if (!fake && backtrace_is_needed(sig->name)) { - std::vector backtrace = get_backtrace(); + if (!fake && os::backtrace_is_needed(sig->name)) { + std::vector backtrace = os::get_backtrace(); beginBacktrace(backtrace.size()); for (unsigned i = 0; i < backtrace.size(); ++i) { writeStackFrame(&backtrace[i]);