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

Unified Diff: content/browser/tracing/etw_system_event_consumer_win.cc

Issue 1468173003: [Tracing Clock Sync] Add TracingAgent interface in Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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: content/browser/tracing/etw_system_event_consumer_win.cc
diff --git a/content/browser/tracing/etw_system_event_consumer_win.cc b/content/browser/tracing/etw_system_event_consumer_win.cc
index 529800f2202c48f7efce6795e2475e7acf20e0aa..644a56fbb4037119184ff1e7ed6000482da66c6a 100644
--- a/content/browser/tracing/etw_system_event_consumer_win.cc
+++ b/content/browser/tracing/etw_system_event_consumer_win.cc
@@ -36,8 +36,12 @@ EtwSystemEventConsumer::EtwSystemEventConsumer()
EtwSystemEventConsumer::~EtwSystemEventConsumer() {
}
-bool EtwSystemEventConsumer::StartSystemTracing() {
+std::string EtwSystemEventConsumer::GetTracingAgentName() {
+ return kETWTracingAgentName;
+}
+bool EtwSystemEventConsumer::StartAgentTracing(
+ const base::trace_event::TraceConfig& trace_config) {
// Activate kernel tracing.
if (!StartKernelSessionTracing())
return false;
@@ -52,14 +56,15 @@ bool EtwSystemEventConsumer::StartSystemTracing() {
return true;
}
-void EtwSystemEventConsumer::StopSystemTracing(const OutputCallback& callback) {
+void EtwSystemEventConsumer::StopAgentTracing(
+ const StopAgentTracingCallback& callback) {
// Deactivate kernel tracing.
if (!StopKernelSessionTracing()) {
LOG(FATAL) << "Could not stop system tracing.";
}
// Stop consuming and flush events.
- OutputCallback on_stop_system_tracing_done_callback =
+ StopAgentTracingCallback on_stop_system_tracing_done_callback =
base::Bind(&EtwSystemEventConsumer::OnStopSystemTracingDone,
base::Unretained(this),
callback);
@@ -69,7 +74,7 @@ void EtwSystemEventConsumer::StopSystemTracing(const OutputCallback& callback) {
}
void EtwSystemEventConsumer::OnStopSystemTracingDone(
- const OutputCallback& callback,
+ const StopAgentTracingCallback& callback,
const scoped_refptr<base::RefCountedString>& result) {
// Stop the consumer thread.
@@ -79,6 +84,19 @@ void EtwSystemEventConsumer::OnStopSystemTracingDone(
callback.Run(result);
}
+bool EtwSystemEventConsumer::SupportsExplicitClockSync() {
+ return false;
+}
+
+void EtwSystemEventConsumer::RecordClockSyncMarker(
+ scoped_ptr<base::DictionaryValue> marker) {
+ DCHECK(SupportsExplicitClockSync());
+}
+
+void EtwSystemEventConsumer::IssueClockSyncMarker() {
+ DCHECK(SupportsExplicitClockSync());
+}
+
bool EtwSystemEventConsumer::StartKernelSessionTracing() {
// Enabled flags (tracing facilities).
uint32 enabled_flags = EVENT_TRACE_FLAG_IMAGE_LOAD |
@@ -209,7 +227,8 @@ void EtwSystemEventConsumer::TraceAndConsumeOnThread() {
Close();
}
-void EtwSystemEventConsumer::FlushOnThread(const OutputCallback& callback) {
+void EtwSystemEventConsumer::FlushOnThread(
+ const StopAgentTracingCallback& callback) {
// Add the header information to the stream.
scoped_ptr<base::DictionaryValue> header(new base::DictionaryValue());
header->Set("name", new base::StringValue("ETW"));

Powered by Google App Engine
This is Rietveld 408576698