Perf with the Linux Kernel

Slides:



Advertisements
Similar presentations
Diagnosing Performance Overheads in the Xen Virtual Machine Environment Aravind Menon Willy Zwaenepoel EPFL, Lausanne Jose Renato Santos Yoshio Turner.
Advertisements

1 Operating Systems and Protection CS Goals of Today’s Lecture How multiple programs can run at once  Processes  Context switching  Process.
1 Operating Systems and Protection Professor Jennifer Rexford CS 217.
KVM/ARM: The Design and Implementation of the Linux ARM Hypervisor Fall 2014 Presented By: Probir Roy.
Virtualization for Cloud Computing
Tanenbaum 8.3 See references
Microkernels, virtualization, exokernels Tutorial 1 – CSC469.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Introduction to Open Source Performance Tool --Linux Tool Perf Yiqi Ju (Fred) Sep. 13, 2012.
Benchmarking and Tuning ACI-REF Workshop Brett Zimmerman University of Oklahoma – IT/OSCER.
JPCM - JDC121 JPCM. Agenda JPCM - JDC122 3 Software performance is Better Performance tuning requires accurate Measurements. JPCM - JDC124 Software.
Our work on virtualization Chen Haogang, Wang Xiaolin {hchen, Institute of Network and Information Systems School of Electrical Engineering.
E X C E E D I N G E X P E C T A T I O N S OP SYS Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Functions of an operating.
Analysis of the ROOT Persistence I/O Memory Footprint in LHCb Ivan Valenčík Supervisor Markus Frank 19 th September 2012.
Chapter 10 System Monitoring Issues Performance Benchmarks NT Server Services Users and Server Access Information Task Manager for Applications Ram and.
 Virtual machine systems: simulators for multiple copies of a machine on itself.  Virtual machine (VM): the simulated machine.  Virtual machine monitor.
Instrumentation of Xen VMs for efficient VM scheduling and capacity planning in hybrid clouds. Kurt Vermeersch Coordinator: Sam Verboven.
02/09/2010 Industrial Project Course (234313) Virtualization-aware database engine Final Presentation Industrial Project Course (234313) Virtualization-aware.
Embedded System Lab. 정범종 A_DRM: Architecture-aware Distributed Resource Management of Virtualized Clusters H. Wang et al. VEE, 2015.
4P13 Week 2 & 3 Talking Points 1. Kernel Processes 2.
Examples of Operating Systems.
Lecture 26 Virtual Machine Monitors. Virtual Machines Goal: run an guest OS over an host OS Who has done this? Why might it be useful? Examples: Vmware,
Docker and Container Technology
CS 390 Unix Programming Environment
Vertical Profiling : Understanding the Behavior of Object-Oriented Applications Sookmyung Women’s Univ. PsLab Sewon,Moon.
VM vs Container Xen, KVM, VMware, etc. Hardware emulation / paravirtualization Can run different OSs on the same box Dozens of instances OS sprawl problem.
CSE 451: Operating Systems Winter 2015 Module 25 Virtual Machine Monitors Mark Zbikowski Allen Center 476 © 2013 Gribble, Lazowska,
© 2004 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Understanding Virtualization Overhead.
Performance analysis comparison Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010.
Título/Title Nome/Name Cargo/Position Foto/ Picture Linux Performance on Power Breno Leitão Software Engineer.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1© Copyright 2015 EMC Corporation. All rights reserved. NUMA(YEY) BY JACOB KUGLER.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
Virtualization Neependra Khare
© D. J. Foreman, Structure of an O/S. © D. J. Foreman, Overview  Required functionality –Handle interrupts –Manage resources Processes.
VM vs Container Xen, KVM, VMware, etc. ● Hardware emulation / paravirtualization ● Can run different OSs on the same box ● Dozens of instances ● OS sprawl.
Virtual Memory Chapter 8.
Computer System Laboratory
Virtualization.
CSC 482/582: Computer Security
Linux203Training Module System Mgmt.
Chapter 1: A Tour of Computer Systems
Chapter 2: System Structures
Lecture 24 Virtual Machine Monitors
CS 3305 System Calls Lecture 7.
Containers and Virtualisation
Introduction to Operating System (OS)
Virtualization overview
MOM + oVirt: Nurturing our Virtual Machines
Architecture Background
What is an Operating System?
Introduction to Operating Systems
OS Virtualization.
CSCI 315 Operating Systems Design
Agenda Why simulation Simulation and model Instruction Set model
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Page Replacement.
Chapter 2: System Structures
Xen Network I/O Performance Analysis and Opportunities for Improvement
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
Tools.
Lecture Topics: 11/1 General Operating System Concepts Processes
Tools.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
System calls….. C-program->POSIX call
Andy Wang CIS Computer Systems Performance Analysis
CSE 451: Operating Systems Autumn Module 24 Virtual Machine Monitors
What Are Performance Counters?
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

Perf with the Linux Kernel

annotate – annotate source code with profile info perf commands annotate – annotate source code with profile info kmem – kernel memory profiling kvm – profile guests list – list kinds of events lock – analyze lock events record – save profile data to a file report – display profile report stat – gather data while running a command timechart – visualize system behavior top – system profiling

~/perf-stuff$ perf list |grep Hardware cpu-cycles OR cycles [Hardware event] instructions [Hardware event] cache-references [Hardware event] cache-misses [Hardware event] branch-instructions OR branches [Hardware event] branch-misses [Hardware event] bus-cycles [Hardware event] stalled-cycles-frontend OR idle-cycles-frontend [Hardware event] ref-cycles [Hardware event] Much more available if run as root.

~/perf-stuff$ perf stat -e instructions date User space example: ~/perf-stuff$ perf stat -e instructions date Wed Feb 18 21:49:03 PST 2015 Performance counter stats for 'date': 669,408 instructions 0.001060121 seconds time elapsed Subsequent runs gave: 668,858 instructions, 0.001034210 seconds time elapsed 667,037 instructions, 0.000995727 seconds time elapsed

perf calls perf_event_open(2) – kernel/events/core.c perf list/stat kernel sudo perf list perf calls perf_event_open(2) – kernel/events/core.c sudo perf stat -e net:netif_rx wget http://tahoot.com/cs172a-lecture7.mp4 (24MB) Performance counter stats for 'wget http://tahoot.com/cs172a- lecture7.mp4': 2 net:netif_rx 9.536512491 seconds time elapsed For stat -e net:netif_receive_skb 3,828 net:netif_receive_skb 3.821882698 seconds time elapsed int netif_receive_skb(struct sk_buff *skb) { trace_netif_receive_skb_entry(skb); return netif_receive_skb_internal(skb); }

perf_event_paranoid is not mentioned in ./Documentation top run perf top with sudo perf_event_paranoid is not mentioned in ./Documentation defined in kernel/sysctl.c depends on CONFIG_PERF_EVENTS

timechart sudo perf timechart record find /usr -name core >&/dev/null sudo perf timechar display output.svg

sudo perf record wget http://tahoot.com/cs172a-lecture7.mp4 report sudo perf record wget http://tahoot.com/cs172a-lecture7.mp4 sudo perf report

sudo perf lock record wget http://tahoot.com/cs172a-lecture7.mp4 tracepoint lock:lock_acquire is not enabled. Are CONFIG_LOCKDEP and CONFIG_LOCK_STAT enabled? under kernel hacking

perf kvm Perf uses CPU performance counters These need to be virtualized to properly account for performance in a Guest VM perf kvm [--host] [--guest] [--guestmount=<path> [--guestkallsyms=<path> - -guestmodules=<path> | --guestvmlinux=<path>]] {top|record|report|diff|buildid-list} perf kvm [--host] [--guest] [--guestkallsyms=<path> --guestmodules=<path> | --guestvmlinux=<path>] {top|record|report|diff|buildid-list} http://infoscience.epfl.ch/record/162329/files/VEE11_performance_profiling_of_virtual_machines.pdf http://www.linux-kvm.org/page/Perf_events

Virtualization Overhead VM layer overhead, Linux guest: CPU and Memory: 14.36% Network I/O: 24.46% Disk I/O: 8.84% Disk latency for reading: 2.41 times slower Micro-operations execution time: 10.84 times slower Redhat reports 85% efficiency in VM's (RHEL6 Virtualization Getting Started Guide) Reported by: http://petersenna.com/files/peters-top4-virtualization-benchmark-1.28.pdf

sudo perf kmem record wget http://tahoot.com/cs172a-lecture7.mp4 you may lose events... Warning: Processed 6080223 events and lost 10 chunks! Check IO/CPU overload!

kmem events sudo perf record -g -e kmem:mm_page_alloc -c 1 wget http://tahoot.com/cs172a-lecture7.mp4

sudo perf annotate -l -P

annotate in kernel

report of looper with dup2()