<div dir="ltr">Sounds like this: <a href="https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation">https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation</a> might be relevant to your interests. Though I'm not sure there's a supported way to /only/ collect a profile for a single function.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 6, 2017 at 8:20 PM 李阳 via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi LLVM-ers,<div><br></div><div>I want to obtain the execution time of one specified library function, such as CUDA library function.</div><div><br></div><div>My thoughts is: 1) use clang to compile the library function to IR;</div><div>                         2) instrument the IR, here is my unknown. I have no idea about how to instrument the instruction relative to execution time. Or is this approach feasible? If there is function supporting timestamp, I want to insert the start-time timestamp to the begin of the library function, and insert the stop-time timestamp to the end of the library function, then compute the interval between two timestamp.</div><div><br></div><div>Thanks!</div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>