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

Unified Diff: src/log.cc

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/log.h ('k') | src/profiler/cpu-profiler.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 cb4e45ea7b3ab93e66febf0736f1555f537bec12..07a078f418e97e0b149b8827f0110fe0c782755e 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -23,6 +23,7 @@
#include "src/perf-jit.h"
#include "src/profiler/cpu-profiler-inl.h"
#include "src/profiler/profiler-listener.h"
+#include "src/profiler/tick-sample.h"
#include "src/runtime-profiler.h"
#include "src/string-stream.h"
#include "src/vm-state-inl.h"
@@ -646,14 +647,14 @@ class Ticker: public sampler::Sampler {
void SampleStack(const v8::RegisterState& state) override {
if (!profiler_) return;
v8::Isolate* v8_isolate = isolate();
- Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate);
+ Isolate* i_isolate = reinterpret_cast<Isolate*>(v8_isolate);
#if defined(USE_SIMULATOR)
- if (!SimulatorHelper::FillRegisters(isolate,
+ if (!SimulatorHelper::FillRegisters(i_isolate,
const_cast<v8::RegisterState*>(&state)))
return;
#endif
TickSample sample;
- sample.Init(isolate, state, TickSample::kIncludeCEntryFrame, true);
+ sample.Init(i_isolate, state, TickSample::kIncludeCEntryFrame, true);
profiler_->Insert(&sample);
}
@@ -1373,14 +1374,15 @@ void Logger::TickEvent(TickSample* sample, bool overflow) {
}
Log::MessageBuilder msg(log_);
msg.Append("%s,", kLogEventsNames[CodeEventListener::TICK_EVENT]);
- msg.AppendAddress(sample->pc);
+ msg.AppendAddress(reinterpret_cast<Address>(sample->pc));
msg.Append(",%d", static_cast<int>(timer_.Elapsed().InMicroseconds()));
if (sample->has_external_callback) {
msg.Append(",1,");
- msg.AppendAddress(sample->external_callback_entry);
+ msg.AppendAddress(
+ reinterpret_cast<Address>(sample->external_callback_entry));
} else {
msg.Append(",0,");
- msg.AppendAddress(sample->tos);
+ msg.AppendAddress(reinterpret_cast<Address>(sample->tos));
}
msg.Append(",%d", static_cast<int>(sample->state));
if (overflow) {
@@ -1388,7 +1390,7 @@ void Logger::TickEvent(TickSample* sample, bool overflow) {
}
for (unsigned i = 0; i < sample->frames_count; ++i) {
msg.Append(',');
- msg.AppendAddress(sample->stack[i]);
+ msg.AppendAddress(reinterpret_cast<Address>(sample->stack[i]));
}
msg.WriteToLogFile();
}
« no previous file with comments | « src/log.h ('k') | src/profiler/cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698