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

Unified Diff: base/debug/profiler.h

Issue 6250070: Added command line switches and UI (controlled via a build option) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Some cleanup Created 9 years, 11 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
Index: base/debug/profiler.h
diff --git a/base/debug/profiler.h b/base/debug/profiler.h
new file mode 100644
index 0000000000000000000000000000000000000000..da81d62385ff14bb67ef5ec2586fce5009af4c7f
--- /dev/null
+++ b/base/debug/profiler.h
@@ -0,0 +1,39 @@
+// 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.
+
+// This is a cross platform interface for helper functions related to
+// debuggers. You should use this to test if you're running under a debugger,
+// and if you would like to yield (breakpoint) into the debugger.
Evan Martin 2011/02/01 02:45:59 This comment is wrong, no?
DaveMoore 2011/02/01 19:21:55 Done.
+
+#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);
jamesr 2011/02/01 01:21:45 nit: should this be by reference?
DaveMoore 2011/02/01 19:21:55 Done.
+
+// 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
« no previous file with comments | « base/base.gypi ('k') | base/debug/profiler.cc » ('j') | base/debug/profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698