mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 09:31:50 +00:00
acac03fa15
Sometimes there is a need to use perf in "live-log" mode. The problem is, for seldom events, actual info output is largely delayed because perf-record reads sample data in whole pages. So for such scenarious, add flag for perf-record to go in "nodelay" mode. To track e.g. what's going on in icmp_rcv while ping is running Use it with something like this: (1) $ perf probe -L icmp_rcv | grep -U8 '^ *43\>' goto error; } 38 if (!pskb_pull(skb, sizeof(*icmph))) goto error; icmph = icmp_hdr(skb); 43 ICMPMSGIN_INC_STATS_BH(net, icmph->type); /* * 18 is the highest 'known' ICMP type. Anything else is a mystery * * RFC 1122: 3.2.2 Unknown ICMP messages types MUST be silently * discarded. */ 50 if (icmph->type > NR_ICMP_TYPES) goto error; $ perf probe icmp_rcv:43 'type=icmph->type' (2) $ cat trace-icmp.py [...] def trace_begin(): print "in trace_begin" def trace_end(): print "in trace_end" def probe__icmp_rcv(event_name, context, common_cpu, common_secs, common_nsecs, common_pid, common_comm, __probe_ip, type): print_header(event_name, common_cpu, common_secs, common_nsecs, common_pid, common_comm) print "__probe_ip=%u, type=%u\n" % \ (__probe_ip, type), [...] (3) $ perf record -a -D -e probe:icmp_rcv -o - | \ perf script -i - -s trace-icmp.py Thanks to Peter Zijlstra for pointing how to do it. Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu>, Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <20110112140613.GA11698@tugrik.mns.mnsspb.ru> Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> |
||
---|---|---|
.. | ||
asciidoc.conf | ||
examples.txt | ||
Makefile | ||
manpage-1.72.xsl | ||
manpage-base.xsl | ||
manpage-bold-literal.xsl | ||
manpage-normal.xsl | ||
manpage-suppress-sp.xsl | ||
perf-annotate.txt | ||
perf-archive.txt | ||
perf-bench.txt | ||
perf-buildid-cache.txt | ||
perf-buildid-list.txt | ||
perf-diff.txt | ||
perf-help.txt | ||
perf-inject.txt | ||
perf-kmem.txt | ||
perf-kvm.txt | ||
perf-list.txt | ||
perf-lock.txt | ||
perf-probe.txt | ||
perf-record.txt | ||
perf-report.txt | ||
perf-sched.txt | ||
perf-script-perl.txt | ||
perf-script-python.txt | ||
perf-script.txt | ||
perf-stat.txt | ||
perf-test.txt | ||
perf-timechart.txt | ||
perf-top.txt | ||
perf.txt |