Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
开发者_StackOverflow中文版 Improve this questionCan anybody tell me about 'profiling' in unix by giving a small example. Thank you!
You'll need to give us some more context if you want a useful answer. Broadly speaking, profiling a program is to instrument the executable with some extra statements that record details of execution which you can later analyse to identify parts that are slow, consume too much memory, consume too much CPU etc. Here's a quickie along with examples on how to use gprof
which is the GNU profiler for C. http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html#SEC2
If you want to shine in your exam about profiling, talk about Dtrace.
精彩评论