OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 }; | 134 }; |
135 | 135 |
136 | 136 |
137 /** | 137 /** |
138 * Interface for controlling CPU profiling. Instance of the | 138 * Interface for controlling CPU profiling. Instance of the |
139 * profiler can be retrieved using v8::Isolate::GetCpuProfiler. | 139 * profiler can be retrieved using v8::Isolate::GetCpuProfiler. |
140 */ | 140 */ |
141 class V8_EXPORT CpuProfiler { | 141 class V8_EXPORT CpuProfiler { |
142 public: | 142 public: |
143 /** | 143 /** |
144 * A note on security tokens usage. As scripts from different | 144 * Changes default CPU profiler sampling interval to the specified number |
145 * origins can run inside a single V8 instance, it is possible to | 145 * of microseconds. Default interval is 1000us. This method must be called |
146 * have functions from different security contexts intermixed in a | 146 * when there are no profiles being recorded. |
147 * single CPU profile. To avoid exposing function names belonging to | |
148 * other contexts, filtering by security token is performed while | |
149 * obtaining profiling results. | |
150 */ | 147 */ |
| 148 void SetSamplingInterval(int us); |
151 | 149 |
152 /** | 150 /** |
153 * Returns the number of profiles collected (doesn't include | 151 * Returns the number of profiles collected (doesn't include |
154 * profiles that are being collected at the moment of call.) | 152 * profiles that are being collected at the moment of call.) |
155 */ | 153 */ |
156 int GetProfileCount(); | 154 int GetProfileCount(); |
157 | 155 |
158 /** Returns a profile by index. */ | 156 /** Returns a profile by index. */ |
159 const CpuProfile* GetCpuProfile(int index); | 157 const CpuProfile* GetCpuProfile(int index); |
160 | 158 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 uint32_t index; // Index of the time interval that was changed. | 558 uint32_t index; // Index of the time interval that was changed. |
561 uint32_t count; // New value of count field for the interval with this index. | 559 uint32_t count; // New value of count field for the interval with this index. |
562 uint32_t size; // New value of size field for the interval with this index. | 560 uint32_t size; // New value of size field for the interval with this index. |
563 }; | 561 }; |
564 | 562 |
565 | 563 |
566 } // namespace v8 | 564 } // namespace v8 |
567 | 565 |
568 | 566 |
569 #endif // V8_V8_PROFILER_H_ | 567 #endif // V8_V8_PROFILER_H_ |
OLD | NEW |