summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/debug_daemon_client.h
diff options
context:
space:
mode:
authorsque <sque@chromium.org>2015-07-08 14:26:48 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-08 21:27:39 +0000
commite0260fd891172eb94a614751b1c77596e476bab2 (patch)
tree4d7a4fe359b3f2a2884538283efe74e336eb9c21 /chromeos/dbus/debug_daemon_client.h
parent414ace50483ecf98debd9f5ae4f75f1c6124dd05 (diff)
downloadchromium_src-e0260fd891172eb94a614751b1c77596e476bab2.zip
chromium_src-e0260fd891172eb94a614751b1c77596e476bab2.tar.gz
chromium_src-e0260fd891172eb94a614751b1c77596e476bab2.tar.bz2
metrics: Add dbus interface for GetRandomPerfOutput
GetRandomPerfOutput is a new dbus method call that replaces the older GetRichPerfData method call to debugd. The difference is that the new method call can return either a PerfDataProto or a PerfStatProto. Also updating PerfProvider to use the new dbus interface and parse and store the result as either protobuf format. BUG=chromium:478289 TEST=Set |kPerfProfilingIntervalMs| to something short (e.g. 15 sec) and add logging to ParseOutputProtoIfValid() to verify that valid PerfDataProto or PerfStatProto data was received. Signed-off-by: Simon Que <sque@chromium.org> Review URL: https://codereview.chromium.org/1218583002 Cr-Commit-Position: refs/heads/master@{#337910}
Diffstat (limited to 'chromeos/dbus/debug_daemon_client.h')
-rw-r--r--chromeos/dbus/debug_daemon_client.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/chromeos/dbus/debug_daemon_client.h b/chromeos/dbus/debug_daemon_client.h
index 85b1ccd..9a4d678 100644
--- a/chromeos/dbus/debug_daemon_client.h
+++ b/chromeos/dbus/debug_daemon_client.h
@@ -15,10 +15,6 @@
#include "chromeos/dbus/dbus_client.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
-namespace metrics {
-class PerfDataProto;
-}
-
namespace chromeos {
// DebugDaemonClient is used to communicate with the debug daemon.
@@ -93,9 +89,26 @@ class CHROMEOS_EXPORT DebugDaemonClient : public DBusClient {
GetPerfDataCallback;
// Runs perf for |duration| seconds and returns data collected.
+ // TODO(sque): This is being replaced by GetPerfOutput(). Remove this function
+ // and the above callback typedef when the new function is running.
virtual void GetPerfData(uint32_t duration,
const GetPerfDataCallback& callback) = 0;
+ // Called once GetPerfOutput() is complete only if the the data is
+ // successfully obtained from debugd.
+ // Arguments:
+ // - The status from running perf.
+ // - Output from "perf record", in PerfDataProto format.
+ // - Output from "perf stat", in PerfStatProto format.
+ using GetPerfOutputCallback =
+ base::Callback<void(int status,
+ const std::vector<uint8>& perf_data,
+ const std::vector<uint8>& perf_stat)>;
+
+ // Runs perf for |duration| seconds and returns data collected.
+ virtual void GetPerfOutput(uint32_t duration,
+ const GetPerfOutputCallback& callback) = 0;
+
// Callback type for GetScrubbedLogs(), GetAllLogs() or GetUserLogFiles().
typedef base::Callback<void(bool succeeded,
const std::map<std::string, std::string>& logs)>