Search in sources :

Example 1 with HistRoot

use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot in project linuxtools by eclipse.

the class CallGraphContentProvider method hasChildren.

@Override
public boolean hasChildren(Object parentElement) {
    if (parentElement instanceof HistRoot) {
        HistRoot root = (HistRoot) parentElement;
        LinkedList<? extends TreeElement> ret = getFunctionChildrenList(root);
        return !ret.isEmpty();
    }
    if (parentElement instanceof HistFunction) {
        HistFunction function = (HistFunction) parentElement;
        CGCategory parents = function.getParentsFunctions();
        CGCategory children = function.getChildrenFunctions();
        return (parents != null || children != null);
    }
    if (parentElement instanceof CGCategory) {
        CGCategory cat = (CGCategory) parentElement;
        return !cat.getChildren().isEmpty();
    }
    return false;
}
Also used : CGCategory(org.eclipse.linuxtools.internal.gprof.view.histogram.CGCategory) HistFunction(org.eclipse.linuxtools.internal.gprof.view.histogram.HistFunction) HistRoot(org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot)

Example 2 with HistRoot

use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot in project linuxtools by eclipse.

the class CallGraphContentProvider method getElements.

@Override
public Object[] getElements(Object inputElement) {
    if (inputElement instanceof GmonDecoder) {
        GmonDecoder obj = (GmonDecoder) inputElement;
        HistRoot root = obj.getRootNode();
        return new Object[] { root };
    }
    return new Object[0];
}
Also used : GmonDecoder(org.eclipse.linuxtools.internal.gprof.parser.GmonDecoder) HistRoot(org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot)

Example 3 with HistRoot

use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot in project linuxtools by eclipse.

the class FileHistogramContentProvider method getElements.

@Override
public Object[] getElements(Object inputElement) {
    if (inputElement instanceof GmonDecoder) {
        GmonDecoder obj = (GmonDecoder) inputElement;
        HistRoot root = obj.getRootNode();
        return new Object[] { root };
    }
    return new Object[0];
}
Also used : GmonDecoder(org.eclipse.linuxtools.internal.gprof.parser.GmonDecoder) HistRoot(org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot)

Example 4 with HistRoot

use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot in project linuxtools by eclipse.

the class HistogramDecoder method addBucket.

private void addBucket(Bucket b, ISymbol s) {
    HistRoot root = this.decoder.getRootNode();
    root.addBucket(b, s, decoder.getProgram());
}
Also used : HistRoot(org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot)

Example 5 with HistRoot

use of org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot in project linuxtools by eclipse.

the class CallGraphContentProvider method getChildren.

@Override
public Object[] getChildren(Object parentElement) {
    if (parentElement instanceof HistRoot) {
        HistRoot root = (HistRoot) parentElement;
        LinkedList<? extends TreeElement> ret = getFunctionChildrenList(root);
        return ret.toArray();
    }
    if (parentElement instanceof HistFunction) {
        HistFunction function = (HistFunction) parentElement;
        CGCategory parents = function.getParentsFunctions();
        CGCategory children = function.getChildrenFunctions();
        if (parents == null) {
            if (children == null)
                return new Object[0];
            return new Object[] { children };
        } else if (children == null) {
            return new Object[] { parents };
        } else {
            return new Object[] { parents, children };
        }
    }
    if (parentElement instanceof CGCategory) {
        CGCategory cat = (CGCategory) parentElement;
        return cat.getChildren().toArray();
    }
    return null;
}
Also used : CGCategory(org.eclipse.linuxtools.internal.gprof.view.histogram.CGCategory) HistFunction(org.eclipse.linuxtools.internal.gprof.view.histogram.HistFunction) HistRoot(org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot)

Aggregations

HistRoot (org.eclipse.linuxtools.internal.gprof.view.histogram.HistRoot)7 GmonDecoder (org.eclipse.linuxtools.internal.gprof.parser.GmonDecoder)2 CGCategory (org.eclipse.linuxtools.internal.gprof.view.histogram.CGCategory)2 HistFunction (org.eclipse.linuxtools.internal.gprof.view.histogram.HistFunction)2