July 2010

Frederic Weisbecker がperf scripting入門を書いていたので転載

I have the feeling you've made an ad-hoc post processing script that seems
to rewrite all the format parsing, debugfs, stream handling, etc... we
have that in perf tools already.

May be you weren't aware of what we have in perf in terms of scripting support.

First, launch perf list and spot the events you're interested in, let's
say you're interested in irqs:

$ perf list
irq:irq_handler_entry [Tracepoint event]
irq:irq_handler_exit [Tracepoint event]
irq:softirq_entry [Tracepoint event]
irq:softirq_exit [Tracepoint event]

Now do a trace record:

# perf record -e irq:irq_handler_entry -e irq:irq_handler_exit -e irq:softirq_entry -e irq:softirq_exit cmd

or more simple:

# perf record -e irq:* cmd

You can use -a instead of cmd for wide tracing.

Now generate a perf parsing script on top of these traces:

# perf trace -g perl
generated Perl script: perf-trace.pl

Fill up the trace handlers inside perf-trace.pl and just run it:

# perf trace -s perf-trace.pl

Once ready, you can place your script in the script directory.


適当にとりたいトレースイベントを-e オプションで選んで、データ収集しろや。
データは perf.data ファイルに保存される。

# perf record -e 'irq:*'

-g オプションで選んだ -e を元に出力スクリプトのテンプレートが生成される

# perf trace -g perl


# perf trace event handlers, generated by perf trace -g perl
# Licensed under the terms of the GNU GPL License version 2

# The common_* event handler fields are the most useful fields common to
# all events. They don't necessarily correspond to the 'common_*' fields
# in the format files. Those fields not available as handler params can
# be retrieved using Perl functions of the form common_*($context).
# See Context.pm for the list of available functions.

use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib";
use lib "./Perf-Trace-Util/lib";
use Perf::Trace::Core;
use Perf::Trace::Context;
use Perf::Trace::Util;

sub trace_begin
# optional

sub trace_end
# optional

sub irq::softirq_exit
my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
$common_pid, $common_comm,
$vec) = @_;

print_header($event_name, $common_cpu, $common_secs, $common_nsecs,
$common_pid, $common_comm);

symbol_str("irq::softirq_exit", "vec", $vec));

sub irq::softirq_entry
my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
$common_pid, $common_comm,
$vec) = @_;

print_header($event_name, $common_cpu, $common_secs, $common_nsecs,
$common_pid, $common_comm);

symbol_str("irq::softirq_entry", "vec", $vec));

sub irq::irq_handler_exit
my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
$common_pid, $common_comm,
$irq, $ret) = @_;

print_header($event_name, $common_cpu, $common_secs, $common_nsecs,
$common_pid, $common_comm);

printf("irq=%d, ret=%d\n",
$irq, $ret);

sub irq::irq_handler_entry
my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
$common_pid, $common_comm,
$irq, $name) = @_;

print_header($event_name, $common_cpu, $common_secs, $common_nsecs,
$common_pid, $common_comm);

printf("irq=%d, name=%s\n",
$irq, $name);

sub trace_unhandled
my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs,
$common_pid, $common_comm) = @_;

print_header($event_name, $common_cpu, $common_secs, $common_nsecs,
$common_pid, $common_comm);

sub print_header
my ($event_name, $cpu, $secs, $nsecs, $pid, $comm) = @_;

printf("%-20s %5u %05u.%09u %8u %-20s ",
$event_name, $cpu, $secs, $nsecs, $pid, $comm);


それを trace -s すると、データを引数スクリプトで加工した出力が得られる

# perf trace -s perf-trace.pl


[root@kosaopt tmp]# perf trace -s perf-trace.pl
irq::softirq_entry 3 1232482.338391992 3046 ls vec=TIMER
irq::softirq_exit 3 1232482.338394889 3046 ls vec=TIMER
irq::softirq_entry 3 1232482.339389340 3046 ls vec=TIMER
irq::softirq_exit 3 1232482.339395908 3046 ls vec=TIMER
irq::softirq_entry 3 1232482.339397522 3046 ls vec=RCU
irq::softirq_exit 3 1232482.339400024 3046 ls vec=RCU



Fujitsu 6人
Hidetoshi Seto
Kenji Kaneshige
KOSAKI Motohiro
Li Zefan
Wei Yongjun

IBM 6人
Christof Schmitt
Heiko Carstens
Martin Schwidefsky
Mimi Zohar
Steve French
Swen Schillig

HP 3人
Alex Chiang
Bjorn Helgaas
Vlad Yasevich

NTT 2人
FUJITA Tomonori
Ryusuke Konishi

Hitachi 1人
Masami Hiramatsu

NEC, VA Linux, Micracle Linux 0人


Ted Tso先生からSummitの季節だよー。みんな旅行の準備してねー。というメールが飛んでいる

Date: Wed, 28 Jul 2010 22:17:29 -0400
To: linux-kernel@vger.kernel.org,
Subject: Kernel Summit 2010 reminder
From: "Theodore Ts'o"

Hi all,

I have updated the nominations list on http://ksummit2010.kernel.org
to reflect names that people have put forward. As a reminder, if there
are people that you think that the Kernel Summit 2010 program committee
should consider, please submit them to the program committee by this
Friday (two days from now!).

Also, if you are interested in participating in the discussion of topics
for the 2010 kernel summit, please subscribe yourself to the
ksummit-2010-discuss mailing list. Instructions for doing this can be
found at http://ksummit2010.kernel.org.

Many thanks.

- Ted

URLからNominated List みると以下の人がエントリされているっぽい

Abhijeet Kolekar abhijeet.kolekar at intel.com
Al Viro viro at zeniv.linux.org.uk
Alan Cox alan at linux.intel.com
Alan Stern stern at rowland.harvard.edu
Alasdair G Kergon agk at redhat.com
Alex Chiang achiang at hp.com
Alex Deucher alexdeucher at gmail.com
Alex Elder aelder at sgi.com
Alexander Beregalov a.beregalov at gmail.com
Alexander Duyck alexander.h.duyck at intel.com
Alexander Graf agraf at suse.de
Alexey Dobriyan adobriyan at gmail.com
Andi Kleen ak at linux.intel.com
Andrea Arcangeli aarcange at redhat.com
Andrew Vasquez andrew.vasquez at qlogic.com
Andy Adamson andros at netapp.com
Andy Walls awalls at radix.net
Anthony Ligouri anthony at codemonkey.ws
Anton Blanchard anton at samba.org
Anton Vorontsov avorontsov at ru.mvista.com
Arnaldo Carvalho de Melo acme at redhat.com
Arnd Bergmann arnd at arndb.de
Artem Bityutskiy Artem.Bityutskiy at nokia.com
Arve Hjønnevåg arve at android.com
Avi Kivity avi at redhat.com
Bartlomiej Zolnierkiewicz bzolnier at gmail.com
Ben Dooks ben-linux at fluff.org
Ben Hutchings bhutchings at solarflare.com
Ben Skeggs bskeggs at redhat.com
Benjamin Herrenschmidt benh at kernel.crashing.org
Benjamin Li benli at broadcom.com
Benny Halevy bhalevy at panasas.com
Bill Pemberton wfp5p at virginia.edu
Bjorn Helgaas bjorn.helgaas at hp.com
Boaz Harrosh bharrosh at panasas.com
Bob Copeland me at bobcopeland.com
Bob Moore robert.moore at intel.com
Borislav Petkov borislav.petkov at amd.com
Brian Swetland swetland at google.com
Bruce Allan bruce.w.allan at intel.com
Bryan Wu cooloney at kernel.org
Cai Qian caiqian at redhat.com
Catalin Marinas catalin.marinas at arm.com
Chris Wilson chris at chris-wilson.co.uk
Christian Lamparter chunkeey at web.de
Christof Schmitt christof.schmitt at de.ibm.com
Christoph Hellwig hch at lst.de
Christoph Lameter cl at linux-foundation.org
Chuck Lever chuck.lever at oracle.com
Clemens Ladisch clemens at ladisch.de
Corentin Chary corentincj at iksaif.net
Cyrill Gorcunov gorcunov at openvz.org
Dan Carpenter error27 at gmail.com
Dan Magenheimer dan.magenheimer at oracle.com
Dan Williams dan.j.williams at intel.com
Daniel Mack daniel at caiaq.de
Dario Faggioli raistlin at linux.it
Dave Airlie airlied at redhat.com
Dave Chinner david at fromorbit.com
David Brownell dbrownell at users.sourceforge.net
David Daney ddaney at caviumnetworks.com
David Howells dhowells at redhat.com
David Rientjes rientjes at google.com
David S. Miller davem at davemloft.net
David Woodhouse David.Woodhouse at intel.com
Devin Heitmueller dheitmueller at kernellabs.com
Dhananjay Phadke dhananjay at netxen.com
Dmitry Torokhov dtor at mail.ru
Dominik Brodowski linux at dominikbrodowski.net
Douglas Schilling Landgraf dougsland at redhat.com
Eilon Greenstein eilong at broadcom.com
Eric Anholt eric at anholt.net
Eric Dumazet eric.dumazet at gmail.com
Eric Miao eric.y.miao at gmail.com
Eric Paris eparis at redhat.com
Eric Van Hensbergen ericvh at gmail.com
Eric W. Biederman ebiederm at xmission.com
Felipe Balbi felipe.balbi at nokia.com
Felix Blyakher felixb at sgi.com
Felix Fietkau nbd at openwrt.org
Florian Fainelli florian at openwrt.org
Frederic Weisbecker fweisbec at gmail.com
FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Geert Uytterhoeven geert at linux-m68k.org
Gertjan van Wingerde gwingerde at gmail.com
Gleb Natapov gleb at redhat.com
Grant Likely grant.likely at secretlab.ca
Greg Ungerer gerg at uclinux.org
Guennadi Liakhovetski g.liakhovetski at gmx.de
H Hartley Sweeten hsweeten at visionengravers.com
H. Peter Anvin hpa at zytor.com
Hans de Goede hdegoede at redhat.com
Hans Verkuil hverkuil at xs4all.nl
Haojian Zhuang haojian.zhuang at marvell.com
Heiko Carstens heiko.carstens at de.ibm.com
Henrique de Moraes Holschuh hmh at hmh.eng.br
Herbert Xu herbert at gondor.apana.org.au
Hidetoshi Seto seto.hidetoshi at jp.fujitsu.com
Huang Weiyi weiyi.huang at gmail.com
Hugh Dickins hugh.dickins at tiscali.co.uk
Inaky Perez-Gonzalez inaky at linux.intel.com
Ingo Molnar mingo at elte.hu
Ivo van Doorn IvDoorn at gmail.com
J. Bruce Fields bfields at citi.umich.edu
Jack Steiner steiner at sgi.com
James Morris jmorris at namei.org
Jan Engelhardt jengelh at medozas.de
Jan Kara jack at suse.cz
Jan Kiszka jan.kiszka at siemens.com
Jarod Wilson jarod at wilsonet.com
Jason Wessel jason.wessel at windriver.com
Jaswinder Singh Rajput jaswinderrajput at gmail.com
Jean Delvare khali at linux-fr.org
Jean-Francois Moine moinejf at free.fr
Jeff Garzik jgarzik at redhat.com
Jeff Kirsher jeffrey.t.kirsher at intel.com
Jeff Layton jlayton at redhat.com
Jens Axboe jens.axboe at oracle.com
Jeremy Fitzhardinge jeremy.fitzhardinge at citrix.com
Jerome Glisse jglisse at redhat.com
Jesse Barnes jbarnes at virtuousgeek.org
Jiri Kosina jkosina at suse.cz
Jiri Pirko jpirko at redhat.com
Jiri Slaby jirislaby at gmail.com
Joe Eykholt jeykholt at cisco.com
Joe Perches joe at perches.com
Joel Becker joel.becker at oracle.com
Joerg Roedel joerg.roedel at amd.com
Johan Hovold jhovold at gmail.com
Johannes Berg johannes at sipsolutions.net
John W. Linville linville at tuxdriver.com
Josef Bacik josef at redhat.com
Jouni Malinen j at w1.fi
Julia Lawall julia at diku.dk
Juuso Oikarinen juuso.oikarinen at nokia.com
Kalle Valo kalle.valo at nokia.com
KAMEZAWA Hiroyuki kamezawa.hiroyu at jp.fujitsu.com
Kashyap Desai kashyap.desai at lsi.com
Kay Sievers kay.sievers at vrfy.org
Kees Cook kees.cook at canonical.com
Kenji Kaneshige kaneshige.kenji at jp.fujitsu.com
Kevin Hilman khilman at deeprootsystems.com
KOSAKI Motohiro kosaki.motohiro at jp.fujitsu.com
Krzysztof Helt krzysztof.h1 at wp.pl
Kumar Gala galak at kernel.crashing.org
Kuninori Morimoto morimoto.kuninori at renesas.com
Kyle McMartin kyle at mcmartin.ca
Len Brown len.brown at intel.com
Lennart Poettering mzerqung at 0pointer.de
Lennert Buytenhek buytenh at marvell.com
Li Zefan lizf at cn.fujitsu.com
Liam Girdwood lrg at slimlogic.co.uk
Lin Ming ming.m.lin at intel.com
Linus Torvalds torvalds at linux-foundation.org
Linus Walleij linus.walleij at stericsson.com
Luciano Coelho luciano.coelho at nokia.com
Luis R. Rodriguez lrodriguez at atheros.com
Magnus Damm damm at opensource.se
Magnus Damm magnus.damm at gmail.com
Manu Abraham manu at linuxtv.org
Marcel Holtmann marcel at holtmann.org
Marcelo Tosatti mtosatti at redhat.com
Mark Brown broonie at opensource.wolfsonmicro.com
Martin Schwidefsky schwidefsky at de.ibm.com
Masami Hiramatsu mhiramat at redhat.com
Matt Carlson mcarlson at broadcom.com
Matt Fleming matt at console-pimps.org
Matthew Garrett mjg at redhat.com
Mauro Carvalho Chehab mchehab at redhat.com
Mel Gorman mel at csn.ul.ie
Michael Buesch mb at bu3sch.de
Michael Chan mchan at broadcom.com
Michael Hennerich michael.hennerich at analog.com
Michal Marek mmarek at suse.cz
Michal Simek monstr at monstr.eu
Mike Christie michaelc at cs.wisc.edu
Mike Frysinger vapier at gentoo.org
Mike Isely isely at pobox.com
Mike Rapoport mike at compulab.co.il
Mikulas Patocka mpatocka at redhat.com
Mimi Zohar zohar at linux.vnet.ibm.com
Minchan Kim minchan.kim at gmail.com
Neil Brown neilb at suse.de
Nick Piggin npiggin at suse.de
Nicolas Pitre nico at marvell.com
Oleg Nesterov oleg at redhat.com
Patrick McHardy kaber at trash.net
Paul Mackerras paulus at samba.org
Paul Mundt lethal at linux-sh.org
Paul Walmsley paul at pwsan.com
Pavel Machek pavel at ucw.cz
Pekka Enberg penberg at cs.helsinki.fi
Peter P Waskiewicz Jr peter.p.waskiewicz.jr at intel.com
Peter Ujfalusi peter.ujfalusi at nokia.com
Peter Zijlstra peterz at infradead.org
Philipp Reisner philipp.reisner at linbit.com
Rafael J. Wysocki rjw at sisk.pl
Rafał Miłecki zajec5 at gmail.com
Ralf Baechle ralf at linux-mips.org
Randy Dunlap randy.dunlap at oracle.com
Reinette Chatre reinette.chatre at intel.com
Richard Purdie rpurdie at linux.intel.com
Rik van Riel riel at redhat.com
Robert Love robert.w.love at intel.com
Robert Richter robert.richter at amd.com
Roel Kluin roel.kluin at gmail.com
Roland Dreier rolandd at cisco.com
Roland McGrath roland at redhat.com
Ron Mercer ron.mercer at qlogic.com
Ron Minnich rminnich at sandia.gov
Russell King rmk+kernel at arm.linux.org.uk
Rusty Russell rusty at rustcorp.com.au
Ryusuke Konishi konishi.ryusuke at lab.ntt.co.jp
Sage Weil sage at newdream.net
Sam Ravnborg sam at ravnborg.org
Samuel Ortiz sameo at linux.intel.com
Sarah Sharp sarah.a.sharp at linux.intel.com
Sascha Hauer s.hauer at pengutronix.de
Serge Hallyn serge.hallyn at canonical.com
Sergei Shtylyov sshtylyov at ru.mvista.com
Srinidhi Kasagar srinidhi.kasagar at stericsson.com
Stefan Richter stefanr at s5r6.in-berlin.de
Stefani Seibold stefani at seibold.net
Stephen Hemminger shemminger at vyatta.com
Stephen Rothwell sfr at canb.auug.org.au
Steve French sfrench at us.ibm.com
Steven Whitehouse swhiteho at redhat.com
Sujith Manoharan Sujith.Manoharan at atheros.com
Suresh Siddha suresh.b.siddha at intel.com
Swen Schillig swen at vnet.ibm.com
Takashi Iwai tiwai at suse.de
Tao Ma tao.ma at oracle.com
Tejun Heo tj at kernel.org
Thomas Gleixner tglx at linutronix.de
Tom Herbert therbert at google.com
Tomi Valkeinen tomi.valkeinen at nokia.com
Tony Lindgren tony at atomide.com
Tony Luck tony.luck at intel.com
Trond Myklebust Trond.Myklebust at netapp.com
Uwe Kleine-König u.kleine-koenig at pengutronix.de
Vasanthakumar Thiagarajan vasanth at atheros.com
Vlad Yasevich vladislav.yasevich at hp.com
Wei Yongjun yjwei at cn.fujitsu.com
Wey-Yi Guy wey-yi.w.guy at intel.com
Wim Van Sebroeck wim at iguana.be
Wolfram Sang w.sang at pengutronix.de
Wu Fengguang fengguang.wu at intel.com
Wu Zhangjin wuzhangjin at gmail.com
Yinghai Lu yinghai at kernel.org
Zhao Yakui yakui.zhao at intel.com
Zhenyu Wang zhenyuw at linux.intel.com
Zhu Yi yi.zhu at intel.com


FUJITA Tomonori (ntt)
Hidetoshi Seto (fujitsu)
KAMEZAWA Hiroyuki (fujitsu)
Kenji Kaneshige (fujitsu)
KOSAKI Motohiro (fujitsu)
Kuninori Morimoto(renesas)
Masami Hiramatsu (hitachi)
Ryusuke Konishi (ntt)
Takashi Iwai (suse)

Miracleとか VA Linuxとか NECが一人もいない気がするけどあってるのだろうか。


Ying Han <yinghan@google.com>
Greg Thelen <gthelen@google.com>
Larry Woodman <lwoodman@redhat.com>
Michel Lespinasse <walken@google.com>
Pekka Enberg <penberg@cs.helsinki.fi>
Christoph Lameter <cl@linux-foundation.org>
Matt Mackall <mpm@selenic.com>
Mel Gorman <mel@csn.ul.ie>
Peter Zijlstra <peterz@infradead.org>
Johannes Weiner <hannes@cmpxchg.org>
Wu Fengguang <fengguang.wu@intel.com>
Dan Magenheimer <dan.magenheimer@oracle.com>
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Hugh Dickins <hughd@google.com>
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Andrea Arcangeli <aarcange@redhat.com>
Rik van Riel <riel@redhat.com>
Nick Piggin <npiggin@suse.de>
Lee Schermerhorn <Lee.Schermerhorn@hp.com>




serial --unit=0 --speed=115200
terminal --timeout=10 serial console
default saved

title Fedora (
root (hd0,0)
kernel /boot/vmlinuz- ro root=UUID=c70ceb36-eeea-48ee-9cd9-71d5a983ab40 LANG=ja_JP.UTF-8 KEYBOARDTYPE=pc KEYTABLE=jp106 norhgb noquiet console=tty0 console=ttyS0,115200
initrd /boot/initramfs-


つぎ、Ubuntu 10.04


# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.


GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="noquiet nosplash console=tty0 console=ttyS0,115200"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux

# Uncomment to disable generation of recovery mode menu entries

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

# ttyS0 - getty
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

exec /sbin/getty -L 115200 ttyS0 vt102


# virsh start --console


なんで st_btime ごときでそんなに揉める余地があるんだ。と思ってスレッド読んでみた


一人は、どうせctimeなんか誰もつかってないんだからctimeをcreation timeに変えちゃえば

もうひとりは、よせばいいのにWindows creation timeの邪悪な仕様(e.g. 生成時刻の
Andrew Tridgell (samba projectの人で、git開発の遠因をつくったお方)

File System Tunneling → http://support.microsoft.com/kb/172190



とりあえず、sysprof tracerとksym tracer 消えた。あぼーん