summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/debug_daemon_client.h
diff options
context:
space:
mode:
authorasharif@chromium.org <asharif@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-04 20:00:25 +0000
committerasharif@chromium.org <asharif@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-04 20:00:25 +0000
commitf65859e8e1414ffba1b165be9d89745d42ffec79 (patch)
treefe046f738bcf77820b0e5047ecef8b7a9304ca2a /chromeos/dbus/debug_daemon_client.h
parent5bb22d0294fb13c712f8185c1e6d8e66655d7443 (diff)
downloadchromium_src-f65859e8e1414ffba1b165be9d89745d42ffec79.zip
chromium_src-f65859e8e1414ffba1b165be9d89745d42ffec79.tar.gz
chromium_src-f65859e8e1414ffba1b165be9d89745d42ffec79.tar.bz2
Chrome: Enable ChromeOS-Wide-Profiling
We want to gather perf data collected by running "perf record -a" from opt-in ChromeOS users. This CL enables that. We use debugd in ChromeOS to run quipper, a program that runs "perf record -a" and returns that data in a protobuf. We do this every 12 hours for 2 seconds. The overhead is minimal (5% slowdown for 2 seconds on "lumpy" machines). BUG=157508 TEST=Manual: Change the perf record interval from 12 hours to 1 minute and set a breakpoint on ParseProtoIfValid(). It gets hit and the protobuf is parsed properly. Review URL: https://chromiumcodereview.appspot.com/11185038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180484 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/debug_daemon_client.h')
-rw-r--r--chromeos/dbus/debug_daemon_client.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/chromeos/dbus/debug_daemon_client.h b/chromeos/dbus/debug_daemon_client.h
index 073189c..1ed0215 100644
--- a/chromeos/dbus/debug_daemon_client.h
+++ b/chromeos/dbus/debug_daemon_client.h
@@ -17,6 +17,10 @@ namespace dbus {
class Bus;
} // namespace dbus
+namespace metrics {
+class PerfDataProto;
+}
+
namespace chromeos {
// DebugDaemonClient is used to communicate with the debug daemon.
@@ -75,6 +79,15 @@ class CHROMEOS_EXPORT DebugDaemonClient {
virtual void GetNetworkInterfaces(
const GetNetworkInterfacesCallback& callback) = 0;
+ // Called once GetPerfData() is complete only if the the data is successfully
+ // obtained from debugd.
+ typedef base::Callback<void(const std::vector<uint8>& data)>
+ GetPerfDataCallback;
+
+ // Runs perf for |duration| seconds and returns data collected.
+ virtual void GetPerfData(uint32_t duration,
+ const GetPerfDataCallback& callback) = 0;
+
// Callback type for GetAllLogs() or GetUserLogFiles().
typedef base::Callback<void(bool succeeded,
const std::map<std::string, std::string>& logs)>