summaryrefslogtreecommitdiffstats
path: root/base/debug/profiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/debug/profiler.h')
-rw-r--r--base/debug/profiler.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/base/debug/profiler.h b/base/debug/profiler.h
new file mode 100644
index 0000000..e3044d6
--- /dev/null
+++ b/base/debug/profiler.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2011 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.
+
+#ifndef BASE_DEBUG_PROFILER_H
+#define BASE_DEBUG_PROFILER_H
+#pragma once
+
+#include <string>
+
+// The Profiler functions allow usage of the underlying sampling based
+// profiler. If the application has not been built with the necessary
+// flags (-DENABLE_PROFILING and not -DNO_TCMALLOC) then these functions
+// are noops.
+namespace base {
+namespace debug {
+
+// Start profiling with the supplied name.
+// {pid} will be replaced by the process' pid and {count} will be replaced
+// by the count of the profile run (starts at 1 with each process).
+void StartProfiling(const std::string& name);
+
+// Stop profiling and write out data.
+void StopProfiling();
+
+// Force data to be written to file.
+void FlushProfiling();
+
+// Returns true if process is being profiled.
+bool BeingProfiled();
+
+} // namespace debug
+} // namespace base
+
+#endif // BASE_DEBUG_DEBUGGER_H