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

Unified Diff: src/profiler/cpu-profiler.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8-profiler.h ('k') | src/profiler/profile-generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/cpu-profiler.cc
diff --git a/src/profiler/cpu-profiler.cc b/src/profiler/cpu-profiler.cc
index 7a0cf9c8bfabc571b82cfad26f29f1e60138960f..c14b0ef1bdfb1c29cab3c91c794e27536d3702e0 100644
--- a/src/profiler/cpu-profiler.cc
+++ b/src/profiler/cpu-profiler.cc
@@ -326,33 +326,21 @@ void CpuProfiler::StartProcessorIfNotStarted() {
processor_->StartSynchronously();
}
-
CpuProfile* CpuProfiler::StopProfiling(const char* title) {
if (!is_profiling_) return nullptr;
StopProcessorIfLastProfile(title);
- CpuProfile* result = profiles_->StopProfiling(title);
- if (result) {
- result->Print();
- }
- return result;
+ return profiles_->StopProfiling(title);
}
-
CpuProfile* CpuProfiler::StopProfiling(String* title) {
- if (!is_profiling_) return nullptr;
- const char* profile_title = profiles_->GetName(title);
- StopProcessorIfLastProfile(profile_title);
- return profiles_->StopProfiling(profile_title);
+ return StopProfiling(profiles_->GetName(title));
}
-
void CpuProfiler::StopProcessorIfLastProfile(const char* title) {
- if (profiles_->IsLastProfile(title)) {
- StopProcessor();
- }
+ if (!profiles_->IsLastProfile(title)) return;
+ StopProcessor();
}
-
void CpuProfiler::StopProcessor() {
Logger* logger = isolate_->logger();
is_profiling_ = false;
« no previous file with comments | « include/v8-profiler.h ('k') | src/profiler/profile-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698