Your SlideShare is downloading. ×
0
Linux Performance Analysis with Perf
Linux Performance Analysis with Perf
Linux Performance Analysis with Perf
Linux Performance Analysis with Perf
Linux Performance Analysis with Perf
Linux Performance Analysis with Perf
Linux Performance Analysis with Perf
Linux Performance Analysis with Perf
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Linux Performance Analysis with Perf

2,153

Published on

Tuning systems and applications for speed requires tools to gain visibility into the performance hotspots that will yield the largest improvements. Perf, which we cover in this tutorial, constitute …

Tuning systems and applications for speed requires tools to gain visibility into the performance hotspots that will yield the largest improvements. Perf, which we cover in this tutorial, constitute one of the latest addition to the Linux world in the field of performance analysis.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,153
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
55
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • 04/25/12
  • 04/25/12
  • 04/25/12
  • 04/25/12
  • 04/25/12
  • 04/25/12
  • 04/25/12
  • Transcript

    • 1. Performance Analysis with Perf By Dominic Duval dduval@linuxfoundation.org
    • 2. Performance Monitoring Localizing performance hotspots Profiling : gathering statistics on how the code executes Can be done in two ways:  Software: low precision  Hardware: uses specialized counters on the CPU Hardware method is more efficient and precise Also gives us access to data we can’t record otherwise
    • 3. Perf: More Than a Profiler perf : interface to hardware and software events Built in the kernel  With user space utilities for control and reports One command: perf  Many subcommands, very git-like  No daemons Requires debugging symbols to be installed  kernel-debuginfo or vmlinux for kernel  Applications compiled with -g Focuses on hardware performance counters but also other events:  Tracepoints  Software counters  Hardware breakpoints
    • 4. Perf Security Perf commands restricted to root by default Security checks can be disabled withecho 0 > / proc / sys / kernel / perf_event_paranoid Can be made persistent via sysctl Proper write access to current directory still required Paranoid mode recommended for production environments
    • 5. Listing perf events: perf list Lists all events supported by the current architecture Any event names in first column can be used Hardware events use the PMU  Low overhead Software events are triggered by the kernel Tracepoints : similar to software events and refer to specific functions Many hardware events missing  Can be set as a raw event  Documented by CPU manufacturers
    • 6. System overview: perf stat Provides a standard set of statistics after invoking a command Events include:  Task-clock ticks  Context switches  CPU migrations  Page faults  CPU cycles  Stalled cycles  Instructions  Branches and branch misses Uses round-robin to support multiple events  Subject to wild extrapolations  Can lack precision with short workloads
    • 7. Recording performance data: perf record Reads performance data and generates a file in the current directory:  perf.data  Make sure the current directory is writable! Can generate a large dataset if profiling the whole system  Or if recording with call-graphs (­g) Which is event is recorded can be specified with -e:perf record ­e instructions sleep 5perf record ­e LLC­loads / usr / bin / firefox
    • 8. For more informationTo watch a detailed video presentation onhow to use perf for performance analysis,visit:http://go.linuxfoundation.org/PerfVideo

    ×