diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/base.gyp | 8 | ||||
-rw-r--r-- | base/base.gypi | 8 | ||||
-rw-r--r-- | base/profiler.cc | 60 | ||||
-rw-r--r-- | base/profiler.h | 42 |
4 files changed, 8 insertions, 110 deletions
diff --git a/base/base.gyp b/base/base.gyp index 5145404..8e0b1e9 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -191,6 +191,14 @@ 'sources': [ 'nix/xdg_util_unittest.cc', ], + 'conditions': [ + [ 'linux_use_tcmalloc==1', { + 'dependencies': [ + 'allocator/allocator.gyp:allocator', + ], + }, + ], + ], 'dependencies': [ '../build/linux/system.gyp:gtk', '../build/linux/system.gyp:nss', diff --git a/base/base.gypi b/base/base.gypi index 992cdcc..2adb528 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -179,8 +179,6 @@ 'process_util_posix.cc', 'process_util_win.cc', 'process_win.cc', - 'profiler.cc', - 'profiler.h', 'rand_util.cc', 'rand_util.h', 'rand_util_posix.cc', @@ -550,12 +548,6 @@ }, }, ], - [ 'linux_use_tcmalloc==1', { - 'dependencies': [ - 'allocator/allocator.gyp:allocator', - ], - }, - ], ], 'dependencies': [ 'symbolize', diff --git a/base/profiler.cc b/base/profiler.cc deleted file mode 100644 index b66664b..0000000 --- a/base/profiler.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/profiler.h" - -#if defined(USE_TCMALLOC) && defined(OS_LINUX) -#include "third_party/tcmalloc/chromium/src/google/profiler.h" -#endif - -// When actually using quantify, uncomment the following line. -// #define QUANTIFY - -#ifdef QUANTIFY -// this #define is used to prevent people from directly using pure.h -// instead of profiler.h -#define PURIFY_PRIVATE_INCLUDE -#include "base/third_party/purify/pure.h" -#endif // QUANTIFY - -namespace base { - -void Profiler::StartRecording() { -#ifdef QUANTIFY - QuantifyStartRecordingData(); -#elif defined(USE_TCMALLOC) && defined(OS_LINUX) - ProfilerStart("chrome-profile"); -#endif -} - -void Profiler::StopRecording() { -#ifdef QUANTIFY - QuantifyStopRecordingData(); -#elif defined(USE_TCMALLOC) && defined(OS_LINUX) - ProfilerStop(); -#endif -} - -void Profiler::Flush() { -#if defined(USE_TCMALLOC) && defined(OS_LINUX) - ProfilerFlush(); -#endif -} - -void Profiler::ClearData() { -#ifdef QUANTIFY - QuantifyClearData(); -#endif -} - -void Profiler::SetThreadName(const char *name) { -#ifdef QUANTIFY - // make a copy since the Quantify function takes a char*, not const char* - char buffer[512]; - base::snprintf(buffer, sizeof(buffer)-1, "%s", name); - QuantifySetThreadName(buffer); -#endif -} - -} // namespace base diff --git a/base/profiler.h b/base/profiler.h deleted file mode 100644 index ea8867a..0000000 --- a/base/profiler.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// An abstraction for functions used to control execution time profiling. -// All methods are effectively no-ops unless this program is being run through -// a supported tool (currently only Quantify, a companion tool to Purify) - -#ifndef BASE_PROFILER_H__ -#define BASE_PROFILER_H__ -#pragma once - -#include "base/basictypes.h" - -namespace base { - -class Profiler { - public: - // Starts or resumes recording. - static void StartRecording(); - - // Stops recording until StartRecording is called or the program exits. - static void StopRecording(); - - // Throw away data collected so far. This can be useful to call before - // your first call to StartRecording, for instance to avoid counting any - // time in application startup. - static void ClearData(); - - // Flushes all recorded data to disk. No-op until recording is started. - static void Flush(); - - // Sets the name of the current thread for display in the profiler's UI. - static void SetThreadName(const char *name); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(Profiler); -}; - -} // namespace base - -#endif // BASE_PROFILER_H__ |