Implement tracing interface for v8
This is based on the Skia Implementation.
More on the project can be found here:
https://docs.google.com/a/chromium.org/document/d/1_4LAnInOB8tM_DLjptWiszRwa4qwiSsDzMkO4tU-Qes/edit#heading=h.p97rw6yt8o2j
The V8 Tracing platform will replace the isolate->event_logger().
But since the current embedders (namely chromium) currently use the isolate->event_logger, I made the default implementation (event-tracer) call into isolate->event_logger if an event_logger was set.
Once the embedders properly implement the interface (for example in chromium it would look like this: https://codereview.chromium.org/707273005/), the default implementation will be doing nothing.
Once the embedders side is fixed, we will change how V8 uses the tracing framework beyond the call from Logger:CallEventLogger. (which would also include a d8 implementation)
BUG=v8:4560
LOG=N
Committed: https://crrev.com/70a7c754bf3445a8b783b75ca2a7aa34cdeb080b
Cr-Commit-Position: refs/heads/master@{#32959}
It generally seems to me that we are moving some logic from Chromium/Blink into V8 ...
5 years, 9 months ago
(2015-03-13 08:07:48 UTC)
#5
It generally seems to me that we are moving some logic from Chromium/Blink into
V8 for little gain, but causes some problems (that I already mentioned).
Why don't we keep the EventLogger callback and put the bulk of this CL in
Blink's V8 bindings, in the LogEventCallback? Do you plan to add more than
TRACE_EVENT_BEGIN0 and TRACE_EVENT_END0 in log-inl.h?
https://codereview.chromium.org/988893003/diff/160001/src/tracing/event-trace...
File src/tracing/event-tracer.cc (right):
https://codereview.chromium.org/988893003/diff/160001/src/tracing/event-trace...
src/tracing/event-tracer.cc:35: i::Isolate* isolate_ = i::Isolate::Current();
- Do not use Isolate::Current anymore. We are trying to get rid of it.
- This use of default init value seems wrong. We would use the same Isolate
returned Isolate::Current() at the point of the first call to GetInstance. It's
not guaranteed that the isolate is even alive when we run addTraceEvent.
fmeawad
Hi Yang, Thank you for your quick review. I have fixed the isolate issue. The ...
5 years, 9 months ago
(2015-03-17 01:18:04 UTC)
#6
Hi Yang,
Thank you for your quick review.
I have fixed the isolate issue. The event-tracer implementation was intended to
be very temporary as I was trying to simplify a 3-repo (V8/Blink/Chromium)
change. But I found that it might not be needed. After this CL lands, the
chromium change will go in, which will result duplicate v8 events at the moment.
But I will have the blink CL ready as well and try to commit it right after the
Chromium CL lands (to remove the duplication).
The event-tracer in chromium is going in src/gin and not in Blink
The Blink CL will remove the event-logger from the blink side.
You also had a concern of why we are implementing this for little to no gain.
The idea is to have tracing being used in V8 similar to how it is used in Blink,
Skia, and Chromium. Currently, V8 have limited logging/tracing, and we want to
expand that.
Immediate wins: disabled categories (to be used for IcMisses and some GC logs),
Async events and flow events (to be used across threads) as well as adding more
arguments to any log entry.
The short term plan to to have the CallLogger use it, but eventually we will
remove both the CallLogger and the HistogramTimers in favor of tracing.
It will also enable us to remove the logging logic from V8 and push into the
embedders. (A d8 CL will follow).
After this CL lands, any V8 developer can
#include trace-event.h and start using the tracing macros.
https://codereview.chromium.org/988893003/diff/160001/include/v8-tracing.h
File include/v8-tracing.h (right):
https://codereview.chromium.org/988893003/diff/160001/include/v8-tracing.h#ne...
include/v8-tracing.h:26: // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
On 2015/03/13 07:52:10, Yang wrote:
> Please use the shorter license header here and elsewhere:
>
> // Copyright 2012 the V8 project authors. All rights reserved.
> // Use of this source code is governed by a BSD-style license that can be
> // found in the LICENSE file.
Done.
https://codereview.chromium.org/988893003/diff/160001/include/v8-tracing.h#ne...
include/v8-tracing.h:66: virtual const uint8_t* getCategoryGroupEnabled(const
char* name) = 0;
On 2015/03/13 07:52:10, Yang wrote:
> Please use all upper case here and below.
Done.
https://codereview.chromium.org/988893003/diff/160001/include/v8-tracing.h#ne...
include/v8-tracing.h:80: static EventTracer* gInstance;
On 2015/03/13 07:52:10, Yang wrote:
> V8 doesn't use this naming convention. Just calling it "instance" is fine.
Done.
https://codereview.chromium.org/988893003/diff/160001/src/tracing/event-trace...
File src/tracing/event-tracer.cc (right):
https://codereview.chromium.org/988893003/diff/160001/src/tracing/event-trace...
src/tracing/event-tracer.cc:35: i::Isolate* isolate_ = i::Isolate::Current();
On 2015/03/13 08:07:48, Yang wrote:
> - Do not use Isolate::Current anymore. We are trying to get rid of it.
> - This use of default init value seems wrong. We would use the same Isolate
> returned Isolate::Current() at the point of the first call to GetInstance.
It's
> not guaranteed that the isolate is even alive when we run addTraceEvent.
Done.
https://codereview.chromium.org/988893003/diff/160001/src/tracing/event-trace...
src/tracing/event-tracer.cc:68: static void cleanup_tracer() {
On 2015/03/13 07:52:10, Yang wrote:
> I'd use CamelCase for those function names.
Done.
https://codereview.chromium.org/988893003/diff/160001/src/tracing/trace-event.h
File src/tracing/trace-event.h (right):
https://codereview.chromium.org/988893003/diff/160001/src/tracing/trace-event...
src/tracing/trace-event.h:3: // modification, are permitted provided that the
following conditions are
On 2015/03/13 07:52:10, Yang wrote:
> I assume that this file originates from Chromium? How do we make sure this
stays
> in sync?
It does originate from chromium. At the moment there is no guarantee that it
would stay in sync. But there are multiple instance of it in third_parties
already (e.g. Blink, Skia, Webrtc, Angle, ...). So it is known to be everywhere,
so changing it is limited.
There is a plan to make it in its own library, but not in the near future.
Even if it gets out of sink (which might happen if V8 or other library have
different needs), it will always use the same interface (as defined in
v8-tracing.h).
Yang
If I'm not mistaken, the next step would be to replace logging in V8 by ...
5 years, 9 months ago
(2015-03-17 10:43:39 UTC)
#7
If I'm not mistaken, the next step would be to replace logging in V8 by those
TRACE_* macros and then implement the logging backend (a EventTracer instance).
However, we have the use case of wanting to produce a V8-specific v8.log when
running Chrome for example with --js-flags="--prof". More often than not, in
this use case, worker threads run their own isolates, so that we have to use
--logfile-per-isolate to prevent events from different isolates to get mixed up.
Now that EventTracer does not distinguish between isolates, I don't see how that
can be implemented.
Is there any alternative way to produce an isolate-specific equivalent to
v8.log in Chrome?
jochen (gone - plz use gerrit)
with the current integration in blink where we run one isolate per thread, aggregating samples ...
5 years, 9 months ago
(2015-03-17 10:47:32 UTC)
#8
with the current integration in blink where we run one isolate per thread,
aggregating samples per thread should work, no?
Yang
On 2015/03/17 10:47:32, jochen (slow) wrote: > with the current integration in blink where we ...
5 years, 9 months ago
(2015-03-17 10:53:09 UTC)
#9
On 2015/03/17 10:47:32, jochen (slow) wrote:
> with the current integration in blink where we run one isolate per thread,
> aggregating samples per thread should work, no?
I'm just concerned that the workflow of running Chrome with --js-flag="--prof
--logfile-per-isolate" to use V8's tools for profiling/visualizing will break
without adequate replacement.
nduca
Hmm! I think this is actually an interesting use case to get right, if possible... ...
5 years, 9 months ago
(2015-03-17 11:07:00 UTC)
#10
Hmm! I think this is actually an interesting use case to get right, if
possible...
I'm open to storing an isolate id or "world id" on every trace event that comes
in from v8 or blink. For instance, we could add to base/debug/trace_event* a iid
field on each trace event, and figure out how to plumb that into the AddEvent
calls. It might be a pain to plumb, but I think at the other end, it would allow
trace viewer to show the entire trace by "renderers" instead of right now by
thread.
This could give us the right long term way to clean up how Devtools timeline
figures out which parts of a trace should show up: it right now just assumes all
of the CrRendererMain is running tasks for the tab being inspected. But, I think
if we could store the isolate id on events, then we'd be working toward a less
hacky solution there too...
I'm a little unclear if isolate-ids on tasks is "the solution" for devtools use
case, or if we want to store something a little more chrome-side specific as the
id. But this does seem like a promising avenue...
Fadi, wanna brainstorm a little bit about options here in person?
yurys
On 2015/03/17 11:07:00, nduca wrote: > Hmm! I think this is actually an interesting use ...
5 years, 9 months ago
(2015-03-18 08:56:16 UTC)
#11
On 2015/03/17 11:07:00, nduca wrote:
> Hmm! I think this is actually an interesting use case to get right, if
> possible...
>
> I'm open to storing an isolate id or "world id" on every trace event that
comes
> in from v8 or blink. For instance, we could add to base/debug/trace_event* a
iid
> field on each trace event, and figure out how to plumb that into the AddEvent
> calls. It might be a pain to plumb, but I think at the other end, it would
allow
> trace viewer to show the entire trace by "renderers" instead of right now by
> thread.
>
> This could give us the right long term way to clean up how Devtools timeline
> figures out which parts of a trace should show up: it right now just assumes
all
> of the CrRendererMain is running tasks for the tab being inspected. But, I
think
> if we could store the isolate id on events, then we'd be working toward a less
> hacky solution there too...
>
Nat, can you elaborate on this?
I don't see how storing isolate id on trace events would help link events to
tabs.
All tabs are rendered on the main thread and share one and the same isolate.
Each
worker runs on its own separate thread which in turn has its own isolate. AFAIU
adding
isolate id doesn't add new information as we already have tid in each event.
On 2015/03/18 08:56:16, yurys wrote: > On 2015/03/17 11:07:00, nduca wrote: > > Hmm! I ...
5 years, 9 months ago
(2015-03-18 18:17:40 UTC)
#13
On 2015/03/18 08:56:16, yurys wrote:
> On 2015/03/17 11:07:00, nduca wrote:
> > Hmm! I think this is actually an interesting use case to get right, if
> > possible...
> >
> > I'm open to storing an isolate id or "world id" on every trace event that
> comes
> > in from v8 or blink. For instance, we could add to base/debug/trace_event* a
> iid
> > field on each trace event, and figure out how to plumb that into the
AddEvent
> > calls. It might be a pain to plumb, but I think at the other end, it would
> allow
> > trace viewer to show the entire trace by "renderers" instead of right now by
> > thread.
> >
> > This could give us the right long term way to clean up how Devtools timeline
> > figures out which parts of a trace should show up: it right now just assumes
> all
> > of the CrRendererMain is running tasks for the tab being inspected. But, I
> think
> > if we could store the isolate id on events, then we'd be working toward a
less
> > hacky solution there too...
> >
> Nat, can you elaborate on this?
> I don't see how storing isolate id on trace events would help link events to
> tabs.
> All tabs are rendered on the main thread and share one and the same isolate.
> Each
> worker runs on its own separate thread which in turn has its own isolate.
AFAIU
> adding
> isolate id doesn't add new information as we already have tid in each event.
Nat and I had a couple of discussions yesterday,
I will write up a doc and share it with everyone on this bug as well as the
tracing team.
Questions I have, is thread to isolate relation always one-to-one?
How about service workers? How about Web workers?
Is the optimizing compiler run in the same Isolate? (I know it runs in a
different thread)
jochen (gone - plz use gerrit)
> Nat and I had a couple of discussions yesterday, > I will write up ...
5 years, 9 months ago
(2015-03-18 18:26:58 UTC)
#14
> Nat and I had a couple of discussions yesterday,
> I will write up a doc and share it with everyone on this bug as well as the
tracing team.
> Questions I have, is thread to isolate relation always one-to-one?
in renderer processes, yes.
> How about service workers? How about Web workers?
a worker runs in a thread in a renderer (each worker has its own thread)
> Is the optimizing compiler run in the same Isolate? (I know it runs in a
different thread)
the optimizing compiler and the GC sweeper run in chromium's thread pool
(base::WorkerPool)
fmeawad
On 2015/03/18 18:26:58, jochen (OOO) wrote: > > Nat and I had a couple of ...
5 years, 8 months ago
(2015-04-02 20:26:44 UTC)
#15
On 2015/03/18 18:26:58, jochen (OOO) wrote:
> > Nat and I had a couple of discussions yesterday,
> > I will write up a doc and share it with everyone on this bug as well as the
> tracing team.
> > Questions I have, is thread to isolate relation always one-to-one?
>
> in renderer processes, yes.
>
> > How about service workers? How about Web workers?
>
> a worker runs in a thread in a renderer (each worker has its own thread)
>
> > Is the optimizing compiler run in the same Isolate? (I know it runs in a
> different thread)
>
> the optimizing compiler and the GC sweeper run in chromium's thread pool
> (base::WorkerPool)
Sorry for the late reply, as follow is a doc with a cid implementation
suggestion:https://docs.google.com/a/chromium.org/document/d/1gv6DB8XPhHNk7ld1GK9la49_5WpqQ4d5wP6-VHb4u_I/edit
5 years, 5 months ago
(2015-07-06 06:49:32 UTC)
#19
+caseq
caseq
+1 to getting this done (and willing to help if needed, as I had a ...
5 years, 5 months ago
(2015-07-08 09:53:04 UTC)
#20
+1 to getting this done (and willing to help if needed, as I had a somewhat
similar CL before yurys@ kindly pointed me here).
We would like to start relying on trace events emitted by v8 in DevTools'
Timeline (in particular, crbug.com/508005 depends on this), but would like a
finer break-down by categories, as opposed to everything being traced as "v8"
now. Being able to pass additional arguments would eventually be useful, too.
This all calls for exposing the reach interface to tracing, in particular for
categories -- just passing categories via event logger would greatly increase
the overhead, as we won't be able to cache pointers to enable flags on the trace
site as trace macros do now.
Yang and Jochen, would keeping existing TimerEventScope<TimerEventFoo> along
with per-isolate logging to file while deprecating SetEventLogger() from public
Isolate API address your concern of per-isolate logging? We could also expose
isolate id via tracing events as Nat suggests, though I think existing event
logger callback do not actually require this.
fmeawad
On 2015/07/08 09:53:04, caseq wrote: > +1 to getting this done (and willing to help ...
5 years, 5 months ago
(2015-07-08 16:44:25 UTC)
#21
On 2015/07/08 09:53:04, caseq wrote:
> +1 to getting this done (and willing to help if needed, as I had a somewhat
> similar CL before yurys@ kindly pointed me here).
>
> We would like to start relying on trace events emitted by v8 in DevTools'
> Timeline (in particular, crbug.com/508005 depends on this), but would like a
> finer break-down by categories, as opposed to everything being traced as "v8"
> now. Being able to pass additional arguments would eventually be useful, too.
> This all calls for exposing the reach interface to tracing, in particular for
> categories -- just passing categories via event logger would greatly increase
> the overhead, as we won't be able to cache pointers to enable flags on the
trace
> site as trace macros do now.
>
> Yang and Jochen, would keeping existing TimerEventScope<TimerEventFoo> along
> with per-isolate logging to file while deprecating SetEventLogger() from
public
> Isolate API address your concern of per-isolate logging? We could also expose
> isolate id via tracing events as Nat suggests, though I think existing event
> logger callback do not actually require this.
I am currently working on adding isolate id (context id) to trace events. How
about we land this CL as is, leave the current logging technique for V8 until we
get isolate id in trace events? This would allow us to get the V8 team to start
using the trace macros right away. Adding the isolate id only happens in tracing
code.
dsinclair
On 2015/07/08 16:44:25, fmeawad wrote: > On 2015/07/08 09:53:04, caseq wrote: > > +1 to ...
5 years, 4 months ago
(2015-08-05 19:01:26 UTC)
#22
On 2015/07/08 16:44:25, fmeawad wrote:
> On 2015/07/08 09:53:04, caseq wrote:
> > +1 to getting this done (and willing to help if needed, as I had a somewhat
> > similar CL before yurys@ kindly pointed me here).
> >
> > We would like to start relying on trace events emitted by v8 in DevTools'
> > Timeline (in particular, crbug.com/508005 depends on this), but would like a
> > finer break-down by categories, as opposed to everything being traced as
"v8"
> > now. Being able to pass additional arguments would eventually be useful,
too.
> > This all calls for exposing the reach interface to tracing, in particular
for
> > categories -- just passing categories via event logger would greatly
increase
> > the overhead, as we won't be able to cache pointers to enable flags on the
> trace
> > site as trace macros do now.
> >
> > Yang and Jochen, would keeping existing TimerEventScope<TimerEventFoo> along
> > with per-isolate logging to file while deprecating SetEventLogger() from
> public
> > Isolate API address your concern of per-isolate logging? We could also
expose
> > isolate id via tracing events as Nat suggests, though I think existing event
> > logger callback do not actually require this.
>
> I am currently working on adding isolate id (context id) to trace events. How
> about we land this CL as is, leave the current logging technique for V8 until
we
> get isolate id in trace events? This would allow us to get the V8 team to
start
> using the trace macros right away. Adding the isolate id only happens in
tracing
> code.
The context_id stuff landed right? So, does that mean we can move this forward
again?
fmeawad
On 2015/08/05 19:01:26, dsinclair wrote: > On 2015/07/08 16:44:25, fmeawad wrote: > > On 2015/07/08 ...
5 years, 4 months ago
(2015-08-05 19:40:32 UTC)
#23
On 2015/08/05 19:01:26, dsinclair wrote:
> On 2015/07/08 16:44:25, fmeawad wrote:
> > On 2015/07/08 09:53:04, caseq wrote:
> > > +1 to getting this done (and willing to help if needed, as I had a
somewhat
> > > similar CL before yurys@ kindly pointed me here).
> > >
> > > We would like to start relying on trace events emitted by v8 in DevTools'
> > > Timeline (in particular, crbug.com/508005 depends on this), but would like
a
> > > finer break-down by categories, as opposed to everything being traced as
> "v8"
> > > now. Being able to pass additional arguments would eventually be useful,
> too.
> > > This all calls for exposing the reach interface to tracing, in particular
> for
> > > categories -- just passing categories via event logger would greatly
> increase
> > > the overhead, as we won't be able to cache pointers to enable flags on the
> > trace
> > > site as trace macros do now.
> > >
> > > Yang and Jochen, would keeping existing TimerEventScope<TimerEventFoo>
along
> > > with per-isolate logging to file while deprecating SetEventLogger() from
> > public
> > > Isolate API address your concern of per-isolate logging? We could also
> expose
> > > isolate id via tracing events as Nat suggests, though I think existing
event
> > > logger callback do not actually require this.
> >
> > I am currently working on adding isolate id (context id) to trace events.
How
> > about we land this CL as is, leave the current logging technique for V8
until
> we
> > get isolate id in trace events? This would allow us to get the V8 team to
> start
> > using the trace macros right away. Adding the isolate id only happens in
> tracing
> > code.
>
> The context_id stuff landed right? So, does that mean we can move this forward
> again?
Yes, the chrome changes landed. I will rework this CL to include the changes.
fmeawad
dsinclair, PTAL.
5 years, 3 months ago
(2015-08-25 03:20:38 UTC)
#24
dsinclair, PTAL.
fmeawad
The CQ bit was checked by fmeawad@chromium.org to run a CQ dry run
5 years, 3 months ago
(2015-08-25 03:24:08 UTC)
#25
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/988893003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/988893003/240001
5 years, 3 months ago
(2015-08-25 03:24:21 UTC)
#26
Dry run: No L-G-T-M from a valid reviewer yet. Only full committers are accepted. Even ...
5 years, 3 months ago
(2015-08-25 03:24:23 UTC)
#28
Dry run: No L-G-T-M from a valid reviewer yet. Only full committers are
accepted.
Even if an L-G-T-M may have been provided, it was from a non-committer,
_not_ a full super star committer.
See http://www.chromium.org/getting-involved/become-a-committer
Note that this has nothing to do with OWNERS files.
dsinclair
lgtm w/ nits https://codereview.chromium.org/988893003/diff/240001/include/v8-tracing.h File include/v8-tracing.h (right): https://codereview.chromium.org/988893003/diff/240001/include/v8-tracing.h#newcode32 include/v8-tracing.h:32: // These values must be in ...
5 years, 3 months ago
(2015-08-25 13:56:22 UTC)
#29
https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h File include/v8-tracing.h (right): https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h#newcode49 include/v8-tracing.h:49: virtual EventTracer::Handle AddTraceEvent( I'm very positive about the CL ...
5 years, 3 months ago
(2015-08-25 22:02:46 UTC)
#31
https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h
File include/v8-tracing.h (right):
https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h#ne...
include/v8-tracing.h:49: virtual EventTracer::Handle AddTraceEvent(
I'm very positive about the CL in general, but rather than introducing
additional class for embedders to implement, can we just add these to
v8::Platform? Besides simplifying the API slightly, there's another small
advantage in that docs already stress well the need for InitializePlatform to be
called before v8 initialization, which I think is critical in case of tracing
(due to caching of category pointers).
5 years, 3 months ago
(2015-08-27 10:48:56 UTC)
#32
On 2015/08/25 22:02:46, caseq wrote:
> https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h
> File include/v8-tracing.h (right):
>
>
https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h#ne...
> include/v8-tracing.h:49: virtual EventTracer::Handle AddTraceEvent(
> I'm very positive about the CL in general, but rather than introducing
> additional class for embedders to implement, can we just add these to
> v8::Platform? Besides simplifying the API slightly, there's another small
> advantage in that docs already stress well the need for InitializePlatform to
be
> called before v8 initialization, which I think is critical in case of tracing
> (due to caching of category pointers).
I still feel very uncomfortable about dropping a copy of a huge file from
Chromium (trace-event-common.h) into V8 without any automated way to know
whether it needs to be updated. We have no precedence for this sort of thing. I
would be a lot more comfortable if we had some way, maybe via gclient, to
synchronize.
dsinclair
On 2015/08/27 10:48:56, Yang wrote: > On 2015/08/25 22:02:46, caseq wrote: > > https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h > ...
5 years, 3 months ago
(2015-08-27 13:05:52 UTC)
#33
On 2015/08/27 10:48:56, Yang wrote:
> On 2015/08/25 22:02:46, caseq wrote:
> > https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h
> > File include/v8-tracing.h (right):
> >
> >
>
https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h#ne...
> > include/v8-tracing.h:49: virtual EventTracer::Handle AddTraceEvent(
> > I'm very positive about the CL in general, but rather than introducing
> > additional class for embedders to implement, can we just add these to
> > v8::Platform? Besides simplifying the API slightly, there's another small
> > advantage in that docs already stress well the need for InitializePlatform
to
> be
> > called before v8 initialization, which I think is critical in case of
tracing
> > (due to caching of category pointers).
>
> I still feel very uncomfortable about dropping a copy of a huge file from
> Chromium (trace-event-common.h) into V8 without any automated way to know
> whether it needs to be updated. We have no precedence for this sort of thing.
I
> would be a lot more comfortable if we had some way, maybe via gclient, to
> synchronize.
The common.h file is there to be copied into other projects. We add to the file
but we don't modify the current values of anything. So, while chrome may get a
new macro that v8 doesn't have, until v8 needs that macro the header can be out
of sync. This is what is currently being done in blink, skia and nacl.
If v8 wants to add new macros they should be added into the chrome version
first, as mentioned in the .h file.
fmeawad
On 2015/08/27 13:05:52, dsinclair wrote: > On 2015/08/27 10:48:56, Yang wrote: > > On 2015/08/25 ...
5 years, 3 months ago
(2015-08-31 20:27:43 UTC)
#34
On 2015/08/27 13:05:52, dsinclair wrote:
> On 2015/08/27 10:48:56, Yang wrote:
> > On 2015/08/25 22:02:46, caseq wrote:
> > > https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h
> > > File include/v8-tracing.h (right):
> > >
> > >
> >
>
https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h#ne...
> > > include/v8-tracing.h:49: virtual EventTracer::Handle AddTraceEvent(
> > > I'm very positive about the CL in general, but rather than introducing
> > > additional class for embedders to implement, can we just add these to
> > > v8::Platform? Besides simplifying the API slightly, there's another small
> > > advantage in that docs already stress well the need for InitializePlatform
> to
> > be
> > > called before v8 initialization, which I think is critical in case of
> tracing
> > > (due to caching of category pointers).
> >
> > I still feel very uncomfortable about dropping a copy of a huge file from
> > Chromium (trace-event-common.h) into V8 without any automated way to know
> > whether it needs to be updated. We have no precedence for this sort of
thing.
> I
> > would be a lot more comfortable if we had some way, maybe via gclient, to
> > synchronize.
>
>
> The common.h file is there to be copied into other projects. We add to the
file
> but we don't modify the current values of anything. So, while chrome may get a
> new macro that v8 doesn't have, until v8 needs that macro the header can be
out
> of sync. This is what is currently being done in blink, skia and nacl.
>
> If v8 wants to add new macros they should be added into the chrome version
> first, as mentioned in the .h file.
Yang, ping.
dsinclair
On 2015/08/31 20:27:43, fmeawad wrote: > > Yang, ping. From the display name, it looks ...
5 years, 3 months ago
(2015-09-04 13:26:14 UTC)
#35
On 2015/08/31 20:27:43, fmeawad wrote:
>
> Yang, ping.
From the display name, it looks like Yang is OOO until mid-October. We'd like to
get this landed a bit sooner then that, so is there someone else from the v8
team who can take a look?
jochen (gone - plz use gerrit)
i'm back & looking. it would be nice if we could move those files to ...
5 years, 3 months ago
(2015-09-07 14:24:13 UTC)
#36
i'm back & looking.
it would be nice if we could move those files to a separate directory in chrome,
so other projects like v8 can pull it in via DEPS (we can export individual
directories from chrome as separate git repositories).
I agree that manually syncing a large file across multiple repos isn't a good
thing[tm]
was moving this file to e.g. base/tracing/exported/ or similar possible?
dsinclair
On 2015/09/07 14:24:13, jochen wrote: > i'm back & looking. > > it would be ...
5 years, 3 months ago
(2015-09-08 13:55:34 UTC)
#37
On 2015/09/07 14:24:13, jochen wrote:
> i'm back & looking.
>
> it would be nice if we could move those files to a separate directory in
chrome,
> so other projects like v8 can pull it in via DEPS (we can export individual
> directories from chrome as separate git repositories).
>
> I agree that manually syncing a large file across multiple repos isn't a good
> thing[tm]
>
> was moving this file to e.g. base/tracing/exported/ or similar possible?
We agree that the copying isn't a good solution, but it's a larger fix to change
to having a sync'd directory. This file is actually the first step in getting us
to a better place as this file requires no modification by the copiers. Prior to
having this we'd have to modify the header for each client to work with their
infrastructure.
So, we'd like to get there, we aren't there yet and we don't have the resources
to get us there in the short term. We'd like to get v8 tracing working in the
short term if at all possible.
jochen (gone - plz use gerrit)
not sure why this would be a larger fix? it would require moving the files ...
5 years, 3 months ago
(2015-09-08 14:20:34 UTC)
#38
not sure why this would be a larger fix? it would require moving the files in
chromium (large CL but automated), filing an infra ticket, and replacing the
files in the CLs with a DEPS entry.
some comments inline.
what's the plan with all the new trace macros? will they supersede the LOG()
macros currently used in v8? if yes, who's going to do that?
https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h
File include/v8-tracing.h (right):
https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h#ne...
include/v8-tracing.h:49: virtual EventTracer::Handle AddTraceEvent(
agreed.
Either it should be part of the platform, or passed via the
Isolate::CreateParams.
we shouldn't have a global static event tracer, but it should be scoped to an
isolate (eventually, the v8::Platform will also be passed to Isolate::New)
https://codereview.chromium.org/988893003/diff/260001/src/tracing/trace-event.h
File src/tracing/trace-event.h (right):
https://codereview.chromium.org/988893003/diff/260001/src/tracing/trace-event...
src/tracing/trace-event.h:238: (uint64_t) v8::internal::Isolate::UnsafeCurrent
don't use this method.
Isolate* should be always passed around explicitly, you can't rely on getting
the Isolate via any of the *Current() methods
On 2015/09/08 at 17:57:49, caseq wrote: > https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h > File include/v8-tracing.h (right): > > https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h#newcode49 ...
5 years, 3 months ago
(2015-09-08 20:16:08 UTC)
#40
On 2015/09/08 at 17:57:49, caseq wrote:
> https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h
> File include/v8-tracing.h (right):
>
>
https://codereview.chromium.org/988893003/diff/260001/include/v8-tracing.h#ne...
> include/v8-tracing.h:49: virtual EventTracer::Handle AddTraceEvent(
> On 2015/09/08 14:20:34, jochen wrote:
> > we shouldn't have a global static event tracer, but it should be scoped to
an
> > isolate (eventually, the v8::Platform will also be passed to Isolate::New)
>
> Current trace macros implementation relies on static variables for caching
pointers to category enable flags (see
https://code.google.com/p/chromium/codesearch#chromium/src/base/trace_event/t...)
-- so I'm afraid that allowing setting tracers per isolate may create a false
impression that one could use different tracer implementation for different
isolates, while we actually rely on tracer being a singleton.
I'm not saying that chromium's tracing shouldn't use static variables, but v8
should definitely not add new ones.
Description was changed from ========== Implement tracing interface for v8 This is based on the ...
5 years, 1 month ago
(2015-11-19 01:17:13 UTC)
#44
Description was changed from
==========
Implement tracing interface for v8
This is based on the Skia Implementation.
More on the project can be found here:
https://docs.google.com/a/chromium.org/document/d/1_4LAnInOB8tM_DLjptWiszRwa4...
The V8 Tracing platform will replace the isolate->event_logger().
But since the current embedders (namely chromium) currently use the
isolate->event_logger, I made the default implementation (event-tracer) call
into isolate->event_logger if an event_logger was set.
Once the embedders properly implement the interface (for example in chromium it
would look like this: https://codereview.chromium.org/707273005/), the default
implementation will be doing nothing.
Once the embedders side is fixed, we will change how V8 uses the tracing
framework beyond the call from Logger:CallEventLogger. (which would also include
a d8 implementation)
BUG=446513
LOG=N
==========
to
==========
Implement tracing interface for v8
This is based on the Skia Implementation.
More on the project can be found here:
https://docs.google.com/a/chromium.org/document/d/1_4LAnInOB8tM_DLjptWiszRwa4...
The V8 Tracing platform will replace the isolate->event_logger().
But since the current embedders (namely chromium) currently use the
isolate->event_logger, I made the default implementation (event-tracer) call
into isolate->event_logger if an event_logger was set.
Once the embedders properly implement the interface (for example in chromium it
would look like this: https://codereview.chromium.org/707273005/), the default
implementation will be doing nothing.
Once the embedders side is fixed, we will change how V8 uses the tracing
framework beyond the call from Logger:CallEventLogger. (which would also include
a d8 implementation)
BUG=4558
LOG=N
==========
fmeawad
Description was changed from ========== Implement tracing interface for v8 This is based on the ...
5 years, 1 month ago
(2015-11-19 01:24:50 UTC)
#45
Description was changed from
==========
Implement tracing interface for v8
This is based on the Skia Implementation.
More on the project can be found here:
https://docs.google.com/a/chromium.org/document/d/1_4LAnInOB8tM_DLjptWiszRwa4...
The V8 Tracing platform will replace the isolate->event_logger().
But since the current embedders (namely chromium) currently use the
isolate->event_logger, I made the default implementation (event-tracer) call
into isolate->event_logger if an event_logger was set.
Once the embedders properly implement the interface (for example in chromium it
would look like this: https://codereview.chromium.org/707273005/), the default
implementation will be doing nothing.
Once the embedders side is fixed, we will change how V8 uses the tracing
framework beyond the call from Logger:CallEventLogger. (which would also include
a d8 implementation)
BUG=4558
LOG=N
==========
to
==========
Implement tracing interface for v8
This is based on the Skia Implementation.
More on the project can be found here:
https://docs.google.com/a/chromium.org/document/d/1_4LAnInOB8tM_DLjptWiszRwa4...
The V8 Tracing platform will replace the isolate->event_logger().
But since the current embedders (namely chromium) currently use the
isolate->event_logger, I made the default implementation (event-tracer) call
into isolate->event_logger if an event_logger was set.
Once the embedders properly implement the interface (for example in chromium it
would look like this: https://codereview.chromium.org/707273005/), the default
implementation will be doing nothing.
Once the embedders side is fixed, we will change how V8 uses the tracing
framework beyond the call from Logger:CallEventLogger. (which would also include
a d8 implementation)
BUG=4560
LOG=N
==========
fmeawad
Description was changed from ========== Implement tracing interface for v8 This is based on the ...
5 years, 1 month ago
(2015-11-19 01:25:58 UTC)
#46
Description was changed from
==========
Implement tracing interface for v8
This is based on the Skia Implementation.
More on the project can be found here:
https://docs.google.com/a/chromium.org/document/d/1_4LAnInOB8tM_DLjptWiszRwa4...
The V8 Tracing platform will replace the isolate->event_logger().
But since the current embedders (namely chromium) currently use the
isolate->event_logger, I made the default implementation (event-tracer) call
into isolate->event_logger if an event_logger was set.
Once the embedders properly implement the interface (for example in chromium it
would look like this: https://codereview.chromium.org/707273005/), the default
implementation will be doing nothing.
Once the embedders side is fixed, we will change how V8 uses the tracing
framework beyond the call from Logger:CallEventLogger. (which would also include
a d8 implementation)
BUG=4560
LOG=N
==========
to
==========
Implement tracing interface for v8
This is based on the Skia Implementation.
More on the project can be found here:
https://docs.google.com/a/chromium.org/document/d/1_4LAnInOB8tM_DLjptWiszRwa4...
The V8 Tracing platform will replace the isolate->event_logger().
But since the current embedders (namely chromium) currently use the
isolate->event_logger, I made the default implementation (event-tracer) call
into isolate->event_logger if an event_logger was set.
Once the embedders properly implement the interface (for example in chromium it
would look like this: https://codereview.chromium.org/707273005/), the default
implementation will be doing nothing.
Once the embedders side is fixed, we will change how V8 uses the tracing
framework beyond the call from Logger:CallEventLogger. (which would also include
a d8 implementation)
BUG=v8:4560
LOG=N
==========
fmeawad
I have addressed all comments, Major changes include: 1- removing trace-event-common.h and put it in ...
5 years, 1 month ago
(2015-11-19 02:00:47 UTC)
#47
> I think I'm missing a test case where we can distinguish trace events by ...
5 years, 1 month ago
(2015-11-20 22:22:09 UTC)
#49
> I think I'm missing a test case where we can distinguish trace events by
isolate (using the isolate as id?).
I forgot to mention, that part of the major changes in the last patch is to get
rid of context_id in favor of the much more general and ExecutionContext system
we are adding to tracing.
I filed https://code.google.com/p/v8/issues/detail?id=4565 to track landing
ExecutionContext in v8, and blocked replacing LOG on that one.
fmeawad
https://codereview.chromium.org/988893003/diff/320001/include/v8-platform.h File include/v8-platform.h (right): https://codereview.chromium.org/988893003/diff/320001/include/v8-platform.h#newcode125 include/v8-platform.h:125: * Add a trace event to the platform tracing ...
5 years, 1 month ago
(2015-11-20 22:22:20 UTC)
#50
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/988893003/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/988893003/340001
5 years, 1 month ago
(2015-11-20 22:26:06 UTC)
#52
Dry run: Try jobs failed on following builders: v8_linux_nodcheck_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_nodcheck_rel/builds/8924)
5 years, 1 month ago
(2015-11-20 22:28:36 UTC)
#54
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/988893003/360001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/988893003/360001
5 years, 1 month ago
(2015-11-20 23:02:40 UTC)
#56
Dry run: Try jobs failed on following builders: v8_linux_chromium_gn_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_chromium_gn_rel/builds/10332)
5 years, 1 month ago
(2015-11-20 23:12:19 UTC)
#58
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/988893003/380001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/988893003/380001
Dry run: Try jobs failed on following builders: v8_linux_chromium_gn_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_chromium_gn_rel/builds/10458)
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/988893003/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/988893003/400001
Try jobs failed on following builders: v8_linux_chromium_gn_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_chromium_gn_rel/builds/10544)
https://codereview.chromium.org/988893003/diff/420001/DEPS File DEPS (right): https://codereview.chromium.org/988893003/diff/420001/DEPS#newcode16 DEPS:16: "v8/src/tracing/common": I think this line should be v8/base/trace_event/common
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/988893003/460001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/988893003/460001
Dry run: Try jobs failed on following builders: v8_linux_chromium_gn_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_chromium_gn_rel/builds/11507)
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/988893003/480001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/988893003/480001
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/988893003/480001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/988893003/480001
Description was changed from
==========
Implement tracing interface for v8
This is based on the Skia Implementation.
More on the project can be found here:
https://docs.google.com/a/chromium.org/document/d/1_4LAnInOB8tM_DLjptWiszRwa4...
The V8 Tracing platform will replace the isolate->event_logger().
But since the current embedders (namely chromium) currently use the
isolate->event_logger, I made the default implementation (event-tracer) call
into isolate->event_logger if an event_logger was set.
Once the embedders properly implement the interface (for example in chromium it
would look like this: https://codereview.chromium.org/707273005/), the default
implementation will be doing nothing.
Once the embedders side is fixed, we will change how V8 uses the tracing
framework beyond the call from Logger:CallEventLogger. (which would also include
a d8 implementation)
BUG=v8:4560
LOG=N
==========
to
==========
Implement tracing interface for v8
This is based on the Skia Implementation.
More on the project can be found here:
https://docs.google.com/a/chromium.org/document/d/1_4LAnInOB8tM_DLjptWiszRwa4...
The V8 Tracing platform will replace the isolate->event_logger().
But since the current embedders (namely chromium) currently use the
isolate->event_logger, I made the default implementation (event-tracer) call
into isolate->event_logger if an event_logger was set.
Once the embedders properly implement the interface (for example in chromium it
would look like this: https://codereview.chromium.org/707273005/), the default
implementation will be doing nothing.
Once the embedders side is fixed, we will change how V8 uses the tracing
framework beyond the call from Logger:CallEventLogger. (which would also include
a d8 implementation)
BUG=v8:4560
LOG=N
Committed: https://crrev.com/70a7c754bf3445a8b783b75ca2a7aa34cdeb080b
Cr-Commit-Position: refs/heads/master@{#32959}
==========
commit-bot: I haz the power
Patchset 25 (id:??) landed as https://crrev.com/70a7c754bf3445a8b783b75ca2a7aa34cdeb080b Cr-Commit-Position: refs/heads/master@{#32959}
On 2015/12/17 at 21:30:35, Dan Ehrenberg wrote:
> On 2015/12/17 at 18:48:42, commit-bot wrote:
> > Patchset 25 (id:??) landed as
https://crrev.com/70a7c754bf3445a8b783b75ca2a7aa34cdeb080b
> > Cr-Commit-Position: refs/heads/master@{#32959}
>
> This breaks my interactive builds of V8.
Oh sorry, this was from a missing 'gclient sync'.
Issue 988893003: Implement tracing interface for v8
(Closed)
Created 5 years, 9 months ago by fmeawad
Modified 5 years ago
Reviewers: jochen (gone - plz use gerrit), caseq, dsinclair, noordhuis, rmcilroy, Sven Panne, Yang, yurys
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Comments: 54