'profilingsupport:on': {
'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_LOGGING_AND_PROFILING'],
},
- 'cppprofilesprocessor:on': {
- 'CPPDEFINES': ['ENABLE_CPP_PROFILES_PROCESSOR'],
- },
'debuggersupport:on': {
'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'],
}
'default': 'on',
'help': 'enable profiling of JavaScript code'
},
- 'cppprofilesprocessor': {
- 'values': ['on', 'off'],
- 'default': 'on',
- 'help': 'enable C++ profiles processor'
- },
'debuggersupport': {
'values': ['on', 'off'],
'default': 'on',
#endif // ENABLE_DEBUGGER_SUPPORT
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
Handle<String> CpuProfileNode::GetFunctionName() const {
IsDeadCheck("v8::CpuProfileNode::GetFunctionName");
i::CpuProfiler::StopProfiling(*Utils::OpenHandle(*title)));
}
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+#endif // ENABLE_LOGGING_AND_PROFILING
namespace internal {
#include "cpu-profiler.h"
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
#include "circular-queue-inl.h"
#include "profile-generator-inl.h"
} } // namespace v8::internal
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+#endif // ENABLE_LOGGING_AND_PROFILING
#endif // V8_CPU_PROFILER_INL_H_
#include "cpu-profiler-inl.h"
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
#include "log-inl.h"
} } // namespace v8::internal
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+#endif // ENABLE_LOGGING_AND_PROFILING
namespace v8 {
namespace internal {
void CpuProfiler::Setup() {
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
if (singleton_ == NULL) {
singleton_ = new CpuProfiler();
}
void CpuProfiler::TearDown() {
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
if (singleton_ != NULL) {
delete singleton_;
}
#ifndef V8_CPU_PROFILER_H_
#define V8_CPU_PROFILER_H_
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
#include "circular-queue.h"
} while (false)
#else
#define PROFILE(Call) LOG(Call)
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+#endif // ENABLE_LOGGING_AND_PROFILING
namespace v8 {
static void Setup();
static void TearDown();
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
static void StartProfiling(const char* title);
static void StartProfiling(String* title);
static CpuProfile* StopProfiling(const char* title);
#else
static INLINE(bool is_profiling()) { return false; }
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+#endif // ENABLE_LOGGING_AND_PROFILING
private:
DISALLOW_COPY_AND_ASSIGN(CpuProfiler);
Logger::LogEventsAndTags Logger::ToNativeByScript(Logger::LogEventsAndTags tag,
Script* script) {
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
if ((tag == FUNCTION_TAG || tag == LAZY_COMPILE_TAG || tag == SCRIPT_TAG)
&& script->type()->value() == Script::TYPE_NATIVE) {
switch (tag) {
} else {
return tag;
}
-#else
- return tag;
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
}
#endif // ENABLE_LOGGING_AND_PROFILING
#define LOG(Call) ((void) 0)
#endif
-#define LOG_EVENTS_AND_TAGS_LIST_NO_NATIVES(V) \
+#define LOG_EVENTS_AND_TAGS_LIST(V) \
V(CODE_CREATION_EVENT, "code-creation", "cc") \
V(CODE_MOVE_EVENT, "code-move", "cm") \
V(CODE_DELETE_EVENT, "code-delete", "cd") \
V(REG_EXP_TAG, "RegExp", "re") \
V(SCRIPT_TAG, "Script", "sc") \
V(STORE_IC_TAG, "StoreIC", "sic") \
- V(STUB_TAG, "Stub", "s")
-
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
-// Add 'NATIVE_' cases for functions and scripts, but map them to
-// original tags when writing to the log.
-#define LOG_EVENTS_AND_TAGS_LIST(V) \
- LOG_EVENTS_AND_TAGS_LIST_NO_NATIVES(V) \
+ V(STUB_TAG, "Stub", "s") \
V(NATIVE_FUNCTION_TAG, "Function", "f") \
V(NATIVE_LAZY_COMPILE_TAG, "LazyCompile", "lc") \
V(NATIVE_SCRIPT_TAG, "Script", "sc")
-#else
-#define LOG_EVENTS_AND_TAGS_LIST(V) LOG_EVENTS_AND_TAGS_LIST_NO_NATIVES(V)
-#endif
+// Note that 'NATIVE_' cases for functions and scripts are mapped onto
+// original tags when writing to the log.
+
class Logger {
public:
if (active_sampler_ == NULL) return;
TickSample sample_obj;
- TickSample* sample = NULL;
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
- sample = CpuProfiler::TickSampleEvent();
-#endif
+ TickSample* sample = CpuProfiler::TickSampleEvent();
if (sample == NULL) sample = &sample_obj;
// We always sample the VM state.
// Loop until the sampler is disengaged, keeping the specified samling freq.
for ( ; sampler_->IsActive(); OS::Sleep(sampler_->interval_)) {
TickSample sample_obj;
- TickSample* sample = NULL;
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
- sample = CpuProfiler::TickSampleEvent();
-#endif
+ TickSample* sample = CpuProfiler::TickSampleEvent();
if (sample == NULL) sample = &sample_obj;
// We always sample the VM state.
// Loop until the sampler is disengaged, keeping the specified samling freq.
for ( ; sampler_->IsActive(); Sleep(sampler_->interval_)) {
TickSample sample_obj;
- TickSample* sample = NULL;
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
- sample = CpuProfiler::TickSampleEvent();
-#endif
+ TickSample* sample = CpuProfiler::TickSampleEvent();
if (sample == NULL) sample = &sample_obj;
// We always sample the VM state.
#ifndef V8_PROFILE_GENERATOR_INL_H_
#define V8_PROFILE_GENERATOR_INL_H_
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
#include "profile-generator.h"
} } // namespace v8::internal
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+#endif // ENABLE_LOGGING_AND_PROFILING
#endif // V8_PROFILE_GENERATOR_INL_H_
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
#include "v8.h"
} } // namespace v8::internal
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+#endif // ENABLE_LOGGING_AND_PROFILING
#ifndef V8_PROFILE_GENERATOR_H_
#define V8_PROFILE_GENERATOR_H_
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
#include "hashmap.h"
} } // namespace v8::internal
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+#endif // ENABLE_LOGGING_AND_PROFILING
#endif // V8_PROFILE_GENERATOR_H_
//
// Tests of profiles generator and utilities.
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
#include "v8.h"
#include "cpu-profiler-inl.h"
CHECK_EQ("bbb", bottom_up_ddd_stub_children->last()->entry()->name());
}
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+#endif // ENABLE_LOGGING_AND_PROFILING
//
// Tests of profiles generator and utilities.
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+#ifdef ENABLE_LOGGING_AND_PROFILING
#include "v8.h"
#include "profile-generator-inl.h"
CHECK_EQ(entry1, node4->entry());
}
-#endif // ENABLE_CPP_PROFILES_PROCESSOR
+#endif // ENABLE_LOGGING_AND_PROFILING
'ENABLE_LOGGING_AND_PROFILING',
'ENABLE_DEBUGGER_SUPPORT',
'ENABLE_VMSTATE_TRACKING',
- 'ENABLE_CPP_PROFILES_PROCESSOR',
],
'conditions': [
['target_arch=="arm"', {