Commit 5699fab9 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cpu-profiler] Rename RecordTickSample to SymbolizeTickSample

Makes it clearer what this does. Added comments to explain it.

Change-Id: I90b0686f8a607cea32c482591b924e9103f7f445
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2205693
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67846}
parent a4d295ad
......@@ -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;
}
......
......@@ -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.
......
......@@ -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);
......
......@@ -376,7 +376,7 @@ class TestSetup {
} // namespace
TEST(RecordTickSample) {
TEST(SymbolizeTickSample) {
TestSetup test_setup;
i::Isolate* isolate = CcTest::i_isolate();
CpuProfilesCollection profiles(isolate);
......@@ -401,7 +401,7 @@ TEST(RecordTickSample) {
sample1.tos = ToPointer(0x1500);
sample1.stack[0] = ToPointer(0x1510);
sample1.frames_count = 1;
generator.RecordTickSample(sample1);
generator.SymbolizeTickSample(sample1);
TickSample sample2;
sample2.pc = ToPointer(0x1925);
sample2.tos = ToPointer(0x1900);
......@@ -409,14 +409,14 @@ TEST(RecordTickSample) {
sample2.stack[1] = ToPointer(0x10000); // non-existent.
sample2.stack[2] = ToPointer(0x1620);
sample2.frames_count = 3;
generator.RecordTickSample(sample2);
generator.SymbolizeTickSample(sample2);
TickSample sample3;
sample3.pc = ToPointer(0x1510);
sample3.tos = ToPointer(0x1500);
sample3.stack[0] = ToPointer(0x1910);
sample3.stack[1] = ToPointer(0x1610);
sample3.frames_count = 2;
generator.RecordTickSample(sample3);
generator.SymbolizeTickSample(sample3);
CpuProfile* profile = profiles.StopProfiling("");
CHECK(profile);
......@@ -470,7 +470,7 @@ TEST(SampleIds) {
sample1.pc = ToPointer(0x1600);
sample1.stack[0] = ToPointer(0x1510);
sample1.frames_count = 1;
generator.RecordTickSample(sample1);
generator.SymbolizeTickSample(sample1);
TickSample sample2;
sample2.timestamp = v8::base::TimeTicks::HighResolutionNow();
sample2.pc = ToPointer(0x1925);
......@@ -478,14 +478,14 @@ TEST(SampleIds) {
sample2.stack[1] = ToPointer(0x10000); // non-existent.
sample2.stack[2] = ToPointer(0x1620);
sample2.frames_count = 3;
generator.RecordTickSample(sample2);
generator.SymbolizeTickSample(sample2);
TickSample sample3;
sample3.timestamp = v8::base::TimeTicks::HighResolutionNow();
sample3.pc = ToPointer(0x1510);
sample3.stack[0] = ToPointer(0x1910);
sample3.stack[1] = ToPointer(0x1610);
sample3.frames_count = 2;
generator.RecordTickSample(sample3);
generator.SymbolizeTickSample(sample3);
CpuProfile* profile = profiles.StopProfiling("");
unsigned nodeId = 1;
......@@ -518,7 +518,7 @@ TEST(NoSamples) {
sample1.pc = ToPointer(0x1600);
sample1.stack[0] = ToPointer(0x1510);
sample1.frames_count = 1;
generator.RecordTickSample(sample1);
generator.SymbolizeTickSample(sample1);
CpuProfile* profile = profiles.StopProfiling("");
unsigned nodeId = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment