Methods Summary |
---|
public void | addElapsedExclusive(long time)
mElapsedExclusive += time;
|
public void | addElapsedInclusive(long time, boolean isRecursive, Call parent)
if (isRecursive == false) {
mElapsedInclusive += time;
mNumCalls[0] += 1;
} else {
mNumCalls[1] += 1;
}
if (parent == null)
return;
// Find the child method in the parent
MethodData parentMethod = parent.mMethodData;
if (parent.isRecursive()) {
parentMethod.mRecursiveChildren = updateInclusive(time,
parentMethod, this, false,
parentMethod.mRecursiveChildren);
} else {
parentMethod.mChildren = updateInclusive(time,
parentMethod, this, false, parentMethod.mChildren);
}
// Find the parent method in the child
if (isRecursive) {
mRecursiveParents = updateInclusive(time, this, parentMethod, true,
mRecursiveParents);
} else {
mParents = updateInclusive(time, this, parentMethod, true,
mParents);
}
|
private ProfileData[] | addSelf(ProfileData[] children)
ProfileData[] pdata;
if (children == null) {
pdata = new ProfileData[1];
} else {
pdata = new ProfileData[children.length + 1];
System.arraycopy(children, 0, pdata, 1, children.length);
}
pdata[0] = new ProfileSelf(this);
return pdata;
|
public void | addTopExclusive(long time)
mTopExclusive += time;
|
public double | addWeight(int x, int y, double weight)
if (mX == x && mY == y)
mWeight += weight;
else {
mX = x;
mY = y;
mWeight = weight;
}
return mWeight;
|
public void | analyzeData()
// Sort the parents and children into decreasing inclusive time
ProfileData[] sortedParents;
ProfileData[] sortedChildren;
ProfileData[] sortedRecursiveParents;
ProfileData[] sortedRecursiveChildren;
sortedParents = sortProfileData(mParents);
sortedChildren = sortProfileData(mChildren);
sortedRecursiveParents = sortProfileData(mRecursiveParents);
sortedRecursiveChildren = sortProfileData(mRecursiveChildren);
// Add "self" time to the top of the sorted children
sortedChildren = addSelf(sortedChildren);
// Create the ProfileNode objects that we need
ArrayList<ProfileNode> nodes = new ArrayList<ProfileNode>();
ProfileNode profileNode;
if (mParents != null) {
profileNode = new ProfileNode("Parents", this, sortedParents,
true, false);
nodes.add(profileNode);
}
if (mChildren != null) {
profileNode = new ProfileNode("Children", this, sortedChildren,
false, false);
nodes.add(profileNode);
}
if (mRecursiveParents!= null) {
profileNode = new ProfileNode("Parents while recursive", this,
sortedRecursiveParents, true, true);
nodes.add(profileNode);
}
if (mRecursiveChildren != null) {
profileNode = new ProfileNode("Children while recursive", this,
sortedRecursiveChildren, false, true);
nodes.add(profileNode);
}
mProfileNodes = nodes.toArray(new ProfileNode[nodes.size()]);
|
public void | clearWeight()
mWeight = 0;
|
private void | computeName()
if (mMethodName == null) {
mName = mClassName;
return;
}
StringBuilder sb = new StringBuilder();
sb.append(mClassName);
sb.append("."); //$NON-NLS-1$
sb.append(mMethodName);
sb.append(" "); //$NON-NLS-1$
sb.append(mSignature);
mName = sb.toString();
|
public void | computeProfileName()
if (mRank == -1) {
mProfileName = mName;
return;
}
StringBuilder sb = new StringBuilder();
sb.append(mRank);
sb.append(" "); //$NON-NLS-1$
sb.append(getName());
mProfileName = sb.toString();
|
public java.lang.String | getCalls()
return String.format("%d+%d", mNumCalls[0], mNumCalls[1]);
|
public java.lang.String | getClassName()
return mClassName;
|
public org.eclipse.swt.graphics.Color | getColor()
return mColor;
|
public long | getElapsedExclusive()
return mElapsedExclusive;
|
public long | getElapsedInclusive()
return mElapsedInclusive;
|
public org.eclipse.swt.graphics.Color | getFadedColor()
return mFadedColor;
|
public org.eclipse.swt.graphics.Image | getFadedImage()
return mFadedImage;
|
public int | getId()
return mId;
|
public org.eclipse.swt.graphics.Image | getImage()
return mImage;
|
public int | getLineNumber()
return mLineNumber;
|
public java.lang.String | getMethodName()
return mMethodName;
|
public java.lang.String | getName()
return mName;
|
public java.lang.String | getPathname()
return mPathname;
|
public java.lang.String | getProfileName()
return mProfileName;
|
public ProfileNode[] | getProfileNodes()
return mProfileNodes;
|
public int | getRank()
return mRank;
|
public long | getTopExclusive()
return mTopExclusive;
|
public int | getTotalCalls()
return mNumCalls[0] + mNumCalls[1];
|
public void | setColor(org.eclipse.swt.graphics.Color color)
mColor = color;
|
public void | setFadedColor(org.eclipse.swt.graphics.Color fadedColor)
mFadedColor = fadedColor;
|
public void | setFadedImage(org.eclipse.swt.graphics.Image fadedImage)
mFadedImage = fadedImage;
|
public void | setImage(org.eclipse.swt.graphics.Image image)
mImage = image;
|
public void | setLineNumber(int lineNumber)
mLineNumber = lineNumber;
|
public void | setPathname(java.lang.String pathname)
mPathname = pathname;
|
public void | setRank(int rank)
mRank = rank;
computeProfileName();
|
private ProfileData[] | sortProfileData(java.util.HashMap map)
if (map == null)
return null;
// Convert the hash values to an array of ProfileData
Collection<ProfileData> values = map.values();
ProfileData[] sorted = values.toArray(new ProfileData[values.size()]);
// Sort the array by elapsed inclusive time
Arrays.sort(sorted, mByElapsedInclusive);
return sorted;
|
public java.lang.String | toString()
return getName();
|
private java.util.HashMap | updateInclusive(long time, com.android.traceview.MethodData contextMethod, com.android.traceview.MethodData elementMethod, boolean elementIsParent, java.util.HashMap map)
if (map == null) {
map = new HashMap<Integer, ProfileData>(4);
} else {
ProfileData profileData = map.get(elementMethod.mId);
if (profileData != null) {
profileData.addElapsedInclusive(time);
return map;
}
}
ProfileData elementData = new ProfileData(contextMethod,
elementMethod, elementIsParent);
elementData.setElapsedInclusive(time);
elementData.setNumCalls(1);
map.put(elementMethod.mId, elementData);
return map;
|