OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_TEST_BASE_TRACING_H_ | 5 #ifndef CHROME_TEST_BASE_TRACING_H_ |
6 #define CHROME_TEST_BASE_TRACING_H_ | 6 #define CHROME_TEST_BASE_TRACING_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // | 22 // |
23 // Example: BeginTracing("test_MyTest*"); | 23 // Example: BeginTracing("test_MyTest*"); |
24 // Example: BeginTracing("test_MyTest*,test_OtherStuff"); | 24 // Example: BeginTracing("test_MyTest*,test_OtherStuff"); |
25 // Example: BeginTracing("-excluded_category1,-excluded_category2"); | 25 // Example: BeginTracing("-excluded_category1,-excluded_category2"); |
26 // | 26 // |
27 // See base/trace_event/trace_event.h for documentation of included and excluded | 27 // See base/trace_event/trace_event.h for documentation of included and excluded |
28 // category_patterns. | 28 // category_patterns. |
29 bool BeginTracing(const std::string& category_patterns) WARN_UNUSED_RESULT; | 29 bool BeginTracing(const std::string& category_patterns) WARN_UNUSED_RESULT; |
30 | 30 |
31 // Called from UI thread. | 31 // Called from UI thread. |
32 // Specify a watch event in order to use the WaitForWatchEvent function. | |
33 // After |num_occurrences| of the given event have been seen on a particular | |
34 // process, WaitForWatchEvent will return. | |
35 bool BeginTracingWithWatch(const std::string& category_patterns, | |
36 const std::string& category_name, | |
37 const std::string& event_name, | |
38 int num_occurrences) WARN_UNUSED_RESULT; | |
39 | |
40 // Called from UI thread. | |
41 // Begin tracing specified category_patterns on the browser. | 32 // Begin tracing specified category_patterns on the browser. |
42 // |trace_config| specifies the configuration for tracing. This includes the | 33 // |trace_config| specifies the configuration for tracing. This includes the |
43 // list of categories enabled, tracing modes and memory dumps configuration. | 34 // list of categories enabled, tracing modes and memory dumps configuration. |
44 // | 35 // |
45 // See base/trace_event/trace_config.h for documentation of configurations. | 36 // See base/trace_event/trace_config.h for documentation of configurations. |
46 bool BeginTracingWithTraceConfig( | 37 bool BeginTracingWithTraceConfig( |
47 const base::trace_event::TraceConfig& trace_config) WARN_UNUSED_RESULT; | 38 const base::trace_event::TraceConfig& trace_config) WARN_UNUSED_RESULT; |
48 | 39 |
49 // Called from UI thread. | 40 // Called from UI thread. |
50 // Wait on the event set with BeginTracingWithWatch. If non-zero, return after | |
51 // |timeout| regardless of watch event notification. Returns true if watch event | |
52 // occurred, false if it timed out. | |
53 bool WaitForWatchEvent(base::TimeDelta timeout) WARN_UNUSED_RESULT; | |
54 | |
55 // Called from UI thread. | |
56 // End trace and collect the trace output as a json string. | 41 // End trace and collect the trace output as a json string. |
57 bool EndTracing(std::string* json_trace_output) WARN_UNUSED_RESULT; | 42 bool EndTracing(std::string* json_trace_output) WARN_UNUSED_RESULT; |
58 | 43 |
59 } // namespace tracing | 44 } // namespace tracing |
60 | 45 |
61 #endif // CHROME_TEST_BASE_TRACING_H_ | 46 #endif // CHROME_TEST_BASE_TRACING_H_ |
OLD | NEW |