Repository navigation
Commit b6c9842
committed
SamplingProfiler::StackTrace's move constructor drops stopwatchTimestamp
rdar://190749432
https://bugs.webkit.org/show_bug.cgi?id=328525
Reviewed by Devin Rousso.
267527@main added SamplingProfiler::StackTrace::stopwatchTimestamp,
which InspectorScriptProfilerAgent sends to Web Inspector as the
timestamp of each sample. StackTrace's hand-written move constructor
does not copy it, so every time m_stackTraces grows and WTF::Vector
moves the existing elements, those samples lose their timestamp and
reach Web Inspector with a value of 0. As a result, the JavaScript call
trees in the Timelines tab only count samples inside the selected time
range, so they leave those samples out.
The move constructor has no custom logic, so default it. It stays
declared so that StackTrace stays move-only.
Web Inspector's existing ScriptProfiler tests did not catch this because
they never enable the Page domain, which is what starts a page's
execution stopwatch. With the stopwatch stopped, every timestamp is 0,
whether it was copied or not. The new test enables the Page domain and
checks that every sample falls between trackingStart and
trackingComplete.
Test: inspector/script-profiler/sample-timestamps.html
* LayoutTests/inspector/script-profiler/sample-timestamps-expected.txt: Added.
* LayoutTests/inspector/script-profiler/sample-timestamps.html: Added.
* Source/JavaScriptCore/runtime/SamplingProfiler.h:
Canonical link: https://commits.webkit.org/324491@main1 parent 5886192 commit b6c9842
3 files changed
Lines changed: 90 additions & 4 deletions
File tree
- LayoutTests/inspector/script-profiler
- Source/JavaScriptCore/runtime
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 178 | + | |
182 | 179 | | |
183 | 180 | | |
184 | 181 | | |
| |||
0 commit comments