Last Comment Bug 401697 - Adding custom load URL probes to Mozilla
: Adding custom load URL probes to Mozilla
Status: NEW
:
Product: Core
Classification: Components
Component: General (show other bugs)
: unspecified
: All SunOS
: -- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
: 410588 (view as bug list)
Depends on: dtrace
Blocks:
  Show dependency treegraph
 
Reported: 2007-10-30 07:03 PDT by Alfred Peng
Modified: 2009-11-08 15:39 PST (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (28.71 KB, patch)
2007-10-30 07:12 PDT, Alfred Peng
no flags Details | Diff | Splinter Review
patch v2 (31.98 KB, patch)
2008-01-15 02:27 PST, Alfred Peng
no flags Details | Diff | Splinter Review
DTrace script for the load probes (7.23 KB, text/x-dsrc)
2008-02-15 03:54 PST, Alfred Peng
no flags Details
patch v3 (28.94 KB, patch)
2008-06-16 08:44 PDT, John Rice
no flags Details | Diff | Splinter Review
patch v4 (35.01 KB, patch)
2008-06-16 13:35 PDT, John Rice
no flags Details | Diff | Splinter Review

Description Alfred Peng 2007-10-30 07:03:16 PDT
Please refer to: https://bugzilla.mozilla.org/show_bug.cgi?id=370906#c55. File a separate bug for this.

One of the main purposes for these probes is to process the page load into several different phases. And some more precise data could be provided for the Firefox page load.
Comment 1 Alfred Peng 2007-10-30 07:12:24 PDT
Created attachment 286677 [details] [diff] [review]
Patch v1

This patch is based on John's last patch on bug 370906.

I made some small changes to the framework which fix some build problems after applying the old patch. jst, could you help take a look?
Comment 2 Alfred Peng 2008-01-02 20:16:38 PST
The patch seems to be broken again. Got to update it.
Comment 3 Stan Shebs 2008-01-12 15:51:14 PST
*** Bug 410588 has been marked as a duplicate of this bug. ***
Comment 4 Alfred Peng 2008-01-15 02:27:22 PST
Created attachment 297142 [details] [diff] [review]
patch v2

The dtrace script http://blogs.sun.com/jmr/resource/browserspy_time_all.d also needs to be updated.
Comment 5 Alfred Peng 2008-02-15 03:54:37 PST
Created attachment 303513 [details]
DTrace script for the load probes

Update the script based on John Rice's previous one.

All the URI related information is passed to DTrace by 32bit pointers in Firefox. However, on my AMD64 box, DTrace takes "char *" as 64bit. So I change the "char *" to uint32_t to go around this.

The output on my box is:

%./browserspy_time_all32.d 
Tracing Browser Network Activity... Hit Ctrl-C to end.
^C

PROBE STATS:

TYPE        TOTAL                                     COUNT
DNS_REQ     Network Requests - Done                       1
DNS_REQ     Network Requests - Started                    1
DNS_LOAD    Lookups - Network and Cache                   9

TYPE        TOTAL                                     COUNT
URI         Network Requests - Done                      23
URI         Network Requests - Started                   24
IMAGE_REQ   Network Requests - Done                     134
IMAGE_REQ   Network Requests - Started                  134
IMAGE_LOAD  Image Loads - Network and Cache             290

Browser DNS lookup requests,

     PID      UID     STATUS    COUNT   AVG(msec)   SUM(msec)                IP HOST                                
   24391   221197          1        1           4           4    129.146.11.110 webcache.sfbay.sun.com              

URI structure:
<scheme>://<username>:<password>@<host>:<port>//<directory><basename>.<extension>;<param>?<query>#<ref>

Browser requests by scheme,

     PID      UID       TYPE    COUNT   AVG(msec)   SUM(msec)   SCHEME                              
   24391   221197  IMAGE_REQ        1           0           0   moz-anno                            
   24391   221197  IMAGE_REQ        2           0           1   file                                
   24391   221197  IMAGE_REQ        9           0           5   moz-icon                            
   24372   221197  IMAGE_REQ        3          13          40   moz-icon                            
   24391   221197  IMAGE_REQ       24           2          56   jar                                 
   24391   221197  IMAGE_REQ        1          67          67   data                                
   24372   221197        URI        1          96          96   chrome                              
   24391   221197  IMAGE_REQ       89           5         523   http                                
   24391   221197  IMAGE_REQ        5         151         759   https                               
   24391   221197        URI        1         877         877   resource                            
   24391   221197        URI        1        1817        1817   chrome                              
   24391   221197        URI       13         150        1959   about                               
   24391   221197        URI        7        2758       19312   http                                

Browser requests by content type,

     PID      UID       TYPE    COUNT   AVG(msec)   SUM(msec)   CONTENT_TYPE                        
   24391   221197  IMAGE_REQ        1           0           0   image/unknown                       
   24391   221197  IMAGE_REQ        1           0           0   image/ico                           
   24391   221197  IMAGE_REQ        3           0           2   image/x-icon                        
   24391   221197  IMAGE_REQ        9           0           5   image/icon                          
   24372   221197  IMAGE_REQ        3          13          40   image/icon                          
   24391   221197  IMAGE_REQ       10           6          65   image/jpeg                          
   24372   221197        URI        1          96          96   mozilla.application/cached-xul      
   24391   221197  IMAGE_REQ       69           6         453   image/png                           
   24391   221197  IMAGE_REQ       38          23         886   image/gif                           
   24391   221197        URI        1        1622        1622   text/plain                          
   24391   221197        URI        1        1817        1817   mozilla.application/cached-xul      
   24391   221197        URI       20        1026       20527   text/html                           

Browser requests by file extension,

     PID      UID       TYPE    COUNT   AVG(msec)   SUM(msec)   FILE_EXT                            
   24391   221197  IMAGE_REQ        4           0           3   ico                                 
   24391   221197  IMAGE_REQ        1          10          10   PNG                                 
   24372   221197  IMAGE_REQ        3          13          40   <null>                              
   24391   221197  IMAGE_REQ       10           6          65   jpg                                 
   24372   221197        URI        1          96          96   xul                                 
   24391   221197  IMAGE_REQ       32           4         128   png                                 
   24391   221197  IMAGE_REQ       57           6         394   <null>                              
   24391   221197  IMAGE_REQ       27          30         811   gif                                 
   24391   221197        URI        1        1622        1622   txt                                 
   24391   221197        URI        2         838        1676   html                                
   24391   221197        URI        1        1817        1817   xul                                 
   24391   221197        URI       18        1047       18850   <null>                              

Browser requests by host,

     PID      UID       TYPE    COUNT   AVG(msec)   SUM(msec)   HOST                                
   24391   221197  IMAGE_REQ        1           0           0   www.google-analytics.com            
   24391   221197  IMAGE_REQ       11           0           7   feeds.feedburner.com                
   24391   221197  IMAGE_REQ        2           3           7   www.brendangregg.com                
   24391   221197  IMAGE_REQ        3           2           8   img.youtube.com                     
   24391   221197  IMAGE_REQ        4           2          11   bp3.blogger.com                     
   24391   221197  IMAGE_REQ        2           6          13   www.mozilla.org                     
   24391   221197  IMAGE_REQ        3           6          18   bp2.blogger.com                     
   24391   221197  IMAGE_REQ        9           2          19   code.google.com                     
   24391   221197  IMAGE_REQ        4           6          24   bp1.blogger.com                     
   24391   221197  IMAGE_REQ        4           7          31   bp0.blogger.com                     
   24391   221197  IMAGE_REQ        4           9          39   maps.google.com                     
   24372   221197  IMAGE_REQ        3          13          40   <null>                              
   24391   221197  IMAGE_REQ        9           4          40   www.google.com                      
   24391   221197  IMAGE_REQ        8           9          72   mt0.google.com                      
   24391   221197  IMAGE_REQ        9           8          78   mt3.google.com                      
   24391   221197  IMAGE_REQ        9           8          80   mt2.google.com                      
   24391   221197  IMAGE_REQ        9           9          82   mt1.google.com                      
   24372   221197        URI        1          96          96   global                              
   24391   221197  IMAGE_REQ       37           3         132   <null>                              
   24391   221197  IMAGE_REQ        3         248         745   bugzilla.mozilla.org                
   24391   221197        URI        1         877         877   gre                                 
   24391   221197        URI        1        1817        1817   browser                             
   24391   221197        URI       13         150        1959   <null>                              
   24391   221197        URI        2         988        1977   www.google.com                      
   24391   221197        URI        2        1732        3464   www.brendangregg.com                
   24391   221197        URI        2        2059        4119   maps.google.com                     
   24391   221197        URI        1        9751        9751   code.google.com
Comment 6 Alfred Peng 2008-02-20 06:13:27 PST
Comment on attachment 297142 [details] [diff] [review]
patch v2

The patch now contains the probes for
LoadURI       LoadImage
   |            |
    ------------
         |
      Network --> DNS Request
Anyone could point us to the places to add the following probes?
      Parser
         |
      Content DOM
         |
      Layout
         | 
      Painting
Comment 7 John Rice 2008-06-16 08:44:41 PDT
Created attachment 325265 [details] [diff] [review]
patch v3

Update to build against head. 

A full build stopped because mozjs-dtrace.o had not been built. Just going in and doing it manually allowed the build to continue. The patch is not in the js area.
cd /export/home/user/work/mozilla/js/src
gmake mozjs-dtrace.o
Comment 8 John Rice 2008-06-16 13:35:15 PDT
Created attachment 325308 [details] [diff] [review]
patch v4

Had omitted probes/mozilla-trace-probes.h.in from last patch in error and applied change in config/rules.mk from patch v2.
Comment 9 Mark Porter 2009-11-08 15:39:59 PST
Seems like this has patch has died on the vine ... any chance of revival? Would be incredibly useful for tuning applications.

Note You need to log in before you can comment on or make changes to this bug.