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

Unified Diff: base/test/trace_event_analyzer.h

Issue 8682027: Add TraceAnalyzer support for START/FINISH events and JSON error logging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « no previous file | base/test/trace_event_analyzer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/trace_event_analyzer.h
diff --git a/base/test/trace_event_analyzer.h b/base/test/trace_event_analyzer.h
index d41cff2ec0bc1ce1c34184a5ddcb7758bc98e7ab..e24f0cca90b36f4ab5ca17a5c1dcab380ce2fecd 100644
--- a/base/test/trace_event_analyzer.h
+++ b/base/test/trace_event_analyzer.h
@@ -158,6 +158,8 @@ struct TraceEvent {
std::string name;
+ std::string id;
+
// All numbers and bool values from TraceEvent args are cast to double.
// bool becomes 1.0 (true) or 0.0 (false).
std::map<std::string, double> arg_numbers;
@@ -183,6 +185,7 @@ enum TraceEventMember {
EVENT_PHASE,
EVENT_CATEGORY,
EVENT_NAME,
+ EVENT_ID,
// Evaluates to true if arg exists and is a string.
// Usage: Query(EVENT_HAS_STRING_ARG, "arg_name")
@@ -205,6 +208,7 @@ enum TraceEventMember {
OTHER_PHASE,
OTHER_CATEGORY,
OTHER_NAME,
+ OTHER_ID,
// Evaluates to true if arg exists and is a string.
// Usage: Query(EVENT_HAS_STRING_ARG, "arg_name")
@@ -252,8 +256,13 @@ class Query {
// Find BEGIN events that have a corresponding END event.
static Query MatchBeginWithEnd() {
- return (Query(EVENT_PHASE) ==
- Query::Phase(TRACE_EVENT_PHASE_BEGIN)) &&
+ return (Query(EVENT_PHASE) == Query::Phase(TRACE_EVENT_PHASE_BEGIN)) &&
+ Query(EVENT_HAS_OTHER);
+ }
+
+ // Find START events that have a corresponding FINISH event.
+ static Query MatchStartWithFinish() {
+ return (Query(EVENT_PHASE) == Query::Phase(TRACE_EVENT_PHASE_START)) &&
Query(EVENT_HAS_OTHER);
}
@@ -425,6 +434,11 @@ class TraceAnalyzer {
// about:tracing.
void AssociateBeginEndEvents();
+ // Associate START and FINISH events with each other.
+ // A FINISH event will match the most recent START event with the same name,
+ // category, and ID.
+ void AssociateStartFinishEvents();
+
// AssociateEvents can be used to customize event associations by setting the
// other_event member of TraceEvent. This should be used to associate two
// INSTANT events.
« no previous file with comments | « no previous file | base/test/trace_event_analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698