summaryrefslogtreecommitdiff
path: root/chromium/v8/src/profiler
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/v8/src/profiler')
-rw-r--r--chromium/v8/src/profiler/cpu-profiler.cc4
-rw-r--r--chromium/v8/src/profiler/cpu-profiler.h2
-rw-r--r--chromium/v8/src/profiler/heap-snapshot-generator.cc4
-rw-r--r--chromium/v8/src/profiler/profile-generator.cc2
-rw-r--r--chromium/v8/src/profiler/profile-generator.h5
-rw-r--r--chromium/v8/src/profiler/tick-sample.cc7
-rw-r--r--chromium/v8/src/profiler/tracing-cpu-profiler.cc5
7 files changed, 17 insertions, 12 deletions
diff --git a/chromium/v8/src/profiler/cpu-profiler.cc b/chromium/v8/src/profiler/cpu-profiler.cc
index 5f22a3d2fb4..71130f65ed6 100644
--- a/chromium/v8/src/profiler/cpu-profiler.cc
+++ b/chromium/v8/src/profiler/cpu-profiler.cc
@@ -208,7 +208,7 @@ SamplingEventsProcessor::ProcessOneSample() {
(record1.order == last_processed_code_event_id_)) {
TickSampleEventRecord record;
ticks_from_vm_buffer_.Dequeue(&record);
- generator_->RecordTickSample(record.sample);
+ generator_->SymbolizeTickSample(record.sample);
return OneSampleProcessed;
}
@@ -220,7 +220,7 @@ SamplingEventsProcessor::ProcessOneSample() {
if (record->order != last_processed_code_event_id_) {
return FoundSampleForNextCodeEvent;
}
- generator_->RecordTickSample(record->sample);
+ generator_->SymbolizeTickSample(record->sample);
ticks_buffer_.Remove();
return OneSampleProcessed;
}
diff --git a/chromium/v8/src/profiler/cpu-profiler.h b/chromium/v8/src/profiler/cpu-profiler.h
index e3ff5bb734d..65e6d13d44b 100644
--- a/chromium/v8/src/profiler/cpu-profiler.h
+++ b/chromium/v8/src/profiler/cpu-profiler.h
@@ -156,7 +156,7 @@ class ProfilerCodeObserver;
class V8_EXPORT_PRIVATE ProfilerEventsProcessor : public base::Thread,
public CodeEventObserver {
public:
- virtual ~ProfilerEventsProcessor();
+ ~ProfilerEventsProcessor() override;
void CodeEventHandler(const CodeEventsContainer& evt_rec) override;
diff --git a/chromium/v8/src/profiler/heap-snapshot-generator.cc b/chromium/v8/src/profiler/heap-snapshot-generator.cc
index 16e87e43c77..2fa4f2e5e84 100644
--- a/chromium/v8/src/profiler/heap-snapshot-generator.cc
+++ b/chromium/v8/src/profiler/heap-snapshot-generator.cc
@@ -11,6 +11,7 @@
#include "src/debug/debug.h"
#include "src/handles/global-handles.h"
#include "src/heap/combined-heap.h"
+#include "src/heap/safepoint.h"
#include "src/numbers/conversions.h"
#include "src/objects/allocation-site-inl.h"
#include "src/objects/api-callbacks.h"
@@ -1129,7 +1130,7 @@ void V8HeapExplorer::ExtractScriptReferences(HeapEntry* entry, Script script) {
SetInternalReference(entry, "source", script.source(), Script::kSourceOffset);
SetInternalReference(entry, "name", script.name(), Script::kNameOffset);
SetInternalReference(entry, "context_data", script.context_data(),
- Script::kContextOffset);
+ Script::kContextDataOffset);
TagObject(script.line_ends(), "(script line ends)");
SetInternalReference(entry, "line_ends", script.line_ends(),
Script::kLineEndsOffset);
@@ -2037,6 +2038,7 @@ bool HeapSnapshotGenerator::GenerateSnapshot() {
GarbageCollectionReason::kHeapProfiler);
NullContextForSnapshotScope null_context_scope(Isolate::FromHeap(heap_));
+ SafepointScope scope(heap_);
#ifdef VERIFY_HEAP
Heap* debug_heap = heap_;
diff --git a/chromium/v8/src/profiler/profile-generator.cc b/chromium/v8/src/profiler/profile-generator.cc
index 42ff71c2bb1..b38a67771ba 100644
--- a/chromium/v8/src/profiler/profile-generator.cc
+++ b/chromium/v8/src/profiler/profile-generator.cc
@@ -872,7 +872,7 @@ ProfileGenerator::ProfileGenerator(CpuProfilesCollection* profiles,
CodeMap* code_map)
: profiles_(profiles), code_map_(code_map) {}
-void ProfileGenerator::RecordTickSample(const TickSample& sample) {
+void ProfileGenerator::SymbolizeTickSample(const TickSample& sample) {
ProfileStackTrace stack_trace;
// Conservatively reserve space for stack frames + pc + function + vm-state.
// There could in fact be more of them because of inlined entries.
diff --git a/chromium/v8/src/profiler/profile-generator.h b/chromium/v8/src/profiler/profile-generator.h
index e71a0abaead..1f9d5370ae7 100644
--- a/chromium/v8/src/profiler/profile-generator.h
+++ b/chromium/v8/src/profiler/profile-generator.h
@@ -520,7 +520,10 @@ class V8_EXPORT_PRIVATE ProfileGenerator {
public:
explicit ProfileGenerator(CpuProfilesCollection* profiles, CodeMap* code_map);
- void RecordTickSample(const TickSample& sample);
+ // Use the CodeMap to turn the raw addresses recorded in the sample into
+ // code/function names. The symbolized stack is added to the relevant
+ // profiles in the CpuProfilesCollection.
+ void SymbolizeTickSample(const TickSample& sample);
void UpdateNativeContextAddress(Address from, Address to);
diff --git a/chromium/v8/src/profiler/tick-sample.cc b/chromium/v8/src/profiler/tick-sample.cc
index 00bff91cd0a..1de13445dea 100644
--- a/chromium/v8/src/profiler/tick-sample.cc
+++ b/chromium/v8/src/profiler/tick-sample.cc
@@ -10,7 +10,7 @@
#include "src/execution/frames-inl.h"
#include "src/execution/simulator.h"
#include "src/execution/vm-state-inl.h"
-#include "src/heap/heap-inl.h" // For MemoryAllocator::code_range.
+#include "src/heap/heap-inl.h" // For Heap::code_range.
#include "src/logging/counters.h"
#include "src/sanitizer/asan.h"
#include "src/sanitizer/msan.h"
@@ -337,7 +337,10 @@ bool TickSample::GetStackSample(Isolate* v8_isolate, RegisterState* regs,
continue;
}
}
- frames[i++] = reinterpret_cast<void*>(it.frame()->pc());
+ // For arm64, the PC for the frame sometimes doesn't come from the stack,
+ // but from the link register instead. For this reason, we skip
+ // authenticating it.
+ frames[i++] = reinterpret_cast<void*>(it.frame()->unauthenticated_pc());
}
sample_info->frames_count = i;
return true;
diff --git a/chromium/v8/src/profiler/tracing-cpu-profiler.cc b/chromium/v8/src/profiler/tracing-cpu-profiler.cc
index afed9ca73b1..d18ae09fb14 100644
--- a/chromium/v8/src/profiler/tracing-cpu-profiler.cc
+++ b/chromium/v8/src/profiler/tracing-cpu-profiler.cc
@@ -50,10 +50,7 @@ void TracingCpuProfilerImpl::OnTraceDisabled() {
void TracingCpuProfilerImpl::StartProfiling() {
base::MutexGuard lock(&mutex_);
if (!profiling_enabled_ || profiler_) return;
- bool enabled;
- TRACE_EVENT_CATEGORY_GROUP_ENABLED(
- TRACE_DISABLED_BY_DEFAULT("v8.cpu_profiler.hires"), &enabled);
- int sampling_interval_us = enabled ? 100 : 1000;
+ int sampling_interval_us = 100;
profiler_.reset(new CpuProfiler(isolate_, kDebugNaming));
profiler_->set_sampling_interval(
base::TimeDelta::FromMicroseconds(sampling_interval_us));