OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Use trace_analyzer::Query and trace_analyzer::TraceAnalyzer to search for | 5 // Use trace_analyzer::Query and trace_analyzer::TraceAnalyzer to search for |
6 // specific trace events that were generated by the trace_event.h API. | 6 // specific trace events that were generated by the trace_event.h API. |
7 // | 7 // |
8 // Basic procedure: | 8 // Basic procedure: |
9 // - Get trace events JSON string from base::debug::TraceLog. | 9 // - Get trace events JSON string from base::debug::TraceLog. |
10 // - Create TraceAnalyzer with JSON string. | 10 // - Create TraceAnalyzer with JSON string. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // EXPECT_TRUE(events[i].GetAbsTimeToOtherEvent(&duration)); | 71 // EXPECT_TRUE(events[i].GetAbsTimeToOtherEvent(&duration)); |
72 // EXPECT_LT(duration, 1000000.0/60.0); // expect less than 1/60 second. | 72 // EXPECT_LT(duration, 1000000.0/60.0); // expect less than 1/60 second. |
73 // } | 73 // } |
74 | 74 |
75 | 75 |
76 #ifndef BASE_TEST_TRACE_EVENT_ANALYZER_H_ | 76 #ifndef BASE_TEST_TRACE_EVENT_ANALYZER_H_ |
77 #define BASE_TEST_TRACE_EVENT_ANALYZER_H_ | 77 #define BASE_TEST_TRACE_EVENT_ANALYZER_H_ |
78 | 78 |
79 #include <map> | 79 #include <map> |
80 | 80 |
81 #include "base/debug/trace_event.h" | |
82 #include "base/memory/ref_counted.h" | 81 #include "base/memory/ref_counted.h" |
| 82 #include "base/trace_event/trace_event.h" |
83 | 83 |
84 namespace base { | 84 namespace base { |
85 class Value; | 85 class Value; |
86 } | 86 } |
87 | 87 |
88 namespace trace_analyzer { | 88 namespace trace_analyzer { |
89 class QueryNode; | 89 class QueryNode; |
90 | 90 |
91 // trace_analyzer::TraceEvent is a more convenient form of the | 91 // trace_analyzer::TraceEvent is a more convenient form of the |
92 // base::debug::TraceEvent class to make tracing-based tests easier to write. | 92 // base::debug::TraceEvent class to make tracing-based tests easier to write. |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 | 696 |
697 // Count all matches. | 697 // Count all matches. |
698 static inline size_t CountMatches(const TraceEventVector& events, | 698 static inline size_t CountMatches(const TraceEventVector& events, |
699 const Query& query) { | 699 const Query& query) { |
700 return CountMatches(events, query, 0u, events.size()); | 700 return CountMatches(events, query, 0u, events.size()); |
701 } | 701 } |
702 | 702 |
703 } // namespace trace_analyzer | 703 } // namespace trace_analyzer |
704 | 704 |
705 #endif // BASE_TEST_TRACE_EVENT_ANALYZER_H_ | 705 #endif // BASE_TEST_TRACE_EVENT_ANALYZER_H_ |
OLD | NEW |