Sahoo, Swarup Kumar
2014-Aug-18 06:04 UTC
[LLVMdev] generating a dynamic callgraph with llvm-prof
Yes, the latest version can be downloaded from here https://github.com/liuml07/giri . The LLVM instrumentation code is in TracingNoGiri.cpp<https://github.com/liuml07/giri/blob/master/lib/Giri/TracingNoGiri.cpp> file and runtime code in Tracing.cpp. You may need to delete other unnecessary instrumentation code which you don't need. Thanks, Swarup. ________________________________ From: John Criswell [jtcriswel at gmail.com] Sent: Sunday, August 17, 2014 2:25 PM To: Eric Soderstrom; llvmdev Cc: Sahoo, Swarup Kumar Subject: Re: [LLVMdev] generating a dynamic callgraph with llvm-prof Dear Eric, Swarup and I wrote a dynamic slicing system called Giri several years ago that recorded the execution of every call instruction. It's not in the LLVM tree, and I don't think it works with the latest version of LLVM, but it'll give you what you want. Swarup, is that code publicly available somewhere? Regards, John Criswell On 8/17/14, 12:40 PM, Eric Soderstrom wrote: One can use "-insert-edge-profiling" with opt to collect general metrics (frequency of function execution, frequency of basic block execution). But I'd like to record all call information. So every time a function call is made, I'd like to record [calling function name, callee function name] Is this feasible with with llvm-prof and any of the existing profiling options? _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140818/37ae8b84/attachment.html>
Eric Soderstrom
2014-Aug-22 23:31 UTC
[LLVMdev] generating a dynamic callgraph with llvm-prof
Thank you. I've compiled giri, and looked through the source code. It seems like it should do exactly what I want (record each basic block execution) By inspecting the test Makefiles, I can see how to generate an instrumented binary, "example.trace.exe", and running the instrumented binary produces a trace file "example.trace". Presumably, the basic block execution profile is stored in these trace files. But it's not entirely clear to me how to interpret the resulting .trace file. EntryCache doesn't provide any methods for actually reading cache contents. Could you point me in the right direction for how to extract basic block execution profile information from a trace file? thank you for the help! On Mon, Aug 18, 2014 at 2:04 AM, Sahoo, Swarup Kumar <ssahoo2 at illinois.edu> wrote:> Yes, the latest version can be downloaded from here > https://github.com/liuml07/giri . The LLVM instrumentation code is in > TracingNoGiri.cpp > <https://github.com/liuml07/giri/blob/master/lib/Giri/TracingNoGiri.cpp> > file and runtime code in Tracing.cpp. > > You may need to delete other unnecessary instrumentation code which you > don't need. > > Thanks, > Swarup. > > ------------------------------ > *From:* John Criswell [jtcriswel at gmail.com] > *Sent:* Sunday, August 17, 2014 2:25 PM > *To:* Eric Soderstrom; llvmdev > *Cc:* Sahoo, Swarup Kumar > *Subject:* Re: [LLVMdev] generating a dynamic callgraph with llvm-prof > > Dear Eric, > > Swarup and I wrote a dynamic slicing system called Giri several years ago > that recorded the execution of every call instruction. It's not in the > LLVM tree, and I don't think it works with the latest version of LLVM, but > it'll give you what you want. > > Swarup, is that code publicly available somewhere? > > Regards, > > John Criswell > > On 8/17/14, 12:40 PM, Eric Soderstrom wrote: > > One can use "-insert-edge-profiling" with opt to collect general metrics > (frequency of function execution, frequency of basic block execution). But > I'd like to record all call information. So every time a function call is > made, I'd like to record [calling function name, callee function name] > > Is this feasible with with llvm-prof and any of the existing profiling > options? > > > _______________________________________________ > LLVM Developers mailing listLLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >-- Eric Söderström MIT - 2012 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140822/4590651c/attachment.html>
Sahoo, Swarup Kumar
2014-Aug-23 02:04 UTC
[LLVMdev] generating a dynamic callgraph with llvm-prof
Dear Eric, This file has code which prints the trace in readable format. https://github.com/liuml07/giri/blob/master/tools/PrintTrace/PrintTrace.cpp You can additional details from TraceFile.cpp<https://github.com/liuml07/giri/blob/master/lib/Giri/TraceFile.cpp> (and Giri.cpp<https://github.com/liuml07/giri/blob/master/lib/Giri/Giri.cpp>) about how we read and use Basic Block information. Hope this will help you. Thanks, Swarup. ________________________________ From: ericsoderstrom at gmail.com [ericsoderstrom at gmail.com] on behalf of Eric Soderstrom [e_k_s at mit.edu] Sent: Friday, August 22, 2014 6:31 PM To: Sahoo, Swarup Kumar Cc: John Criswell; llvmdev Subject: Re: [LLVMdev] generating a dynamic callgraph with llvm-prof Thank you. I've compiled giri, and looked through the source code. It seems like it should do exactly what I want (record each basic block execution) By inspecting the test Makefiles, I can see how to generate an instrumented binary, "example.trace.exe", and running the instrumented binary produces a trace file "example.trace". Presumably, the basic block execution profile is stored in these trace files. But it's not entirely clear to me how to interpret the resulting .trace file. EntryCache doesn't provide any methods for actually reading cache contents. Could you point me in the right direction for how to extract basic block execution profile information from a trace file? thank you for the help! On Mon, Aug 18, 2014 at 2:04 AM, Sahoo, Swarup Kumar <ssahoo2 at illinois.edu<mailto:ssahoo2 at illinois.edu>> wrote: Yes, the latest version can be downloaded from here https://github.com/liuml07/giri . The LLVM instrumentation code is in TracingNoGiri.cpp<https://github.com/liuml07/giri/blob/master/lib/Giri/TracingNoGiri.cpp> file and runtime code in Tracing.cpp. You may need to delete other unnecessary instrumentation code which you don't need. Thanks, Swarup. ________________________________ From: John Criswell [jtcriswel at gmail.com<mailto:jtcriswel at gmail.com>] Sent: Sunday, August 17, 2014 2:25 PM To: Eric Soderstrom; llvmdev Cc: Sahoo, Swarup Kumar Subject: Re: [LLVMdev] generating a dynamic callgraph with llvm-prof Dear Eric, Swarup and I wrote a dynamic slicing system called Giri several years ago that recorded the execution of every call instruction. It's not in the LLVM tree, and I don't think it works with the latest version of LLVM, but it'll give you what you want. Swarup, is that code publicly available somewhere? Regards, John Criswell On 8/17/14, 12:40 PM, Eric Soderstrom wrote: One can use "-insert-edge-profiling" with opt to collect general metrics (frequency of function execution, frequency of basic block execution). But I'd like to record all call information. So every time a function call is made, I'd like to record [calling function name, callee function name] Is this feasible with with llvm-prof and any of the existing profiling options? _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -- Eric Söderström MIT - 2012 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140823/c7f814e5/attachment.html>