Index: compiler-rt/trunk/lib/xray/tests/unit/fdr_logging_test.cc =================================================================== --- compiler-rt/trunk/lib/xray/tests/unit/fdr_logging_test.cc +++ compiler-rt/trunk/lib/xray/tests/unit/fdr_logging_test.cc @@ -50,14 +50,14 @@ char TmpFilename[] = "fdr-logging-test.XXXXXX"; Options.Fd = mkstemp(TmpFilename); ASSERT_NE(Options.Fd, -1); - ASSERT_EQ(FDRLogging_init(kBufferSize, kBufferMax, &Options, + ASSERT_EQ(fdrLoggingInit(kBufferSize, kBufferMax, &Options, sizeof(FDRLoggingOptions)), XRayLogInitStatus::XRAY_LOG_INITIALIZED); - FDRLogging_handleArg0(1, XRayEntryType::ENTRY); - FDRLogging_handleArg0(1, XRayEntryType::EXIT); - ASSERT_EQ(FDRLogging_finalize(), XRayLogInitStatus::XRAY_LOG_FINALIZED); - ASSERT_EQ(FDRLogging_flush(), XRayLogFlushStatus::XRAY_LOG_FLUSHED); - ASSERT_EQ(FDRLogging_reset(), XRayLogInitStatus::XRAY_LOG_UNINITIALIZED); + fdrLoggingHandleArg0(1, XRayEntryType::ENTRY); + fdrLoggingHandleArg0(1, XRayEntryType::EXIT); + ASSERT_EQ(fdrLoggingFinalize(), XRayLogInitStatus::XRAY_LOG_FINALIZED); + ASSERT_EQ(fdrLoggingFlush(), XRayLogFlushStatus::XRAY_LOG_FLUSHED); + ASSERT_EQ(fdrLoggingReset(), XRayLogInitStatus::XRAY_LOG_UNINITIALIZED); // To do this properly, we have to close the file descriptor then re-open the // file for reading this time. @@ -89,16 +89,16 @@ char TmpFilename[] = "fdr-logging-test.XXXXXX"; Options.Fd = mkstemp(TmpFilename); ASSERT_NE(Options.Fd, -1); - ASSERT_EQ(FDRLogging_init(kBufferSize, kBufferMax, &Options, + ASSERT_EQ(fdrLoggingInit(kBufferSize, kBufferMax, &Options, sizeof(FDRLoggingOptions)), XRayLogInitStatus::XRAY_LOG_INITIALIZED); for (uint64_t I = 0; I < 100; ++I) { - FDRLogging_handleArg0(1, XRayEntryType::ENTRY); - FDRLogging_handleArg0(1, XRayEntryType::EXIT); + fdrLoggingHandleArg0(1, XRayEntryType::ENTRY); + fdrLoggingHandleArg0(1, XRayEntryType::EXIT); } - ASSERT_EQ(FDRLogging_finalize(), XRayLogInitStatus::XRAY_LOG_FINALIZED); - ASSERT_EQ(FDRLogging_flush(), XRayLogFlushStatus::XRAY_LOG_FLUSHED); - ASSERT_EQ(FDRLogging_reset(), XRayLogInitStatus::XRAY_LOG_UNINITIALIZED); + ASSERT_EQ(fdrLoggingFinalize(), XRayLogInitStatus::XRAY_LOG_FINALIZED); + ASSERT_EQ(fdrLoggingFlush(), XRayLogFlushStatus::XRAY_LOG_FLUSHED); + ASSERT_EQ(fdrLoggingReset(), XRayLogInitStatus::XRAY_LOG_UNINITIALIZED); // To do this properly, we have to close the file descriptor then re-open the // file for reading this time. Index: compiler-rt/trunk/lib/xray/xray_arm.cc =================================================================== --- compiler-rt/trunk/lib/xray/xray_arm.cc +++ compiler-rt/trunk/lib/xray/xray_arm.cc @@ -74,7 +74,7 @@ // MOVW r0, # // MOVT r0, # inline static uint32_t * -Write32bitLoadR0(uint32_t *Address, +write32bitLoadR0(uint32_t *Address, const uint32_t Value) XRAY_NEVER_INSTRUMENT { return write32bitLoadReg(0, Address, Value); } @@ -83,7 +83,7 @@ // MOVW ip, # // MOVT ip, # inline static uint32_t * -Write32bitLoadIP(uint32_t *Address, +write32bitLoadIP(uint32_t *Address, const uint32_t Value) XRAY_NEVER_INSTRUMENT { return write32bitLoadReg(12, Address, Value); } @@ -121,9 +121,9 @@ uint32_t *CurAddress = FirstAddress + 1; if (Enable) { CurAddress = - Write32bitLoadR0(CurAddress, reinterpret_cast(FuncId)); + write32bitLoadR0(CurAddress, reinterpret_cast(FuncId)); CurAddress = - Write32bitLoadIP(CurAddress, reinterpret_cast(TracingHook)); + write32bitLoadIP(CurAddress, reinterpret_cast(TracingHook)); *CurAddress = uint32_t(PatchOpcodes::PO_BlxIp); CurAddress++; *CurAddress = uint32_t(PatchOpcodes::PO_PopR0Lr); Index: compiler-rt/trunk/lib/xray/xray_fdr_logging.h =================================================================== --- compiler-rt/trunk/lib/xray/xray_fdr_logging.h +++ compiler-rt/trunk/lib/xray/xray_fdr_logging.h @@ -83,12 +83,12 @@ }; // Flight Data Recorder mode implementation interfaces. -XRayLogInitStatus FDRLogging_init(size_t BufferSize, size_t BufferMax, +XRayLogInitStatus fdrLoggingInit(size_t BufferSize, size_t BufferMax, void *Options, size_t OptionsSize); -XRayLogInitStatus FDRLogging_finalize(); -void FDRLogging_handleArg0(int32_t FuncId, XRayEntryType Entry); -XRayLogFlushStatus FDRLogging_flush(); -XRayLogInitStatus FDRLogging_reset(); +XRayLogInitStatus fdrLoggingFinalize(); +void fdrLoggingHandleArg0(int32_t FuncId, XRayEntryType Entry); +XRayLogFlushStatus fdrLoggingFlush(); +XRayLogInitStatus fdrLoggingReset(); } // namespace __xray Index: compiler-rt/trunk/lib/xray/xray_fdr_logging.cc =================================================================== --- compiler-rt/trunk/lib/xray/xray_fdr_logging.cc +++ compiler-rt/trunk/lib/xray/xray_fdr_logging.cc @@ -55,7 +55,7 @@ std::unique_ptr FDROptions; -XRayLogInitStatus FDRLogging_init(std::size_t BufferSize, std::size_t BufferMax, +XRayLogInitStatus fdrLoggingInit(std::size_t BufferSize, std::size_t BufferMax, void *Options, size_t OptionsSize) XRAY_NEVER_INSTRUMENT { assert(OptionsSize == sizeof(FDRLoggingOptions)); @@ -68,7 +68,7 @@ FDROptions.reset(new FDRLoggingOptions()); *FDROptions = *reinterpret_cast(Options); if (FDROptions->ReportErrors) - SetPrintfAndReportCallback(PrintToStdErr); + SetPrintfAndReportCallback(printToStdErr); bool Success = false; BQ = std::make_shared(BufferSize, BufferMax, Success); @@ -78,7 +78,7 @@ } // Install the actual handleArg0 handler after initialising the buffers. - __xray_set_handler(FDRLogging_handleArg0); + __xray_set_handler(fdrLoggingHandleArg0); LoggingStatus.store(XRayLogInitStatus::XRAY_LOG_INITIALIZED, std::memory_order_release); @@ -86,7 +86,7 @@ } // Must finalize before flushing. -XRayLogFlushStatus FDRLogging_flush() XRAY_NEVER_INSTRUMENT { +XRayLogFlushStatus fdrLoggingFlush() XRAY_NEVER_INSTRUMENT { if (LoggingStatus.load(std::memory_order_acquire) != XRayLogInitStatus::XRAY_LOG_FINALIZED) return XRayLogFlushStatus::XRAY_LOG_NOT_FLUSHING; @@ -142,7 +142,7 @@ return XRayLogFlushStatus::XRAY_LOG_FLUSHED; } -XRayLogInitStatus FDRLogging_finalize() XRAY_NEVER_INSTRUMENT { +XRayLogInitStatus fdrLoggingFinalize() XRAY_NEVER_INSTRUMENT { XRayLogInitStatus CurrentStatus = XRayLogInitStatus::XRAY_LOG_INITIALIZED; if (!LoggingStatus.compare_exchange_strong( CurrentStatus, XRayLogInitStatus::XRAY_LOG_FINALIZING, @@ -158,7 +158,7 @@ return XRayLogInitStatus::XRAY_LOG_FINALIZED; } -XRayLogInitStatus FDRLogging_reset() XRAY_NEVER_INSTRUMENT { +XRayLogInitStatus fdrLoggingReset() XRAY_NEVER_INSTRUMENT { XRayLogInitStatus CurrentStatus = XRayLogInitStatus::XRAY_LOG_FINALIZED; if (!LoggingStatus.compare_exchange_strong( CurrentStatus, XRayLogInitStatus::XRAY_LOG_UNINITIALIZED, @@ -325,7 +325,7 @@ } // namespace -void FDRLogging_handleArg0(int32_t FuncId, +void fdrLoggingHandleArg0(int32_t FuncId, XRayEntryType Entry) XRAY_NEVER_INSTRUMENT { // We want to get the TSC as early as possible, so that we can check whether // we've seen this CPU before. We also do it before we load anything else, to @@ -534,8 +534,8 @@ using namespace __xray; if (flags()->xray_fdr_log) { XRayLogImpl Impl{ - FDRLogging_init, FDRLogging_finalize, FDRLogging_handleArg0, - FDRLogging_flush, + fdrLoggingInit, fdrLoggingFinalize, fdrLoggingHandleArg0, + fdrLoggingFlush, }; __xray_set_log_impl(Impl); } Index: compiler-rt/trunk/lib/xray/xray_flags.h =================================================================== --- compiler-rt/trunk/lib/xray/xray_flags.h +++ compiler-rt/trunk/lib/xray/xray_flags.h @@ -24,13 +24,13 @@ #include "xray_flags.inc" #undef XRAY_FLAG - void SetDefaults(); + void setDefaults(); }; extern Flags xray_flags_dont_use_directly; inline Flags *flags() { return &xray_flags_dont_use_directly; } -void InitializeFlags(); +void initializeFlags(); } // namespace __xray Index: compiler-rt/trunk/lib/xray/xray_flags.cc =================================================================== --- compiler-rt/trunk/lib/xray/xray_flags.cc +++ compiler-rt/trunk/lib/xray/xray_flags.cc @@ -24,26 +24,26 @@ Flags xray_flags_dont_use_directly; // use via flags(). -void Flags::SetDefaults() XRAY_NEVER_INSTRUMENT { +void Flags::setDefaults() XRAY_NEVER_INSTRUMENT { #define XRAY_FLAG(Type, Name, DefaultValue, Description) Name = DefaultValue; #include "xray_flags.inc" #undef XRAY_FLAG } -static void RegisterXRayFlags(FlagParser *P, Flags *F) XRAY_NEVER_INSTRUMENT { +static void registerXRayFlags(FlagParser *P, Flags *F) XRAY_NEVER_INSTRUMENT { #define XRAY_FLAG(Type, Name, DefaultValue, Description) \ RegisterFlag(P, #Name, Description, &F->Name); #include "xray_flags.inc" #undef XRAY_FLAG } -void InitializeFlags() XRAY_NEVER_INSTRUMENT { +void initializeFlags() XRAY_NEVER_INSTRUMENT { SetCommonFlagsDefaults(); auto *F = flags(); - F->SetDefaults(); + F->setDefaults(); FlagParser XRayParser; - RegisterXRayFlags(&XRayParser, F); + registerXRayFlags(&XRayParser, F); RegisterCommonFlags(&XRayParser); // Override from command line. Index: compiler-rt/trunk/lib/xray/xray_init.cc =================================================================== --- compiler-rt/trunk/lib/xray/xray_init.cc +++ compiler-rt/trunk/lib/xray/xray_init.cc @@ -46,7 +46,7 @@ // __xray_init() will do the actual loading of the current process' memory map // and then proceed to look for the .xray_instr_map section/segment. void __xray_init() XRAY_NEVER_INSTRUMENT { - InitializeFlags(); + initializeFlags(); if (__start_xray_instr_map == nullptr) { Report("XRay instrumentation map missing. Not initializing XRay.\n"); return; Index: compiler-rt/trunk/lib/xray/xray_interface.cc =================================================================== --- compiler-rt/trunk/lib/xray/xray_interface.cc +++ compiler-rt/trunk/lib/xray/xray_interface.cc @@ -115,14 +115,14 @@ }; template -CleanupInvoker ScopeCleanup(Function Fn) XRAY_NEVER_INSTRUMENT { +CleanupInvoker scopeCleanup(Function Fn) XRAY_NEVER_INSTRUMENT { return CleanupInvoker{Fn}; } -// ControlPatching implements the common internals of the patching/unpatching +// controlPatching implements the common internals of the patching/unpatching // implementation. |Enable| defines whether we're enabling or disabling the // runtime XRay instrumentation. -XRayPatchingStatus ControlPatching(bool Enable) XRAY_NEVER_INSTRUMENT { +XRayPatchingStatus controlPatching(bool Enable) XRAY_NEVER_INSTRUMENT { if (!XRayInitialized.load(std::memory_order_acquire)) return XRayPatchingStatus::NOT_INITIALIZED; // Not initialized. @@ -134,7 +134,7 @@ } bool PatchingSuccess = false; - auto XRayPatchingStatusResetter = ScopeCleanup([&PatchingSuccess] { + auto XRayPatchingStatusResetter = scopeCleanup([&PatchingSuccess] { if (!PatchingSuccess) { XRayPatching.store(false, std::memory_order_release); } @@ -199,9 +199,9 @@ } XRayPatchingStatus __xray_patch() XRAY_NEVER_INSTRUMENT { - return ControlPatching(true); + return controlPatching(true); } XRayPatchingStatus __xray_unpatch() XRAY_NEVER_INSTRUMENT { - return ControlPatching(false); + return controlPatching(false); } Index: compiler-rt/trunk/lib/xray/xray_utils.h =================================================================== --- compiler-rt/trunk/lib/xray/xray_utils.h +++ compiler-rt/trunk/lib/xray/xray_utils.h @@ -21,7 +21,7 @@ namespace __xray { // Default implementation of the reporting interface for sanitizer errors. -void PrintToStdErr(const char *Buffer); +void printToStdErr(const char *Buffer); // EINTR-safe write routine, provided a file descriptor and a character range. void retryingWriteAll(int Fd, char *Begin, char *End); Index: compiler-rt/trunk/lib/xray/xray_utils.cc =================================================================== --- compiler-rt/trunk/lib/xray/xray_utils.cc +++ compiler-rt/trunk/lib/xray/xray_utils.cc @@ -34,7 +34,7 @@ namespace __xray { -void PrintToStdErr(const char *Buffer) XRAY_NEVER_INSTRUMENT { +void printToStdErr(const char *Buffer) XRAY_NEVER_INSTRUMENT { fprintf(stderr, "%s", Buffer); } @@ -132,7 +132,7 @@ int getLogFD() XRAY_NEVER_INSTRUMENT { // FIXME: Figure out how to make this less stderr-dependent. - SetPrintfAndReportCallback(PrintToStdErr); + SetPrintfAndReportCallback(printToStdErr); // Open a temporary file once for the log. static char TmpFilename[256] = {}; static char TmpWildcardPattern[] = "XXXXXX";