| Index: chromeos/dbus/debug_daemon_client.cc
|
| diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc
|
| index 59e98405b866f82255ae0e6953d0cdcbd4c13640..9a993b3fe517261073d6f06579a2c77505030c73 100644
|
| --- a/chromeos/dbus/debug_daemon_client.cc
|
| +++ b/chromeos/dbus/debug_daemon_client.cc
|
| @@ -161,6 +161,19 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
|
| callback));
|
| }
|
|
|
| + void GetPerfOutput(uint32_t duration,
|
| + const GetPerfOutputCallback& callback) override {
|
| + dbus::MethodCall method_call(debugd::kDebugdInterface,
|
| + debugd::kGetRandomPerfOutput);
|
| + dbus::MessageWriter writer(&method_call);
|
| + writer.AppendUint32(duration);
|
| +
|
| + debugdaemon_proxy_->CallMethod(
|
| + &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
| + base::Bind(&DebugDaemonClientImpl::OnGetPerfOutput,
|
| + weak_ptr_factory_.GetWeakPtr(), callback));
|
| + }
|
| +
|
| void GetScrubbedLogs(const GetLogsCallback& callback) override {
|
| dbus::MethodCall method_call(debugd::kDebugdInterface,
|
| debugd::kGetFeedbackLogs);
|
| @@ -461,6 +474,35 @@ class DebugDaemonClientImpl : public DebugDaemonClient {
|
| callback.Run(data);
|
| }
|
|
|
| + void OnGetPerfOutput(const GetPerfOutputCallback& callback,
|
| + dbus::Response* response) {
|
| + if (!response)
|
| + return;
|
| +
|
| + dbus::MessageReader reader(response);
|
| +
|
| + int status = 0;
|
| + if (!reader.PopInt32(&status))
|
| + return;
|
| +
|
| + const uint8* buffer = nullptr;
|
| + size_t buf_size = 0;
|
| +
|
| + if (!reader.PopArrayOfBytes(&buffer, &buf_size))
|
| + return;
|
| + std::vector<uint8> perf_data;
|
| + if (buf_size > 0)
|
| + perf_data.insert(perf_data.end(), buffer, buffer + buf_size);
|
| +
|
| + if (!reader.PopArrayOfBytes(&buffer, &buf_size))
|
| + return;
|
| + std::vector<uint8> perf_stat;
|
| + if (buf_size > 0)
|
| + perf_stat.insert(perf_stat.end(), buffer, buffer + buf_size);
|
| +
|
| + callback.Run(status, perf_data, perf_stat);
|
| + }
|
| +
|
| void OnGetAllLogs(const GetLogsCallback& callback,
|
| dbus::Response* response) {
|
| std::map<std::string, std::string> logs;
|
|
|