startTime of cpu profile

28 views
Skip to first unread message

theratliter theratliter

unread,
Jul 31, 2023, 5:58:39 PM7/31/23
to v8-users
hello, everyone ! Does anyone know what the `startTime` is in the cpu profile. From the code point of view (v8/src/base/platform/time.cc), it seems that the implementation is different under different systems?20230801-010505.jpeg

Ben Noordhuis

unread,
Jul 31, 2023, 8:21:59 PM7/31/23
to v8-u...@googlegroups.com
On Mon, Jul 31, 2023 at 7:58 PM theratliter theratliter
<thera...@gmail.com> wrote:
>
> hello, everyone ! Does anyone know what the `startTime` is in the cpu profile. From the code point of view (v8/src/base/platform/time.cc), it seems that the implementation is different under different systems?

startTime is the system time in microseconds, and yes, the meaning of
"system time" is different across platforms. It's probably best to
treat it as counting from some arbitrary point in the past.

FWIW, I believe you should prefer the "ts" field over "startTime". The
former aligns with the timestamps used in the tracing subsystem.

theratliter theratliter

unread,
Aug 1, 2023, 11:22:06 AM8/1/23
to v8-users
Thanks, Ben. What does the "ts" field mean ? i can not find this field in cpu profile. I want to find the corresponding samples of the code that was executed at a certain time.

Ben Noordhuis

unread,
Aug 2, 2023, 8:27:01 AM8/2/23
to v8-u...@googlegroups.com
On Tue, Aug 1, 2023 at 1:22 PM theratliter theratliter
<thera...@gmail.com> wrote:
>
> Thanks, Ben. What does the "ts" field mean ? i can not find this field in cpu profile. I want to find the corresponding samples of the code that was executed at a certain time.

Sorry, I phrased that kind of ambiguously. "ts" is a property of the
"v8.cpu_profiler" trace event that's emitted when you start/stop the
profiler. It doesn't show up in the CPU profile output like
"startTime" does.

If you use event tracing, you should use "ts" because otherwise you
can't sync profiles with traces.

If you don't use event tracing, you can ignore all that. :-)

theratliter theratliter

unread,
Aug 2, 2023, 11:06:48 AM8/2/23
to v8-users
Get it, thanks !
Reply all
Reply to author
Forward
0 new messages