Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(904)

Unified Diff: src/oprofile-agent.h

Issue 1317003: Align OProfile agent invocations style with logging. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/oprofile-agent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/oprofile-agent.h
diff --git a/src/oprofile-agent.h b/src/oprofile-agent.h
index 4c299bfbc6c5b5beb1e1f33d83dfc3c4984648d7..4c50f0ff7ddbc4e9a51d7996df1f078ddef60e6d 100644
--- a/src/oprofile-agent.h
+++ b/src/oprofile-agent.h
@@ -37,6 +37,14 @@
// system headers (they have __uint64_t), but is defined
// in V8's headers.
#include <opagent.h> // NOLINT
+
+#define OPROFILE(Call) \
+ do { \
+ if (v8::internal::OProfileAgent::is_enabled()) \
+ v8::internal::OProfileAgent::Call; \
+ } while (false)
+#else
+#define OPROFILE(Call) ((void) 0)
#endif
namespace v8 {
@@ -46,13 +54,13 @@ class OProfileAgent {
public:
static bool Initialize();
static void TearDown();
+#ifdef ENABLE_OPROFILE_AGENT
static void CreateNativeCodeRegion(const char* name,
const void* ptr, unsigned int size);
static void CreateNativeCodeRegion(String* name,
const void* ptr, unsigned int size);
static void CreateNativeCodeRegion(String* name, String* source, int line_num,
const void* ptr, unsigned int size);
-#ifdef ENABLE_OPROFILE_AGENT
static bool is_enabled() { return handle_ != NULL; }
private:
« no previous file with comments | « src/compiler.cc ('k') | src/oprofile-agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698