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

Side by Side Diff: src/profiler/tracing-cpu-profiler.h

Issue 2396733002: [profiler] Tracing-based CPU profiler. (Closed)
Patch Set: Addressing comments + moving traced-value back to src/tracing Created 4 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « src/profiler/profile-generator-inl.h ('k') | src/profiler/tracing-cpu-profiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project 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 V8_PROFILER_TRACING_CPU_PROFILER_H 5 #ifndef V8_PROFILER_TRACING_CPU_PROFILER_H
6 #define V8_PROFILER_TRACING_CPU_PROFILER_H 6 #define V8_PROFILER_TRACING_CPU_PROFILER_H
7 7
8 #include "include/v8-platform.h"
8 #include "include/v8-profiler.h" 9 #include "include/v8-profiler.h"
10 #include "src/base/atomic-utils.h"
9 #include "src/base/macros.h" 11 #include "src/base/macros.h"
12 #include "src/base/platform/mutex.h"
10 13
11 namespace v8 { 14 namespace v8 {
12 namespace internal { 15 namespace internal {
13 16
14 class TracingCpuProfilerImpl final : public TracingCpuProfiler { 17 class CpuProfiler;
18 class Isolate;
19
20 class TracingCpuProfilerImpl final : public TracingCpuProfiler,
21 private v8::Platform::TraceStateObserver {
15 public: 22 public:
16 explicit TracingCpuProfilerImpl(Isolate*); 23 explicit TracingCpuProfilerImpl(Isolate*);
17 ~TracingCpuProfilerImpl(); 24 ~TracingCpuProfilerImpl();
18 25
26 // v8::Platform::TraceStateObserver
27 void OnTraceEnabled() final;
28 void OnTraceDisabled() final;
29
19 private: 30 private:
31 void StartProfiling();
32 void StopProfiling();
33
34 Isolate* isolate_;
35 std::unique_ptr<CpuProfiler> profiler_;
36 bool profiling_enabled_;
37 base::Mutex mutex_;
38
20 DISALLOW_COPY_AND_ASSIGN(TracingCpuProfilerImpl); 39 DISALLOW_COPY_AND_ASSIGN(TracingCpuProfilerImpl);
21 }; 40 };
22 41
23 } // namespace internal 42 } // namespace internal
24 } // namespace v8 43 } // namespace v8
25 44
26 #endif // V8_PROFILER_TRACING_CPU_PROFILER_H 45 #endif // V8_PROFILER_TRACING_CPU_PROFILER_H
OLDNEW
« no previous file with comments | « src/profiler/profile-generator-inl.h ('k') | src/profiler/tracing-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698