Open
Bug 1505589
Opened 6 years ago
Updated 2 years ago
Make Profiler Counters usable within the JavaScript Engine
Categories
(Core :: JavaScript Engine, enhancement, P2)
Core
JavaScript Engine
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox65 | --- | affected |
People
(Reporter: mgaudet, Unassigned)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file, 1 obsolete file)
36.16 KB,
patch
|
Details | Diff | Splinter Review |
Bug 1464509 added some really interesting support for capturing counter values into profiles. There's a lot of really interesting use cases I can imagine for this.
However, interaction with the profiler from within SpiderMonkey requires some facade to be built, in order to support embeddings that are not Gecko (see js/src/vm/GeckoProfiler.h)
It appears in the discussion for Bug 1464509 this was discussed, but I don't think the work was completed.
Comment 1•6 years ago
|
||
WIP patch; compiles clean
Updated•6 years ago
|
Assignee: nobody → rjesup
Status: NEW → ASSIGNED
Comment 2•6 years ago
|
||
Comment on attachment 9034480 [details] [diff] [review]
Make profiler counters usable from js/* source
Review of attachment 9034480 [details] [diff] [review]:
-----------------------------------------------------------------
I had a bit of a sticky-beak at these changes. Hope you don't mind the early feedback.
Thanks for doing this!
::: js/src/vm/GeckoProfiler.h
@@ +132,5 @@
> + /* functions to support Profiler counters */
> + void setCounters(profiler_sampled_counter_t add,
> + profiler_sampled_counter_t remove);
> + void addCounter(BaseProfilerCount* aCounter) {
> + (*addCounterPtr)(aCounter);
What if addCounterPtr is null. Maybe we should silently not add/remove counters if the profiler has provided nullptr for these functions or maybe there are other reasons it hasn't set them?
::: mfbt/ProfilerCounts.h
@@ +161,5 @@
> +
> + void Add(int64_t aNumber) { mCounter += aNumber; }
> +
> + ProfilerAtomicSigned mCounter;
> +};
Can I have a function to reset the counter, not to zero but to a value I calculate?
I hope to count allocations (in bytes) and then reset it to the currently used amount of memory after a GC finishes.
I can add this later if you'd prefer. It's also not an immediate priority, we don't have a use case for such accurate information yet.
I'd also like something I can increment from JIT-compiled code. But that's just a way to take the address of the atomic int64 - really simple. Just FYI in case the internals of this change in the future.
Updated•6 years ago
|
Priority: -- → P2
Comment 3•6 years ago
|
||
incorporated pbone's comments. Added counter->Reset(value)
Updated•6 years ago
|
Attachment #9034480 -
Attachment is obsolete: true
Comment 4•3 years ago
|
||
Forwarding to Gerald
Assignee: rjesup → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(gsquelart)
I won't have time for this, sorry.
Flags: needinfo?(mozbugz)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•