diff options
author | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-09 21:26:28 +0000 |
---|---|---|
committer | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-09 21:26:28 +0000 |
commit | 9b221756628153638da5db1e46ca5ab42e12e88f (patch) | |
tree | 908d7ba18dce8eaab48779f2a3371ea78a0f0d91 /base/profiler.h | |
parent | db811c343705e846aba6fe47015de1eb5bacaf14 (diff) | |
download | chromium_src-9b221756628153638da5db1e46ca5ab42e12e88f.zip chromium_src-9b221756628153638da5db1e46ca5ab42e12e88f.tar.gz chromium_src-9b221756628153638da5db1e46ca5ab42e12e88f.tar.bz2 |
Add API functions to control Quantify, as well as expose these
functions to javascript.
Review URL: http://codereview.chromium.org/40255
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11291 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/profiler.h')
-rw-r--r-- | base/profiler.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/base/profiler.h b/base/profiler.h new file mode 100644 index 0000000..6882c02 --- /dev/null +++ b/base/profiler.h @@ -0,0 +1,39 @@ +// 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__ + +#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(); + + // 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__ + |