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

Unified Diff: src/profiler/tick-sample.h

Issue 2105943002: Expose TickSample and its APIs in v8-profiler.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 5 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/profiler/profile-generator.cc ('k') | src/profiler/tick-sample.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/tick-sample.h
diff --git a/src/profiler/tick-sample.h b/src/profiler/tick-sample.h
index 0a651aff10c5c36b2665810f68d0f12d7c9b9335..c7c42e63a28d10f6216d68179989247814e17d16 100644
--- a/src/profiler/tick-sample.h
+++ b/src/profiler/tick-sample.h
@@ -5,10 +5,8 @@
#ifndef V8_PROFILER_TICK_SAMPLE_H_
#define V8_PROFILER_TICK_SAMPLE_H_
-#include "include/v8.h"
-
+#include "include/v8-profiler.h"
#include "src/base/platform/time.h"
-#include "src/frames.h"
#include "src/globals.h"
namespace v8 {
@@ -16,49 +14,13 @@ namespace internal {
class Isolate;
-// ----------------------------------------------------------------------------
-// Sampler
-//
-// A sampler periodically samples the state of the VM and optionally
-// (if used for profiling) the program counter and stack pointer for
-// the thread that created it.
-
-// TickSample captures the information collected for each sample.
-struct TickSample {
- // Internal profiling (with --prof + tools/$OS-tick-processor) wants to
- // include the runtime function we're calling. Externally exposed tick
- // samples don't care.
- enum RecordCEntryFrame { kIncludeCEntryFrame, kSkipCEntryFrame };
-
- TickSample()
- : state(OTHER),
- pc(NULL),
- external_callback_entry(NULL),
- frames_count(0),
- has_external_callback(false),
- update_stats(true) {}
+struct TickSample : public v8::TickSample {
+ TickSample() : v8::TickSample() {}
void Init(Isolate* isolate, const v8::RegisterState& state,
RecordCEntryFrame record_c_entry_frame, bool update_stats);
- static bool GetStackSample(Isolate* isolate, const v8::RegisterState& state,
- RecordCEntryFrame record_c_entry_frame,
- void** frames, size_t frames_limit,
- v8::SampleInfo* sample_info);
- StateTag state; // The state of the VM.
- Address pc; // Instruction pointer.
- union {
- Address tos; // Top stack value (*sp).
- Address external_callback_entry;
- };
- static const unsigned kMaxFramesCountLog2 = 8;
- static const unsigned kMaxFramesCount = (1 << kMaxFramesCountLog2) - 1;
- Address stack[kMaxFramesCount]; // Call stack.
base::TimeTicks timestamp;
- unsigned frames_count : kMaxFramesCountLog2; // Number of captured frames.
- bool has_external_callback : 1;
- bool update_stats : 1; // Whether the sample should update aggregated stats.
};
-
#if defined(USE_SIMULATOR)
class SimulatorHelper {
public:
« no previous file with comments | « src/profiler/profile-generator.cc ('k') | src/profiler/tick-sample.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698