Package edu.brown.cs.rampcommon.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


    <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

        }
       
        //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

    }

    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

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

        graphForThread.onCodeFragmentVertex(codeFragmentThread);
    }

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

TOP

Related Classes of edu.brown.cs.rampcommon.callgraph.CallGraph

Copyright © 2018 www.massapicom. 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.