Ignore:
Timestamp:
May 22, 2008, 6:03:17 PM (17 years ago)
Author:
[email protected]
Message:

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

Reviewed by Darin.

<rdar://problem/5951529> JSProfiler: Allow the profiler to "Exclude" a
profile node.
-Implement 'exclude'; where the excluded node attributes its time to its
parent's self time.

  • JavaScriptCore.exp: Export the exclude function.
  • profiler/Profile.h: (KJS::Profile::exclude):
  • profiler/ProfileNode.cpp: (KJS::ProfileNode::setTreeVisible): New function that allows a change in visiblitiy to be propogated to all the children of a node. (KJS::ProfileNode::exclude): If the node matches the callIdentifier then set the visiblity of this node and all of its children to false and attribute it's total time to it's caller's self time.
  • profiler/ProfileNode.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/profiler/ProfileNode.cpp

    r34036 r34043  
    239239}
    240240
     241void ProfileNode::setTreeVisible(bool visible)
     242{
     243    m_visible = visible;
     244
     245    for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild)
     246        (*currentChild)->setTreeVisible(visible);
     247}
     248
    241249void ProfileNode::focus(const CallIdentifier& callIdentifier, bool forceVisible)
    242250{
     
    261269}
    262270
     271double ProfileNode::exclude(const CallIdentifier& callIdentifier)
     272{
     273    if (m_callIdentifier == callIdentifier) {
     274        m_visible = false;
     275
     276        for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild)
     277            (*currentChild)->setTreeVisible(false);
     278
     279        return m_visibleTotalTime;
     280    }
     281
     282    for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild)
     283        m_visibleSelfTime += (*currentChild)->exclude(callIdentifier);
     284
     285    return 0;
     286}
     287
    263288void ProfileNode::restoreAll()
    264289{
Note: See TracChangeset for help on using the changeset viewer.