[LLVMdev] path profile result with LLVM

gssict gongsongshan at gmail.com
Mon Apr 1 02:09:33 PDT 2013


      I want to get path profiling information with LLVM.
      LLVM provides methods for path profiling.I also get the llvmprof.out
successfully. So I want to output the result.With llvm-prof ,I get the
error:llvm-prof: Unkknown packet #5.
    So I have to write my own pass to output the path profiling result,the
following is my kernel codes:
////////////////////////////////////////////////////////////////////////////////////
    bool PathProfileOutput::runOnModule(Module &M) {
               PathProfileInfo& pathProfileInfo =
getAnalysis<PathProfileInfo>();
	       
	       for(Module::iterator F = M.begin();F != M.end(); ++F){
		if (F->isDeclaration()) continue;
		
		pathProfileInfo.setCurrentFunction(F);
		
		for(ProfilePathIterator nextPath=pathProfileInfo.pathBegin();nextPath !=
pathProfileInfo.pathEnd();nextPath++){
		ProfilePath* currentPath = nextPath->second;
		errs() << "Function: "+ F->getName() << "\n";
		errs() <<"path #" << currentPath->getNumber()<<":" <<
currentPath->getCount() <<"\n";
		}
		}
		return true;
               }
//////////////////////////////////////////////////////////////////
I test with a fft program,and get the output . I intend to get all path
information ,but the result only contains part path information.The
following is the output of a kernel function in my fft program:
<http://llvm.1065342.n5.nabble.com/file/n56354/hotspotOr11k.png> 
My questions :How to explain the output result?Does that mean hot paths? Or
can anyone tell me how to output the path profiling information correctly? 
Thanks!



--
View this message in context: http://llvm.1065342.n5.nabble.com/path-profile-result-with-LLVM-tp56354.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.



More information about the llvm-dev mailing list