Bug 103247 - Web Inspector: Console: profile/profileEnd output looks sloppy.
Summary: Web Inspector: Console: profile/profileEnd output looks sloppy.
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Eugene Klyuchnikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-26 05:46 PST by Eugene Klyuchnikov
Modified: 2013-02-21 03:54 PST (History)
10 users (show)

See Also:


Attachments
Patch (1.70 KB, patch)
2012-11-27 18:27 PST, Eugene Klyuchnikov
no flags Details | Formatted Diff | Diff
Patch (3.82 KB, patch)
2013-01-22 05:33 PST, Eugene Klyuchnikov
no flags Details | Formatted Diff | Diff
Patch (4.47 KB, patch)
2013-01-31 02:10 PST, Eugene Klyuchnikov
no flags Details | Formatted Diff | Diff
Patch (4.48 KB, patch)
2013-02-04 03:52 PST, Eugene Klyuchnikov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Klyuchnikov 2012-11-26 05:46:50 PST
Run in console:

 for (var i = 0; i < 3; ++i) {console.profile("Text"); console.profileEnd();}

Result:

 Profile "Text" started.
 Profile "Text" finished.
 Profile "Text Run 2" started.
 Profile "Text Run 2.5" finished.
 Profile "Text Run 3" started.
 Profile "Text Run 3.5" finished.

What does ".5" mean?
Comment 1 Eugene Klyuchnikov 2012-11-27 18:27:29 PST
Created attachment 176381 [details]
Patch
Comment 2 WebKit Review Bot 2012-11-27 20:23:04 PST
Comment on attachment 176381 [details]
Patch

Attachment 176381 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15010370

New failing tests:
inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html
Comment 3 Pavel Feldman 2012-11-28 14:01:21 PST
Comment on attachment 176381 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=176381&action=review

> Source/WebCore/inspector/front-end/ProfilesPanel.js:753
> +            if (groupNumber > 2) {

We should find out why it is incremented twice instead.
Comment 4 Eugene Klyuchnikov 2012-11-28 15:42:44 PST
Comment on attachment 176381 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=176381&action=review

>> Source/WebCore/inspector/front-end/ProfilesPanel.js:753
>> +            if (groupNumber > 2) {
> 
> We should find out why it is incremented twice instead.

This is because both console.profile/profileEnd would like to linkify profile.
There is no way to distinguish profiles - we have only profile title and profile type here.
We couldn't use profile id - it is 0 when we start writing profile.
Comment 5 Eugene Klyuchnikov 2012-11-28 15:53:30 PST
(In reply to comment #3)
> (From update of attachment 176381 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176381&action=review
> 
> > Source/WebCore/inspector/front-end/ProfilesPanel.js:753
> > +            if (groupNumber > 2) {
> 
> We should find out why it is incremented twice instead.

We can fix this by making InspectorProfilerAgent::getCurrentUserInitiatedProfileName parametrized with title (and removing this code at all)
Comment 6 Eugene Klyuchnikov 2013-01-22 05:33:11 PST
Created attachment 183970 [details]
Patch
Comment 7 Yury Semikhatsky 2013-01-22 08:21:05 PST
Comment on attachment 183970 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=183970&action=review

> Source/WebCore/inspector/front-end/ProfilesPanel.js:758
> +                var groupNumber = ++this._profileGroupsForLinks[titleKey];

What if this method gets called more than twice to e.g. linkify the same profile in different places in the front-end?
Comment 8 Eugene Klyuchnikov 2013-01-31 02:08:40 PST
(In reply to comment #7)
> (From update of attachment 183970 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=183970&action=review
> 
> > Source/WebCore/inspector/front-end/ProfilesPanel.js:758
> > +                var groupNumber = ++this._profileGroupsForLinks[titleKey];
> 
> What if this method gets called more than twice to e.g. linkify the same profile in different places in the front-end?

Fixed.
The drawback of new solution is: when profiles are not populated yet, then run number can't be calculated.
Comment 9 Eugene Klyuchnikov 2013-01-31 02:10:07 PST
Created attachment 185721 [details]
Patch
Comment 10 Vsevolod Vlasov 2013-01-31 12:11:37 PST
While you are at it, would you mind having a look on the following problem: I did console.profile today and the link to the profile was opening a new page in the browser, not showing the collected profile in the corresponding panel. I believe it was easily reproducible.
Comment 11 Eugene Klyuchnikov 2013-01-31 20:32:39 PST
(In reply to comment #10)
> While you are at it, would you mind having a look on the following problem: I did console.profile today and the link to the profile was opening a new page in the browser, not showing the collected profile in the corresponding panel. I believe it was easily reproducible.

I know about this problem ad will take care on it.
Comment 12 Eugene Klyuchnikov 2013-02-04 03:52:21 PST
Created attachment 186340 [details]
Patch
Comment 13 Eugene Klyuchnikov 2013-02-21 03:54:38 PST
Becomes obsolete, because of:
https://bugs.webkit.org/show_bug.cgi?id=109790