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

Unified Diff: src/platform-linux.cc

Issue 1635005: Allow new CPU profiling subsystem to coexist nicely with the old one. (Closed)
Patch Set: Fix TickSampleEvent Created 10 years, 8 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
Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index 9bba93b8665c35a26fc6b1b82f54da6323c0bb9c..185b2fec52feae54a80b9eeacb92527ba4bfa761 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -727,15 +727,12 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
if (signal != SIGPROF) return;
if (active_sampler_ == NULL) return;
-#ifdef ENABLE_CPP_PROFILES_PROCESSOR
- TickSample* sample = CpuProfiler::TickSampleEvent();
- if (sample == NULL) return;
- sample->pc = NULL; // Impossible value if sampling succeeds.
- sample->frames_count = 0;
-#else
TickSample sample_obj;
- TickSample* sample = &sample_obj;
+ TickSample* sample = NULL;
+#ifdef ENABLE_CPP_PROFILES_PROCESSOR
+ sample = CpuProfiler::TickSampleEvent();
#endif
+ if (sample == NULL) sample = &sample_obj;
// We always sample the VM state.
sample->state = VMState::current_state();
@@ -771,10 +768,9 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
active_sampler_->SampleStack(sample);
}
}
-#ifndef ENABLE_CPP_PROFILES_PROCESSOR
+
active_sampler_->Tick(sample);
#endif
-#endif
}
« src/cpu-profiler-inl.h ('K') | « src/log.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698