Perf (Linux)

perf
Repositoryhttps://github.com/torvalds/linux/tree/master/tools/perf
Written inC
Operating systemLinux kernel
TypePerformance monitor and testing
LicenseGNU GPL
Websiteperf.wiki.kernel.org/index.php/Main_Page

perf (sometimes called perf_events[1] or perf tools, originally Performance Counters for Linux, PCL)[2] is a performance analyzing tool in Linux, available from Linux kernel version 2.6.31 in 2009.[3] Userspace controlling utility, named perf, is accessed from the command line and provides a number of subcommands; it is capable of statistical profiling of the entire system (both kernel and userland code).

It supports hardware performance counters, tracepoints, software performance counters (e.g. hrtimer), and dynamic probes (for example, kprobes or uprobes).[4] In 2012, two IBM engineers recognized perf (along with OProfile) as one of the two most commonly used performance counter profiling tools on Linux.[5]

Implementation

The interface between the perf utility and the kernel consists of only one syscall and is done via a file descriptor and a mapped memory region.[6] Unlike LTTng or older versions of oprofile, no service daemons are needed, as most functionality is integrated into the kernel. The perf utility dumps raw data from the mapped buffer to disk when the buffer becomes filled up. According to R. Vitillo (LBNL), profiling performed by perf involves a very low overhead.[6]

As of 2010, architectures that provide support for hardware counters include x86, PowerPC64, UltraSPARC (III and IV), ARM (v5, v6, v7, Cortex-A8 and -A9), Alpha EV56 and SuperH.[4] Usage of Last Branch Records,[7] a branch tracing implementation available in Intel CPUs since Pentium 4, is available as a patch.[6] Since version 3.14 of the Linux kernel mainline, released on March 31, 2014, perf also supports running average power limit (RAPL) for power consumption measurements, which is available as a feature of certain Intel CPUs.[8][9][10]

Perf is natively supported in many popular Linux distributions, including Red Hat Enterprise Linux (since its version 6 released in 2010)[11] and Debian in the linux-tools-common package (since Debian 6.0 (Squeeze) released in 2011).[12]

Subcommands

perf is used with several subcommands:

  • stat: measure total event count for single program or for system for some time
  • top: top-like dynamic view of hottest functions
  • record: measure and save sampling data for single program[13]
  • report: analyze file generated by perf record; can generate flat, or graph profile.[13]
  • annotate: annotate sources or assembly
  • sched: tracing/measuring of scheduler actions and latencies[14]
  • list: list available events

Criticism

The documentation of perf is not very detailed (as of 2014); for example, it does not document most events or explain their aliases (often external tools are used to get names and codes of events[15]).[16] Perf tools also cannot profile based on true wall-clock time.[16]

Security

The perf subsystem of Linux kernels from 2.6.37 up to 3.8.8 and RHEL6 kernel 2.6.32 contained a security vulnerability (CVE-2013-2094), which was exploited to gain root privileges by a local user.[17][18] The problem was due to an incorrect type being used (32-bit int instead of 64-bit) in the event_id verification code path.[19]

See also

References

  1. ^ Vince Weaver, The Unofficial Linux Perf Events Web-Page
  2. ^ Linux perf event Features and Overhead // 2013 FastPath Workshop, Vince Weaver
  3. ^ Jake Edge, Perfcounters added to the mainline, LWN July 1, 2009, "perfcounters being included into the mainline during the recently completed 2.6.31 merge window"
  4. ^ a b Arnaldo Carvalho de Melo, The New Linux ’perf’ tools, presentation from Linux Kongress, September, 2010
  5. ^ A. Zanella, R. Arnold. Evaluate performance for Linux on POWER. Analyze performance using Linux tools, 12 Jun 2012 // IBM DeveloperWorks Technical library
  6. ^ a b c Roberto A. Vitillo (LBNL). PERFORMANCE TOOLS DEVELOPMENTS, 16 June 2011, presentation from "Future computing in particle physics" conference
  7. ^ Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3B: System Programming Guide, Part 2. Intel. June 2009. p. 19-2 vol. 3.
  8. ^ Jake Edge (2014-04-09). "Lots of new perf features". LWN.net. Retrieved 2014-04-22.
  9. ^ Jacob Pan (2013-04-02). "RAPL (Running Average Power Limit) driver". LWN.net. Retrieved 2014-04-22.
  10. ^ "kernel/git/torvalds/linux.git - Linux kernel source tree". Git.kernel.org. 2014-01-20. Retrieved 2014-03-31.
  11. ^ 6.4. Performance Counters for Linux (PCL) Tools and perf // RHEL Developer Guide
  12. ^ "Debian - Details of package linux-tools-2.6.32 in squeeze". Packages.debian.org. Retrieved 2014-03-31.
  13. ^ a b Urs Fässler perf file format Archived 2012-12-14 at the Wayback Machine, CERN OpenLab, 2011
  14. ^ Ingo Molnar, 'perf sched': Utility to capture, measure and analyze scheduler latencies and behavior, 17 Sep 2009
  15. ^ How to monitor the full range of CPU performance events // Bojan Nikolic, 2012
  16. ^ a b Robert Haas (PostgreSQL), perf: the good, the bad, the ugly // June 06, 2012
  17. ^ Michael Larabel (2013-05-15). "New Linux Kernel Vulnerability Exploited". Phoronix.
  18. ^ corbet (2013-05-15). "Local root vulnerability in the kernel". LWN.
  19. ^ Joe Damato (2013-05-20). "A closer look at a recent privilege escalation bug in Linux (CVE-2013-2094)".

Read other articles:

Air warfare branch of Libya's armed forces For the air force of Libya's National Transitional Council, see Free Libyan Air Force. Libyan Air Forceالقوات الجوية الليبيةLibyan Air Force emblemActive1962; 61 years ago (1962)Country LibyaAllegianceGovernment of National UnityHouse of Representatives FormerlyGovernment of National AccordBranchLibyan Armed ForcesTypeAir forceRoleAerial warfareSize4,500 personnelHeadquartersTripoli (GNU-backed)Tobruk (HoR-ba...

Jorge Romão Informação geral Nome completo Jorge Eduardo Romão da Conceição Também conhecido(a) como Jorge Romão Nascimento 9 de outubro de 1963 (60 anos) Local de nascimento Luanda, Angola Nacionalidade angolano Gênero(s) Pós punk, new wave, rock alternativo, pop rock Ocupação(ões) Músico, DJ Instrumento(s) Baixo elétrico Extensão vocal Vocal de apoio Período em atividade 1983–presente Gravadora(s) IndieFada Afiliação(ões) Bananas, GNR Jorge Eduardo Romão da ...

فيصل الشعلان الشعلان يمين الصورة حاملا كاس ولي العهد مع حسين المكيمي ومحسن العنزي معلومات شخصية الاسم الكامل فيصل محمد عبد الله الشعلان الميلاد 1967 (العمر 55–56)مدينة الكويت الطول 1.85 م (6 قدم 1 بوصة) مركز اللعب حارس مرمى الجنسية كويتي مسيرة الشباب سنوات فريق 1982 - 1999 ن...

  Cortinariaceae Cortinarius archeri de TasmaniaTaxonomíaReino: FungiDivisión: BasidiomycotaClase: AgaricomycetesOrden: AgaricalesFamilia: CortinariaceaeR. Heim ex Pouzar (1983)Géneros 33 Según texto [editar datos en Wikidata] Cortinariaceae es una gran familia de hongos del orden Agaricales. Esta familia contiene 33 géneros y 2.100 especies, reconocidas científicamente. Muchos géneros que están aprobados en esta familia, se pueden encontrar además en las familias de h...

Nozomi KimuraDatos personalesNombre completo Nozomi Seijiro Kimura HerediaNacimiento Copiapó, Chile23 de enero de 1997 (26 años)Nacionalidad(es) ChilenaJapónesaAltura 1,78 m (5′ 10″)Carrera deportivaDeporte FútbolClub profesionalDebut deportivo 2014(Santiago Morning)Club Arturo Fernández VialLiga Segunda División ProfesionalPosición DefensaDorsal(es) 11Goles en clubes 3Entrenador Jonathan OrellanaTrayectoria Santiago Morning (2014-Act.) → O'Higgins (2017) → Cobreloa (...

Something New EP de TaeyeonPublicación 18 de junio de 2018Género(s) K-popFormato CD descarga digitalDiscográfica SM Entertainment Iriver IncProductor ejecutivo Lee Soo-man Cronología de Taeyeon This Christmas: Winter is Coming (2018) Something New (2018) Voice (2019) Sencillos de Something New «Something New»Publicado: 18 de junio de 2018 [editar datos en Wikidata] Something New es el cuarto EP de la cantante surcoreana Taeyeon. El álbum fue lanzado el 18 de junio de 2018 por...

Beauty pageant Miss France 2013Date8 December 2012 [1]PresentersJean-Pierre Foucault, Sylvie TellierVenueZénith de Limoges, Limoges, FranceBroadcasterTF1Entrants33Placements12DebutsSaint-MartinWithdrawalsSt-Pierre-et-MiquelonWinnerMarine Lorphelin[2] BurgundyCongenialityPauline Llorca NormandyPhotogenicEmmanuelle Fabre Languedoc← 20122014 → Miss France 2013 was the 83rd Miss France pageant, held in Limoges on 8 December 2012. Miss France 2012, Delphine W...

American TV series or program The LangoliersTitle card from the first episodeGenre Horror Mystery Science fiction Thriller Based onThe Langoliersby Stephen KingWritten byTom Holland (teleplay)Directed byTom HollandStarring Patricia Wettig Dean Stockwell David Morse Mark Lindsay Chapman Frankie Faison Baxter Harris Kimber Riddle Christopher Collet Kate Maberly Bronson Pinchot Music byVladimir HorunzhyCountry of originUnited StatesNo. of episodes2ProductionRunning time180 minutesProduction...

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (يوليو 2020) جوائز كانون ميديا 2014معلومات عامةالبلد نيوزيلندا تعديل - تعديل مصدري - تعديل ويكي بيانات استضافت جمعية ناشري الصحف النيوزيلندية جوائز كانون ميديا لعام 2014 يوم...

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada Oktober 2022. Nicole Nicki Becker (Buenos Aires)[1] adalah aktivis iklim dari Argentina dan salah satu pendiri dari Jóvenes por el Clima yang merupakan bagian dari gerakan Fridays for Future. Becker juga menjadi Youth champion untuk Perjanjian Escazú dan j...

Dieser Artikel behandelt das Konkordat als Staatskirchenvertrag. Für das Konkordat als Vertrag zwischen schweizerischen Kantonen siehe interkantonales Konkordat. Giuseppe Felici: Feierlicher Abschluss eines Staatskirchenvertrags (hier Konkordat mit Serbien, 1914) Ein Staatskirchenvertrag ist ein Vertrag zwischen einem Staat (Nationalstaat oder Gliedstaat) und einer Glaubensgemeinschaft. Staatskirchenverträge mit der römisch-katholischen Kirche, genauer mit dem Heiligen Stuhl, heißen Konko...

Neighborhood in San Francisco, California, United StatesOceanviewNeighborhoodOceanviewLocation within San FranciscoCoordinates: 37°42′52″N 122°27′24″W / 37.7144°N 122.4567°W / 37.7144; -122.4567Country United StatesState CaliforniaCity and countySan FranciscoGovernment • SupervisorAhsha Safai • AssemblymemberPhil Ting (D)[1] • State senatorScott Wiener (D)[1] • United States R...

العلاقات البوسنية السورية البوسنة والهرسك سوريا   البوسنة والهرسك   سوريا تعديل مصدري - تعديل   العلاقات البوسنية السورية هي العلاقات الثنائية التي تجمع بين البوسنة والهرسك وسوريا.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرجعية للدو...

Spring in Norse mythology In Norse mythology, Hvergelmir (Old Norse: [ˈxwerˌɡelmez̠]; bubbling boiling spring[1]) is a major spring. Hvergelmir is attested in the Poetic Edda, compiled in the 13th century from earlier traditional sources, and the Prose Edda, written in the 13th century by Snorri Sturluson. In the Poetic Edda, Hvergelmir is mentioned in a single stanza, which details that it is the location where liquid from the antlers of the stag Eikþyrnir flow, and that...

This article does not cite any sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: The Space Gypsy Adventures – news · newspapers · books · scholar · JSTOR (November 2016) (Learn how and when to remove this template message) Space Gypsy Website Header The Space Gypsy Adventures is a children's sci-fi comedy radio and internet series created by Cumbrian broadca...

International non-profit organisation International Vegetarian UnionAbbreviationIVUPredecessorVegetarian Federal UnionFormation1908; 115 years ago (1908)Founded atDresden, GermanyTypeNonprofitPurposePromotion of vegetarianismRegion WorldwideWebsiteivu.org The International Vegetarian Union (IVU) is an international non-profit organization whose purpose is to promote vegetarianism. The IVU was founded in 1908 in Dresden, Germany.[1][2] It is an umbrella organi...

Infantry regiment of the British Army 1st Foot Guards redirects here. For other uses, see 1st Foot Guards (disambiguation). For the regiment of the Canadian Army, see Canadian Grenadier Guards. For the racehorse, see Grenadier Guards (horse). Grenadier GuardsRegimental badge of the Grenadier Guards since 6 May 2023Active1656–presentCountry England(1660–1707) Great Britain(1707–1800) United Kingdom(1801–present)Branch British ArmyTypeInfantryRole1st Battalion – Light I...

Peta infrastruktur dan tata guna lahan di Komune Boissy-sous-Saint-Yon.  = Kawasan perkotaan  = Lahan subur  = Padang rumput  = Lahan pertanaman campuran  = Hutan  = Vegetasi perdu  = Lahan basah  = Anak sungaiBoissy-sous-Saint-YonNegaraPrancisArondisemenÉtampesKantonSaint-ChéronAntarkomuneCC de l'ArpajonnaisKode INSEE/pos91085 /  Boissy-sous-Saint-Yon merupakan sebuah kota dan komune di département Essonne, di region Île-de-France di Prancis. ...

American businessman This article is about the businessman. For the baseball player born in 1856, see Charlie Guth. For the baseball player born in 1947, see Bucky Guth. Charles Godfrey GuthPresident of Pepsi-ColaIn office1931-1939Preceded byRoy MegargelSucceeded byWalter Staunton Mack Jr. Personal detailsBornJune 3, 1877Philadelphia, PennsylvaniaDiedMay 24, 1948(1948-05-24) (aged 70)Baltimore, MarylandNationalityAmerican Charles Godfrey Guth (June 3, 1877 – May 24, 1948) ...

1976 studio album by Kenny RogersLove Lifted MeStudio album by Kenny RogersReleased1976Recorded1975 (1975)StudioJack Clement Recording Studio, Nashville, TennesseeLength33:18LabelUnited ArtistsProducerLarry ButlerKenny Rogers chronology Love Lifted Me(1976) Kenny Rogers(1976) Singles from Kenny Rogers Love Lifted MeReleased: 1975 While The Feeling's GoodReleased: 1976 Love Lifted Me is the first solo studio album by Kenny Rogers for United Artists Records, released in 1976. This ...