Bug 1508180 - Use uppercase high-order macro names in profiler. r=mstange
authorTed Campbell <tcampbell@mozilla.com>
Mon, 19 Nov 2018 17:41:27 +0000
changeset 503465 0c683a3e80d8b437e3bf9d4b81a84458465d74a3
parent 503464 ffed3e5978105c9f71fd4a5579746e2117ebc819
child 503466 e92a6ab741287f97ba8dd35f631e1a4c37097160
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1508180
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508180 - Use uppercase high-order macro names in profiler. r=mstange Differential Revision: https://phabricator.services.mozilla.com/D12235
tools/profiler/core/ProfileBufferEntry.h
tools/profiler/public/GeckoProfiler.h
--- a/tools/profiler/core/ProfileBufferEntry.h
+++ b/tools/profiler/core/ProfileBufferEntry.h
@@ -27,39 +27,39 @@
 #include "nsClassHashtable.h"
 #include "mozilla/Variant.h"
 #include "nsTArray.h"
 
 class ProfilerMarker;
 
 // NOTE!  If you add entries, you need to verify if they need to be added to the
 // switch statement in DuplicateLastSample!
-#define FOR_EACH_PROFILE_BUFFER_ENTRY_KIND(macro) \
-  macro(Category,              int) \
-  macro(CollectionStart,       double) \
-  macro(CollectionEnd,         double) \
-  macro(Label,                 const char*) \
-  macro(FrameFlags,            uint64_t) \
-  macro(DynamicStringFragment, char*) /* char[kNumChars], really */ \
-  macro(JitReturnAddr,         void*) \
-  macro(LineNumber,            int) \
-  macro(ColumnNumber,          int) \
-  macro(NativeLeafAddr,        void*) \
-  macro(Marker,                ProfilerMarker*) \
-  macro(Pause,                 double) \
-  macro(Responsiveness,        double) \
-  macro(Resume,                double) \
-  macro(ThreadId,              int) \
-  macro(Time,                  double) \
-  macro(ResidentMemory,        uint64_t) \
-  macro(UnsharedMemory,        uint64_t) \
-  macro(CounterId,             void*) \
-  macro(CounterKey,            uint64_t) \
-  macro(Number,                uint64_t) \
-  macro(Count,                 int64_t)
+#define FOR_EACH_PROFILE_BUFFER_ENTRY_KIND(MACRO) \
+  MACRO(Category,              int) \
+  MACRO(CollectionStart,       double) \
+  MACRO(CollectionEnd,         double) \
+  MACRO(Label,                 const char*) \
+  MACRO(FrameFlags,            uint64_t) \
+  MACRO(DynamicStringFragment, char*) /* char[kNumChars], really */ \
+  MACRO(JitReturnAddr,         void*) \
+  MACRO(LineNumber,            int) \
+  MACRO(ColumnNumber,          int) \
+  MACRO(NativeLeafAddr,        void*) \
+  MACRO(Marker,                ProfilerMarker*) \
+  MACRO(Pause,                 double) \
+  MACRO(Responsiveness,        double) \
+  MACRO(Resume,                double) \
+  MACRO(ThreadId,              int) \
+  MACRO(Time,                  double) \
+  MACRO(ResidentMemory,        uint64_t) \
+  MACRO(UnsharedMemory,        uint64_t) \
+  MACRO(CounterId,             void*) \
+  MACRO(CounterKey,            uint64_t) \
+  MACRO(Number,                uint64_t) \
+  MACRO(Count,                 int64_t)
 
 
 // NB: Packing this structure has been shown to cause SIGBUS issues on ARM.
 #if !defined(GP_ARCH_arm)
 #pragma pack(push, 1)
 #endif
 
 class ProfileBufferEntry
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -109,60 +109,60 @@ class TimeStamp;
 #define PROFILER_RAII_EXPAND(id, line) PROFILER_RAII_PASTE(id, line)
 #define PROFILER_RAII PROFILER_RAII_EXPAND(raiiObject, __LINE__)
 
 //---------------------------------------------------------------------------
 // Profiler features
 //---------------------------------------------------------------------------
 
 // Higher-order macro containing all the feature info in one place. Define
-// |macro| appropriately to extract the relevant parts. Note that the number
+// |MACRO| appropriately to extract the relevant parts. Note that the number
 // values are used internally only and so can be changed without consequence.
 // Any changes to this list should also be applied to the feature list in
 // browser/components/extensions/schemas/geckoProfiler.json.
-#define PROFILER_FOR_EACH_FEATURE(macro) \
+#define PROFILER_FOR_EACH_FEATURE(MACRO) \
   /* Profile Java code (Android only). */ \
-  macro(0, "java", Java) \
+  MACRO(0, "java", Java) \
   \
   /* Get the JS engine to expose the JS stack to the profiler */ \
-  macro(1, "js", JS) \
+  MACRO(1, "js", JS) \
   \
   /* Include the C++ leaf node if not stackwalking. */ \
   /* The DevTools profiler doesn't want the native addresses. */ \
-  macro(2, "leaf", Leaf) \
+  MACRO(2, "leaf", Leaf) \
   \
   /* Add main thread I/O to the profile. */ \
-  macro(3, "mainthreadio", MainThreadIO) \
+  MACRO(3, "mainthreadio", MainThreadIO) \
   \
   /* Add memory measurements (e.g. RSS). */ \
-  macro(4, "memory", Memory) \
+  MACRO(4, "memory", Memory) \
   \
   /* Do not include user-identifiable information. */ \
-  macro(5, "privacy", Privacy) \
+  MACRO(5, "privacy", Privacy) \
   \
   /* Collect thread responsiveness information. */ \
-  macro(6, "responsiveness", Responsiveness) \
+  MACRO(6, "responsiveness", Responsiveness) \
   \
   /* Take a snapshot of the window on every composition. */ \
-  macro(7, "screenshots", Screenshots) \
+  MACRO(7, "screenshots", Screenshots) \
   \
   /* Disable parallel traversal in styling. */ \
-  macro(8, "seqstyle", SequentialStyle) \
+  MACRO(8, "seqstyle", SequentialStyle) \
   \
   /* Walk the C++ stack. Not available on all platforms. */ \
-  macro(9, "stackwalk", StackWalk) \
+  MACRO(9, "stackwalk", StackWalk) \
   \
   /* Start profiling with feature TaskTracer. */ \
-  macro(10, "tasktracer", TaskTracer) \
+  MACRO(10, "tasktracer", TaskTracer) \
   \
   /* Profile the registered secondary threads. */ \
-  macro(11, "threads", Threads) \
+  MACRO(11, "threads", Threads) \
   \
   /* Have the JavaScript engine track JIT optimizations. */ \
-  macro(12, "trackopts", TrackOptimizations)
+  MACRO(12, "trackopts", TrackOptimizations)
 
 struct ProfilerFeature
 {
   #define DECLARE(n_, str_, Name_) \
     static const uint32_t Name_ = (1u << n_); \
     static bool Has##Name_(uint32_t aFeatures) { return aFeatures & Name_; } \
     static void Set##Name_(uint32_t& aFeatures) { aFeatures |= Name_; } \
     static void Clear##Name_(uint32_t& aFeatures) { aFeatures &= ~Name_; }