Examples of CallGraph


Examples of edu.brown.cs.rampcommon.callgraph.CallGraph

         */
        //Finalize for threads: calculate probabilities and save
        for (Map.Entry<Integer, CallGraph> entry : m_callGraphThreads.entrySet())
        {
            int iThreadID = entry.getKey();
            CallGraph callGraph = entry.getValue();
            //callGraph.onVirtualVertex("end_vertex");
            callGraph.normalizeEndVertices();
            callGraph.calculateTransitionProbabilities();
            saveCallGraph(callGraph,Integer.toString(iThreadID));
        }

        //Merge threads graphs into the thread groups
        for (Map.Entry<Integer, CallGraph> threadGraphEntry : m_callGraphThreads.entrySet())
        {
            ThreadDescriptor thread = this.m_threadSet.getThread(threadGraphEntry.getKey());
            String strGroupName = thread.getGroup().getName();
            CodeFragmentSet cfSetForGroup = thread.getGroup().getCodeFragmentSet();
            CallGraph graphForThreadGroup = null;
            try
            {
                graphForThreadGroup = getOrCreateGraph(strGroupName, cfSetForGroup, m_callGraphThreadGroups);
            } catch (Exception e)
            {
                throw new RampException(String.format("Exception initializing graphs for thread group %s",
                        strGroupName, e));
            }
            graphForThreadGroup.mergeWith(threadGraphEntry.getValue());
        }

        //Finalize for thread groups
        for (Map.Entry<String, CallGraph> entry : m_callGraphThreadGroups.entrySet())
        {
            String strGroupName = entry.getKey();
            CallGraph callGraph = entry.getValue();
            entry.getValue().calculateTransitionProbabilities();
            saveCallGraph(callGraph,strGroupName);
        }
    }
View Full Code Here

Examples of edu.brown.cs.rampcommon.callgraph.CallGraph

    <T> CallGraph getOrCreateGraph(T threadKey,
            CodeFragmentSet cfSet,
            HashMap<T, CallGraph> contextMap) throws LogAnalyzerException, IOException
    {
        //Get or create contexts for thread/group
        CallGraph graphThread = contextMap.get(threadKey);
        if (graphThread == null)
        {
            graphThread = new CallGraph(threadKey.toString());
            contextMap.put(threadKey, graphThread);
        }
        return graphThread;
    }
View Full Code Here

Examples of edu.brown.cs.rampcommon.callgraph.CallGraph

        }
       
        //Find graphs for thread and thread group
        int iThreadID=recordFirst.getTID();

        CallGraph graphForThread = getCallGraphForThread(iThreadID);

        //pass code fragment to the graphs
        graphForThread.onCodeFragmentVertex(codeFragmentThread);

        if ((codeFragmentThread.getCodeFragmentType() == CodeFragmentType.BLOCKING_QUEUE_POLL)
                && (!recordSecond.getParameters().isEmpty()))
        {   //Handle a special case of a code fragment - fetching from the queue
            //Depending on the outcome of the fetch, a virtual node will be
            //inserted: a fetch or non_fetch node
            long lRetValue = recordSecond.getParameters().get(0);
            StringBuilder strVertexName = new StringBuilder(100);
            if (lRetValue != 0)
            {   //Could not retrieve the item from the queue
                strVertexName.append(codeFragmentThread.getName());
                strVertexName.append(ModelgenConstants.strQueueFetch);
            } else
            {   //Retrieved the item from the queue
                strVertexName.append(codeFragmentThread.getName());
                strVertexName.append(ModelgenConstants.strQueueNoFetch);
            }
            graphForThread.onVirtualVertex(strVertexName.toString());
        }

        return true;
    }
View Full Code Here

Examples of edu.brown.cs.rampcommon.callgraph.CallGraph

    }

    CallGraph getCallGraphForThread(int iThreadID) throws RampException
    {
        ThreadDescriptor threadDescCurrent = m_threadSet.getThread(iThreadID);
        CallGraph graphForThread = null;
        try
        {
            graphForThread = getOrCreateGraph(
                    iThreadID,
                    threadDescCurrent.getCodeFragmentSet(),
View Full Code Here

Examples of edu.brown.cs.rampcommon.callgraph.CallGraph

    /*
     * Internal version
     */
    void onCodeFragmentCF(int iThreadID, CodeFragmentDescriptor codeFragmentThread) throws RampException
    {
        CallGraph graphForThread = getCallGraphForThread(iThreadID);
        graphForThread.onCodeFragmentVertex(codeFragmentThread);
    }
View Full Code Here

Examples of edu.brown.cs.rampcommon.callgraph.CallGraph

        graphForThread.onCodeFragmentVertex(codeFragmentThread);
    }

    void onVirtualCF(int iThreadID, String strCFName) throws RampException
    {
        CallGraph graphForThread = getCallGraphForThread(iThreadID);
        graphForThread.onVirtualVertex(strCFName);
    }
View Full Code Here

Examples of edu.umd.cs.findbugs.CallGraph

        // Set<Method> publicReachableMethods;
        Set<Method> allMethods = new HashSet<Method>(Arrays.asList(javaClass.getMethods()));

        try {
            selfCalls.execute();
            CallGraph callGraph = selfCalls.getCallGraph();
            if (DEBUG) {
                System.out.println("Call graph (not unlocked methods): " + callGraph.getNumVertices() + " nodes, "
                        + callGraph.getNumEdges() + " edges");
            }
            // Find call edges that are obviously locked
            Set<CallSite> obviouslyLockedSites = findObviouslyLockedCallSites(classContext, selfCalls);
            lockedMethodSet = findNotUnlockedMethods(classContext, selfCalls, obviouslyLockedSites);
            lockedMethodSet.retainAll(findLockedMethods(classContext, selfCalls, obviouslyLockedSites));
View Full Code Here

Examples of edu.umd.cs.findbugs.CallGraph

    {

        JavaClass javaClass = classContext.getJavaClass();
        Method[] methodList = javaClass.getMethods();

        CallGraph callGraph = selfCalls.getCallGraph();

        // Initially, assume no methods are called from an
        // unlocked context
        Set<Method> lockedMethodSet = new HashSet<Method>();
        lockedMethodSet.addAll(Arrays.asList(methodList));

        // Assume all public methods are called from
        // unlocked context
        for (Method method : methodList) {
            if (method.isPublic() && !isConstructor(method.getName())) {
                lockedMethodSet.remove(method);
            }
        }

        // Explore the self-call graph to find nonpublic methods
        // that can be called from an unlocked context.
        boolean change;
        do {
            change = false;

            for (Iterator<CallGraphEdge> i = callGraph.edgeIterator(); i.hasNext();) {
                CallGraphEdge edge = i.next();
                CallSite callSite = edge.getCallSite();

                // Ignore obviously locked edges
                if (obviouslyLockedSites.contains(callSite)) {
View Full Code Here

Examples of edu.umd.cs.findbugs.CallGraph

    {

        JavaClass javaClass = classContext.getJavaClass();
        Method[] methodList = javaClass.getMethods();

        CallGraph callGraph = selfCalls.getCallGraph();

        // Initially, assume all methods are locked
        Set<Method> lockedMethodSet = new HashSet<Method>();

        // Assume all public methods are unlocked
        for (Method method : methodList) {
            if (method.isSynchronized()) {
                lockedMethodSet.add(method);
            }
        }

        // Explore the self-call graph to find nonpublic methods
        // that can be called from an unlocked context.
        boolean change;
        do {
            change = false;

            for (Iterator<CallGraphEdge> i = callGraph.edgeIterator(); i.hasNext();) {
                CallGraphEdge edge = i.next();
                CallSite callSite = edge.getCallSite();

                if (obviouslyLockedSites.contains(callSite) || lockedMethodSet.contains(callSite.getMethod())) {
                    // Calling method is locked, so the called method
View Full Code Here

Examples of soot.jimple.toolkits.callgraph.CallGraph

     
        if(!Scene.v().hasCallGraph()) {
          throw new IllegalStateException("No call graph found!");
        }
             
      CallGraph cg = Scene.v().getCallGraph();
      ReachableMethods reachableMethods = new ReachableMethods(cg,Collections.<MethodOrMethodContext>singletonList(container));
      reachableMethods.update();
      for (Iterator<MethodOrMethodContext> iterator = reachableMethods.listener(); iterator.hasNext();) {
        SootMethod m = (SootMethod) iterator.next();
        if(m.hasActiveBody() &&
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.