Changeset 33470 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
May 14, 2008, 6:09:28 PM (17 years ago)
Author:
[email protected]
Message:

2008-05-14 Kevin McCullough <[email protected]>

Reviewed by Geoff and Sam.

<rdar://problem/5770054> JavaScript profiler (10928)
Add the ability to get percentages of total and self time for displaying
in the WebInspector.

  • profiler/Profile.h: (KJS::Profile::totalProfileTime):
  • profiler/ProfileNode.cpp: (KJS::ProfileNode::totalPercent): (KJS::ProfileNode::selfPercent):
  • profiler/ProfileNode.h:
  • profiler/Profiler.h: (KJS::Profiler::currentProfile):
Location:
trunk/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r33466 r33470  
     12008-05-14  Kevin McCullough  <[email protected]>
     2
     3        Reviewed by Geoff.
     4
     5        <rdar://problem/5770054> JavaScript profiler (10928)
     6        Add the ability to get percentages of total and self time for displaying
     7        in the WebInspector.
     8
     9        * profiler/Profile.h:
     10        (KJS::Profile::totalProfileTime):
     11        * profiler/ProfileNode.cpp:
     12        (KJS::ProfileNode::totalPercent):
     13        (KJS::ProfileNode::selfPercent):
     14        * profiler/ProfileNode.h:
     15        * profiler/Profiler.h:
     16        (KJS::Profiler::currentProfile):
     17
    1182008-05-14  Kevin McCullough  <[email protected]>
    219
  • trunk/JavaScriptCore/profiler/Profile.h

    r33466 r33470  
    4848        ProfileNode* callTree() const { return m_callTree.get(); };
    4949
     50        double totalTime() const { return m_callTree->totalTime(); }
     51
    5052        void printDataInspectorStyle() const;
    5153        void printDataSampleStyle() const;
  • trunk/JavaScriptCore/profiler/ProfileNode.cpp

    r33466 r33470  
    111111}
    112112
     113double ProfileNode::totalPercent() const
     114{
     115    return (m_timeSum / Profiler::profiler()->currentProfile()->totalTime()) * 100.0;
     116}
     117
     118double ProfileNode::selfPercent() const
     119{
     120    return (selfTime() / Profiler::profiler()->currentProfile()->totalTime()) * 100.0;
     121}
     122
    113123void ProfileNode::printDataInspectorStyle(int indentLevel) const
    114124{
  • trunk/JavaScriptCore/profiler/ProfileNode.h

    r33466 r33470  
    5858        double totalTime() const { return m_timeSum; }
    5959        double selfTime() const;
     60        double totalPercent() const;
     61        double selfPercent() const;
    6062        unsigned numberOfCalls() const { return m_numberOfCalls; }
    6163        const Deque<RefPtr<ProfileNode> >& children() { return m_children; }
  • trunk/JavaScriptCore/profiler/Profiler.h

    r33382 r33470  
    5555        void clearProfiles() { if (!m_profiling) m_allProfiles.clear(); };
    5656
     57        Profile* currentProfile() const { return m_currentProfile.get(); }
     58
    5759        void printDataInspectorStyle(unsigned whichProfile) const;
    5860        void printDataSampleStyle(unsigned whichProfile) const;
Note: See TracChangeset for help on using the changeset viewer.