From 8cf6ccb00a01a044b881534e4376f09f357726ec Mon Sep 17 00:00:00 2001 From: Paul Tarjan Date: Sun, 9 Jun 2013 21:21:23 -0700 Subject: [PATCH] use TRACE_SET_MOD I found this macro while refactoring and since I like consistency, I used it everywhere. --- hphp/runtime/base/array/array_iterator.cpp | 2 +- hphp/runtime/base/array/hphp_array.cpp | 2 +- hphp/runtime/base/file_repository.cpp | 2 +- hphp/runtime/base/intercept.cpp | 2 +- hphp/runtime/base/stat_cache.cpp | 2 +- hphp/runtime/ext/ext_debugger.cpp | 2 +- hphp/runtime/vm/backup_gc.cpp | 2 +- hphp/runtime/vm/bytecode.cpp | 2 +- hphp/runtime/vm/debug/elfwriter.cpp | 6 +++--- hphp/runtime/vm/func.cpp | 2 +- hphp/runtime/vm/jit/annotation.cpp | 2 +- hphp/runtime/vm/jit/collector.cpp | 2 +- hphp/runtime/vm/jit/dce.cpp | 2 +- hphp/runtime/vm/jit/irtranslator.cpp | 2 +- hphp/runtime/vm/jit/tracebuilder.cpp | 2 +- hphp/runtime/vm/jit/translator-x64-internal.h | 2 +- hphp/runtime/vm/jit/translator-x64.cpp | 2 +- hphp/runtime/vm/repo.cpp | 2 +- hphp/runtime/vm/repo_helpers.cpp | 2 +- hphp/runtime/vm/runtime.cpp | 2 +- hphp/runtime/vm/unit.cpp | 2 +- hphp/util/trace.cpp | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/hphp/runtime/base/array/array_iterator.cpp b/hphp/runtime/base/array/array_iterator.cpp index 4e35ca5c2..9486b6d81 100644 --- a/hphp/runtime/base/array/array_iterator.cpp +++ b/hphp/runtime/base/array/array_iterator.cpp @@ -25,7 +25,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// // Static strings. -static const Trace::Module TRACEMOD = Trace::runtime; +TRACE_SET_MOD(runtime); static StaticString s_rewind("rewind"); static StaticString s_valid("valid"); diff --git a/hphp/runtime/base/array/hphp_array.cpp b/hphp/runtime/base/array/hphp_array.cpp index 71a5f6136..196d378d4 100644 --- a/hphp/runtime/base/array/hphp_array.cpp +++ b/hphp/runtime/base/array/hphp_array.cpp @@ -46,7 +46,7 @@ static_assert( "Performance is sensitive to sizeof(HphpArray)." " Make sure you changed it with good reason and then update this assert."); -static const Trace::Module TRACEMOD = Trace::runtime; +TRACE_SET_MOD(runtime); /////////////////////////////////////////////////////////////////////////////// /* diff --git a/hphp/runtime/base/file_repository.cpp b/hphp/runtime/base/file_repository.cpp index 8b30cf1b6..b8b78a6fb 100644 --- a/hphp/runtime/base/file_repository.cpp +++ b/hphp/runtime/base/file_repository.cpp @@ -33,7 +33,7 @@ using std::endl; namespace HPHP { -static const Trace::Module TRACEMOD = Trace::fr; +TRACE_SET_MOD(fr); extern bool (*file_dump)(const char *filename); namespace Eval { diff --git a/hphp/runtime/base/intercept.cpp b/hphp/runtime/base/intercept.cpp index 6c3e61fb4..6208f4c1b 100644 --- a/hphp/runtime/base/intercept.cpp +++ b/hphp/runtime/base/intercept.cpp @@ -36,7 +36,7 @@ using namespace HPHP::Trace; namespace HPHP { -static const Trace::Module TRACEMOD = Trace::intercept; +TRACE_SET_MOD(intercept); class InterceptRequestData : public RequestEventHandler { public: diff --git a/hphp/runtime/base/stat_cache.cpp b/hphp/runtime/base/stat_cache.cpp index 0ae55c9b2..def84db63 100644 --- a/hphp/runtime/base/stat_cache.cpp +++ b/hphp/runtime/base/stat_cache.cpp @@ -29,7 +29,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// -static const Trace::Module TRACEMOD = Trace::stat; +TRACE_SET_MOD(stat); UNUSED static std::string statToString(const struct stat* buf) { std::ostringstream os; diff --git a/hphp/runtime/ext/ext_debugger.cpp b/hphp/runtime/ext/ext_debugger.cpp index 87bb3c0ff..9c4e17f83 100644 --- a/hphp/runtime/ext/ext_debugger.cpp +++ b/hphp/runtime/ext/ext_debugger.cpp @@ -62,7 +62,7 @@ Array f_hphpd_get_user_commands() { return CmdUser::GetCommands(); } -static const Trace::Module TRACEMOD = Trace::bcinterp; +TRACE_SET_MOD(bcinterp); void f_hphpd_break(bool condition /* = true */) { TRACE(5, "in f_hphpd_break()\n"); diff --git a/hphp/runtime/vm/backup_gc.cpp b/hphp/runtime/vm/backup_gc.cpp index fee52bd4d..67ae30752 100644 --- a/hphp/runtime/vm/backup_gc.cpp +++ b/hphp/runtime/vm/backup_gc.cpp @@ -33,7 +33,7 @@ namespace HPHP { -static const Trace::Module TRACEMOD = Trace::gc; +TRACE_SET_MOD(gc); ////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/vm/bytecode.cpp b/hphp/runtime/vm/bytecode.cpp index 48efbe5e5..e11c3d77d 100644 --- a/hphp/runtime/vm/bytecode.cpp +++ b/hphp/runtime/vm/bytecode.cpp @@ -99,7 +99,7 @@ using Transl::tx64; #else #define OPTBLD_INLINE ALWAYS_INLINE #endif -static const Trace::Module TRACEMOD = Trace::bcinterp; +TRACE_SET_MOD(bcinterp); namespace { diff --git a/hphp/runtime/vm/debug/elfwriter.cpp b/hphp/runtime/vm/debug/elfwriter.cpp index c8e56b396..e1d661a8e 100644 --- a/hphp/runtime/vm/debug/elfwriter.cpp +++ b/hphp/runtime/vm/debug/elfwriter.cpp @@ -13,11 +13,11 @@ | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ +#include "hphp/runtime/vm/debug/elfwriter.h" +#include "hphp/runtime/vm/debug/gdb-jit.h" #include #include #include -#include "hphp/runtime/vm/debug/elfwriter.h" -#include "hphp/runtime/vm/debug/gdb-jit.h" #include #include #include @@ -34,7 +34,7 @@ using namespace HPHP::Transl; namespace HPHP { namespace Debug { -static const Trace::Module TRACEMOD = Trace::debuginfo; +TRACE_SET_MOD(debuginfo); static const uint8_t CFA_OFFSET = 16; void ElfWriter::logError(const string& msg) { diff --git a/hphp/runtime/vm/func.cpp b/hphp/runtime/vm/func.cpp index f27ec2457..9c694a660 100644 --- a/hphp/runtime/vm/func.cpp +++ b/hphp/runtime/vm/func.cpp @@ -36,7 +36,7 @@ namespace HPHP { -static const Trace::Module TRACEMOD = Trace::hhbc; +TRACE_SET_MOD(hhbc); const StringData* Func::s___call = StringData::GetStaticString("__call"); const StringData* Func::s___callStatic = StringData::GetStaticString("__callStatic"); diff --git a/hphp/runtime/vm/jit/annotation.cpp b/hphp/runtime/vm/jit/annotation.cpp index 93f805756..8d52e5519 100644 --- a/hphp/runtime/vm/jit/annotation.cpp +++ b/hphp/runtime/vm/jit/annotation.cpp @@ -22,7 +22,7 @@ namespace HPHP { namespace Transl { -static const Trace::Module TRACEMOD = Trace::trans; +TRACE_SET_MOD(trans); /* * A mapping from FCall instructions to the statically-known StringData* diff --git a/hphp/runtime/vm/jit/collector.cpp b/hphp/runtime/vm/jit/collector.cpp index 25bda186f..4990b2019 100644 --- a/hphp/runtime/vm/jit/collector.cpp +++ b/hphp/runtime/vm/jit/collector.cpp @@ -39,7 +39,7 @@ namespace Transl { * Code related to reclaiming translation spaces. */ -static const Trace::Module TRACEMOD = Trace::tx64; +TRACE_SET_MOD(tx64); /* * Visitor that makes a best effort at touching all live Func*'s at the diff --git a/hphp/runtime/vm/jit/dce.cpp b/hphp/runtime/vm/jit/dce.cpp index 8893eb838..dc715aeb1 100644 --- a/hphp/runtime/vm/jit/dce.cpp +++ b/hphp/runtime/vm/jit/dce.cpp @@ -28,7 +28,7 @@ namespace HPHP { namespace JIT { namespace { -static const HPHP::Trace::Module TRACEMOD = HPHP::Trace::hhir; +TRACE_SET_MOD(hhir); /* DceFlags tracks the state of one instruction during dead code analysis. */ struct DceFlags { diff --git a/hphp/runtime/vm/jit/irtranslator.cpp b/hphp/runtime/vm/jit/irtranslator.cpp index ac38c99ba..411b3e8e1 100644 --- a/hphp/runtime/vm/jit/irtranslator.cpp +++ b/hphp/runtime/vm/jit/irtranslator.cpp @@ -50,7 +50,7 @@ using namespace Util; using namespace Trace; using std::max; -static const Trace::Module TRACEMOD = Trace::hhir; +TRACE_SET_MOD(hhir); #ifdef DEBUG static const bool debug = true; #else diff --git a/hphp/runtime/vm/jit/tracebuilder.cpp b/hphp/runtime/vm/jit/tracebuilder.cpp index d5986dc2c..c3a9ab83a 100644 --- a/hphp/runtime/vm/jit/tracebuilder.cpp +++ b/hphp/runtime/vm/jit/tracebuilder.cpp @@ -24,7 +24,7 @@ namespace HPHP { namespace JIT { -static const HPHP::Trace::Module TRACEMOD = HPHP::Trace::hhir; +TRACE_SET_MOD(hhir); TraceBuilder::TraceBuilder(Offset initialBcOffset, Offset initialSpOffsetFromFp, diff --git a/hphp/runtime/vm/jit/translator-x64-internal.h b/hphp/runtime/vm/jit/translator-x64-internal.h index 32a052f0d..7650d15ef 100644 --- a/hphp/runtime/vm/jit/translator-x64-internal.h +++ b/hphp/runtime/vm/jit/translator-x64-internal.h @@ -25,7 +25,7 @@ namespace HPHP { namespace Transl { -static const Trace::Module TRACEMOD = Trace::tx64; +TRACE_SET_MOD(tx64); static const DataType BitwiseKindOfString = KindOfString; // Generate an if-then block into a. thenBlock is executed if cc is true. diff --git a/hphp/runtime/vm/jit/translator-x64.cpp b/hphp/runtime/vm/jit/translator-x64.cpp index 245072aaf..63cd5234d 100644 --- a/hphp/runtime/vm/jit/translator-x64.cpp +++ b/hphp/runtime/vm/jit/translator-x64.cpp @@ -4175,7 +4175,7 @@ bool TranslatorX64::invalidateFile(Eval::PhpFile* f) { } // HPHP::Transl -static const Trace::Module TRACEMOD = Trace::tx64; +TRACE_SET_MOD(tx64); void invalidatePath(const std::string& path) { TRACE(1, "invalidatePath: abspath %s\n", path.c_str()); diff --git a/hphp/runtime/vm/repo.cpp b/hphp/runtime/vm/repo.cpp index 2ddf9dcd5..cc0b8f4b9 100644 --- a/hphp/runtime/vm/repo.cpp +++ b/hphp/runtime/vm/repo.cpp @@ -21,7 +21,7 @@ namespace HPHP { -static const Trace::Module TRACEMOD = Trace::hhbc; +TRACE_SET_MOD(hhbc); const char* Repo::kMagicProduct = "facebook.com HipHop Virtual Machine bytecode repository"; diff --git a/hphp/runtime/vm/repo_helpers.cpp b/hphp/runtime/vm/repo_helpers.cpp index f2193ca59..6d81558d1 100644 --- a/hphp/runtime/vm/repo_helpers.cpp +++ b/hphp/runtime/vm/repo_helpers.cpp @@ -21,7 +21,7 @@ namespace HPHP { -static const Trace::Module TRACEMOD = Trace::hhbc; +TRACE_SET_MOD(hhbc); //============================================================================== // RepoStmt. diff --git a/hphp/runtime/vm/runtime.cpp b/hphp/runtime/vm/runtime.cpp index d9758ab59..bef497bda 100644 --- a/hphp/runtime/vm/runtime.cpp +++ b/hphp/runtime/vm/runtime.cpp @@ -36,7 +36,7 @@ namespace HPHP { using Transl::tx64; -static const Trace::Module TRACEMOD = Trace::runtime; +TRACE_SET_MOD(runtime); CompileStringFn g_hphp_compiler_parse; BuildNativeFuncUnitFn g_hphp_build_native_func_unit; diff --git a/hphp/runtime/vm/unit.cpp b/hphp/runtime/vm/unit.cpp index 38d1ed764..6a68ed86a 100644 --- a/hphp/runtime/vm/unit.cpp +++ b/hphp/runtime/vm/unit.cpp @@ -47,7 +47,7 @@ namespace HPHP { using Util::getDataRef; -static const Trace::Module TRACEMOD = Trace::hhbc; +TRACE_SET_MOD(hhbc); static const StaticString s_stdin("STDIN"); static const StaticString s_stdout("STDOUT"); diff --git a/hphp/util/trace.cpp b/hphp/util/trace.cpp index 6b3f6619a..e386df2f1 100644 --- a/hphp/util/trace.cpp +++ b/hphp/util/trace.cpp @@ -34,7 +34,7 @@ namespace HPHP { -static const Trace::Module TRACEMOD = Trace::tprefix; +TRACE_SET_MOD(tprefix); namespace Trace {