Skip to content

Commit 6ff56eb

Browse files
author
Mihail Slavchev
committed
fix profiler
1 parent ad6c5be commit 6ff56eb

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

src/jni/Profiler.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,18 @@ bool Profiler::Write(CpuProfile *cpuProfile)
179179
for (int i = 0; i < sampleCount; i++)
180180
{
181181
auto format = (i > 0) ? ",%d" : "%d";
182-
snprintf(buff, sizeof(buff), format, cpuProfile->GetSample(i)->GetScriptId());
182+
snprintf(buff, sizeof(buff), format, cpuProfile->GetSample(i)->GetNodeId());
183183
fwrite(buff, sizeof(char), strlen(buff), fp);
184184
}
185185

186-
// TODO: update V8, see https://codereview.chromium.org/259803002/
187-
/*
188-
snprintf(buff, sizeof(buff), "],\"timestamps\":[");
189-
fwrite(buff, sizeof(char), strlen(buff), fp);
190-
auto currTimeStamp = startTimeStamp;
191-
for (int i=0; i<sampleCount; i++)
192-
{
193-
auto format = (i > 0) ? ",%lld" : "%lld";
194-
snprintf(buff, sizeof(buff), format, cpuProfile->GetSampleTimestamp(i));
195-
fwrite(buff, sizeof(char), strlen(buff), fp);
196-
}
197-
*/
186+
snprintf(buff, sizeof(buff), "],\"timestamps\":[");
187+
fwrite(buff, sizeof(char), strlen(buff), fp);
188+
for (int i=0; i<sampleCount; i++)
189+
{
190+
auto format = (i > 0) ? ",%lld" : "%lld";
191+
snprintf(buff, sizeof(buff), format, cpuProfile->GetSampleTimestamp(i));
192+
fwrite(buff, sizeof(char), strlen(buff), fp);
193+
}
198194

199195
fwrite("]}", sizeof(char), 2, fp);
200196
fclose(fp);

0 commit comments

Comments
 (0)