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

Unified Diff: src/log.cc

Issue 50052: Support profiler stack sampling in any situation. (Closed)
Patch Set: Fixes according to comments Created 11 years, 9 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 | « src/log.h ('k') | src/platform-win32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index bb895e289184a27f332e87a6eb2e34890a558597..d1683b53c5258026c620cb1ba4571294a5d259b2 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -142,28 +142,17 @@ void StackTracer::Trace(TickSample* sample) {
return;
}
- // If c_entry_fp is available, this means that we are inside a C++
- // function and sample->fp value isn't reliable due to FPO.
- if (Top::c_entry_fp(Top::GetCurrentThread()) != NULL) {
- SafeStackTraceFrameIterator it(
- reinterpret_cast<Address>(sample->sp),
- reinterpret_cast<Address>(low_stack_bound_));
- int i = 0;
- while (!it.done() && i < TickSample::kMaxFramesCount) {
- sample->stack[i++] = it.frame()->pc();
- it.Advance();
- }
- sample->frames_count = i;
- } else if (sample->sp < sample->fp && sample->fp < low_stack_bound_) {
- // The check assumes that stack grows from lower addresses.
- sample->stack[0] = Memory::Address_at(
- (Address)(sample->fp + StandardFrameConstants::kCallerPCOffset));
- sample->frames_count = 1;
- } else {
- // FP seems to be in some intermediate state,
- // better discard this sample
- sample->frames_count = 0;
+ SafeStackTraceFrameIterator it(
+ reinterpret_cast<Address>(sample->fp),
+ reinterpret_cast<Address>(sample->sp),
+ reinterpret_cast<Address>(sample->sp),
+ reinterpret_cast<Address>(low_stack_bound_));
+ int i = 0;
+ while (!it.done() && i < TickSample::kMaxFramesCount) {
+ sample->stack[i++] = it.frame()->pc();
+ it.Advance();
}
+ sample->frames_count = i;
}
@@ -936,7 +925,7 @@ void Logger::TickEvent(TickSample* sample, bool overflow) {
msg.Append(",overflow");
}
for (int i = 0; i < sample->frames_count; ++i) {
- msg.Append(",%p", sample->stack[i]);
+ msg.Append(",0x%x", reinterpret_cast<uint32_t>(sample->stack[i]));
}
msg.Append('\n');
msg.WriteToLogFile();
« no previous file with comments | « src/log.h ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698