Tracing: Difference between revisions

From KVM
(trace-cmd instructions)
 
mNo edit summary
 
Line 6: Line 6:
# download trace-cmd:
# download trace-cmd:
  <nowiki>
  <nowiki>
  $ git clone trace-cmd git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
  $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git trace-cmd
  $ cd trace-cmd
  $ cd trace-cmd
  </nowiki>
  </nowiki>

Latest revision as of 11:58, 9 March 2011

Tracing is done by means of kernel tracepoints, the ftrace infrastructure, and trace-cmd.

Installing trace-cmd

  1. Install the udis86 and udis86-devel packages
  2. download trace-cmd:
 $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git trace-cmd
 $ cd trace-cmd
 
  1. build and install:
 $ make && sudo make install
 

Tracing

 # trace-cmd record -b 20000 -e kvm
 

(trace-cmd will wait)

run your workload, then stop trace-cmd with ctrl-C. trace-cmd will write a trace.dat file.

Analyzing the trace

 trace-cmd report
 

will format and display the contents of the trace.