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

Unified Diff: src/platform.h

Issue 21403: Added the simplest call stack sampling and call profile in tick processor output. (Closed)
Patch Set: Merged after Soren's changes to logging Created 11 years, 10 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.cc ('k') | src/platform-freebsd.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform.h
diff --git a/src/platform.h b/src/platform.h
index 6165bd9389f96e72b23de10b05384572474a8385..b77ad6a5cfa97cd8a4b93631c6ab5335e9a7750e 100644
--- a/src/platform.h
+++ b/src/platform.h
@@ -422,10 +422,29 @@ class Semaphore {
// TickSample captures the information collected for each sample.
class TickSample {
public:
- TickSample() : pc(0), sp(0), state(OTHER) {}
+ TickSample() : pc(0), sp(0), fp(0), state(OTHER) {}
unsigned int pc; // Instruction pointer.
unsigned int sp; // Stack pointer.
+ unsigned int fp; // Frame pointer.
StateTag state; // The state of the VM.
+ SmartPointer<Address> stack; // Call stack, null-terminated.
+
+ inline TickSample& operator=(const TickSample& rhs) {
+ if (this == &rhs) return *this;
+ pc = rhs.pc;
+ sp = rhs.sp;
+ fp = rhs.fp;
+ state = rhs.state;
+ DeleteArray(stack.Detach());
+ stack = rhs.stack;
+ return *this;
+ }
+
+ inline void InitStack(int depth) {
+ stack = SmartPointer<Address>(NewArray<Address>(depth + 1));
+ // null-terminate
+ stack[depth] = 0;
+ }
};
class Sampler {
« no previous file with comments | « src/log.cc ('k') | src/platform-freebsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698