profile.pl

Hi all

I want to use "'/home/llvm/src/utils/[profile.pl](http://profile.pl)' -edge sort.bc" command, but i face this error: 

Error opening ‘/usr/local/lib/profile_rt.so’: /usr/local/lib/profile_rt.so: cannot open shared object file: No such file or directory
-load request ignored.
LLVM ERROR: Program used external function ‘llvm_start_edge_profiling’ which could not be resolved!
llvm-prof: Error opening ‘llvmprof.out’: No such file or directory

Hi all

I want to use "'/home/llvm/src/utils/[profile.pl](http://profile.pl)' -edge sort.bc" command, but i face this error: 

Error opening ‘/usr/local/lib/profile_rt.so’: /usr/local/lib/profile_rt.so: cannot open shared object file: No such file or directory
-load request ignored.
LLVM ERROR: Program used external function ‘llvm_start_edge_profiling’ which could not be resolved!
llvm-prof: Error opening ‘llvmprof.out’: No such file or directory

I haven’t used profile.pl myself, but looking at the error, it looks like there’s a run-time library (profile_rt.so) that it’s looking for in /usr/local/lib but can’t find.

I suspect that profile_rt.so is built as part of LLVM, but since you haven’t done a “make install,” profile_rt.so is still just sitting in the Release/lib (or Debug+Asserts/lib) directory.

If you search for profile_rt.so in your LLVM object tree and change the script to load it from that directory instead, the script may work for you.

– John T.

i could not use profile.pl, however i did reinstall the llvm but didn’t solve my problem. is there is another way to extract profilling information in llvm?
i have another question, i want know how can estimate execution time for each operand such as mul ,add, … ?

i could not use profile.pl, however i did reinstall the llvm but didn’t solve my problem. is there is another way to extract profilling information in llvm?

First, I believe that profile.pl is just a script that automates the profiling process. You should be able to do whatever it is that the script is doing (assuming that the profiling code in LLVM is currently well-maintained, which I suspect it is).

Second, what do you mean by “reinstalling LLVM?” Did you just rebuild it? Did you do a “make install?” If you did a “make install”, what was the option to the --prefix= option on the configure command line?

Are you getting the same error now, or are you getting a different error?

Third, did you try my earlier suggestion of just changing profile.pl to look for the profile_rt.so file elsewhere? I believe the necessary line of code is line 68 of profile.pl (from mainline LLVM). If you tried it, did it not work? If it didn’t work, what error did you get?

i have another question, i want know how can estimate execution time for each operand such as mul ,add, … ?

I don’t know of an analysis that does this within LLVM. I would think that this is less-than-straightfoward due to instruction folding (e.g., merging a GEP and a load into a single x86 indexed mov instruction) and other machine-code specific optimizations.

That said, if you just need to have relative differences in execution, you could probably write a very simple analysis that generates a rough estimate. For example, fadd is probably much more expensive than add on any system. Call instructions with more arguments probably cost more than calls with less arguments, etc.

Another route might be to write such an analysis as a MachineFunctionPass. That way, I think you can see individual machine instruction that were actually generated and get a better estimate.

I just don’t know how accurate it’d be or what level of accuracy you need.

– John T.

Thanks for the reply.My problem is solved.

hi
i have another question, how can change the display of result on
screen?For this purpose, i have modified the llvm-prof file and make
it again. But received no results

Can you please rephrase the question? I do not understand what you are asking.

-- John T.