diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-19 20:49:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-19 20:49:41 -0500 |
commit | 8f55cea410dbc56114bb71a3742032070c8108d0 (patch) | |
tree | 59605f0ee961274b22f91add33f5c32459471a83 /samples | |
parent | b7133a9a103655cda254987a3c0975fd9d8c443f (diff) | |
parent | e259514eef764a5286873618e34c560ecb6cff13 (diff) |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf changes from Ingo Molnar:
"There are lots of improvements, the biggest changes are:
Main kernel side changes:
- Improve uprobes performance by adding 'pre-filtering' support, by
Oleg Nesterov.
- Make some POWER7 events available in sysfs, equivalent to what was
done on x86, from Sukadev Bhattiprolu.
- tracing updates by Steve Rostedt - mostly misc fixes and smaller
improvements.
- Use perf/event tracing to report PCI Express advanced errors, by
Tony Luck.
- Enable northbridge performance counters on AMD family 15h, by Jacob
Shin.
- This tracing commit:
tracing: Remove the extra 4 bytes of padding in events
changes the ABI. All involved parties (PowerTop in particular)
seem to agree that it's safe to do now with the introduction of
libtraceevent, but the devil is in the details ...
Main tooling side changes:
- Add 'event group view', from Namyung Kim:
To use it, 'perf record' should group events when recording. And
then perf report parses the saved group relation from file header
and prints them together if --group option is provided. You can
use the 'perf evlist' command to see event group information:
$ perf record -e '{ref-cycles,cycles}' noploop 1
[ perf record: Woken up 2 times to write data ]
[ perf record: Captured and wrote 0.385 MB perf.data (~16807 samples) ]
$ perf evlist --group
{ref-cycles,cycles}
With this example, default perf report will show you each event
separately.
You can use --group option to enable event group view:
$ perf report --group
...
# group: {ref-cycles,cycles}
# ========
# Samples: 7K of event 'anon group { ref-cycles, cycles }'
# Event count (approx.): 6876107743
#
# Overhead Command Shared Object Symbol
# ................ ....... ................. ..........................
99.84% 99.76% noploop noploop [.] main
0.07% 0.00% noploop ld-2.15.so [.] strcmp
0.03% 0.00% noploop [kernel.kallsyms] [k] timerqueue_del
0.03% 0.03% noploop [kernel.kallsyms] [k] sched_clock_cpu
0.02% 0.00% noploop [kernel.kallsyms] [k] account_user_time
0.01% 0.00% noploop [kernel.kallsyms] [k] __alloc_pages_nodemask
0.00% 0.00% noploop [kernel.kallsyms] [k] native_write_msr_safe
0.00% 0.11% noploop [kernel.kallsyms] [k] _raw_spin_lock
0.00% 0.06% noploop [kernel.kallsyms] [k] find_get_page
0.00% 0.02% noploop [kernel.kallsyms] [k] rcu_check_callbacks
0.00% 0.02% noploop [kernel.kallsyms] [k] __current_kernel_time
As you can see the Overhead column now contains both of ref-cycles
and cycles and header line shows group information also - 'anon
group { ref-cycles, cycles }'. The output is sorted by period of
group leader first.
- Initial GTK+ annotate browser, from Namhyung Kim.
- Add option for runtime switching perf data file in perf report,
just press 's' and a menu with the valid files found in the current
directory will be presented, from Feng Tang.
- Add support to display whole group data for raw columns, from Jiri
Olsa.
- Add per processor socket count aggregation in perf stat, from
Stephane Eranian.
- Add interval printing in 'perf stat', from Stephane Eranian.
- 'perf test' improvements
- Add support for wildcards in tracepoint system name, from Jiri
Olsa.
- Add anonymous huge page recognition, from Joshua Zhu.
- perf build-id cache now can show DSOs present in a perf.data file
that are not in the cache, to integrate with build-id servers being
put in place by organizations such as Fedora.
- perf top now shares more of the evsel config/creation routines with
'record', paving the way for further integration like 'top'
snapshots, etc.
- perf top now supports DWARF callchains.
- Fix mmap limitations on 32-bit, fix from David Miller.
- 'perf bench numa mem' NUMA performance measurement suite
- ... and lots of fixes, performance improvements, cleanups and other
improvements I failed to list - see the shortlog and git log for
details."
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (270 commits)
perf/x86/amd: Enable northbridge performance counters on AMD family 15h
perf/hwbp: Fix cleanup in case of kzalloc failure
perf tools: Fix build with bison 2.3 and older.
perf tools: Limit unwind support to x86 archs
perf annotate: Make it to be able to skip unannotatable symbols
perf gtk/annotate: Fail early if it can't annotate
perf gtk/annotate: Show source lines with gray color
perf gtk/annotate: Support multiple event annotation
perf ui/gtk: Implement basic GTK2 annotation browser
perf annotate: Fix warning message on a missing vmlinux
perf buildid-cache: Add --update option
uprobes/perf: Avoid uprobe_apply() whenever possible
uprobes/perf: Teach trace_uprobe/perf code to use UPROBE_HANDLER_REMOVE
uprobes/perf: Teach trace_uprobe/perf code to pre-filter
uprobes/perf: Teach trace_uprobe/perf code to track the active perf_event's
uprobes: Introduce uprobe_apply()
perf: Introduce hw_perf_event->tp_target and ->tp_list
uprobes/perf: Always increment trace_uprobe->nhit
uprobes/tracing: Kill uprobe_trace_consumer, embed uprobe_consumer into trace_uprobe
uprobes/tracing: Introduce is_trace_uprobe_enabled()
...
Diffstat (limited to 'samples')
-rw-r--r-- | samples/Kconfig | 6 | ||||
-rw-r--r-- | samples/Makefile | 2 | ||||
-rw-r--r-- | samples/tracepoints/Makefile | 6 | ||||
-rw-r--r-- | samples/tracepoints/tp-samples-trace.h | 11 | ||||
-rw-r--r-- | samples/tracepoints/tracepoint-probe-sample.c | 57 | ||||
-rw-r--r-- | samples/tracepoints/tracepoint-probe-sample2.c | 44 | ||||
-rw-r--r-- | samples/tracepoints/tracepoint-sample.c | 57 |
7 files changed, 1 insertions, 182 deletions
diff --git a/samples/Kconfig b/samples/Kconfig index 7b6792a18c05..6181c2cc9ca0 100644 --- a/samples/Kconfig +++ b/samples/Kconfig | |||
@@ -5,12 +5,6 @@ menuconfig SAMPLES | |||
5 | 5 | ||
6 | if SAMPLES | 6 | if SAMPLES |
7 | 7 | ||
8 | config SAMPLE_TRACEPOINTS | ||
9 | tristate "Build tracepoints examples -- loadable modules only" | ||
10 | depends on TRACEPOINTS && m | ||
11 | help | ||
12 | This build tracepoints example modules. | ||
13 | |||
14 | config SAMPLE_TRACE_EVENTS | 8 | config SAMPLE_TRACE_EVENTS |
15 | tristate "Build trace_events examples -- loadable modules only" | 9 | tristate "Build trace_events examples -- loadable modules only" |
16 | depends on EVENT_TRACING && m | 10 | depends on EVENT_TRACING && m |
diff --git a/samples/Makefile b/samples/Makefile index 5ef08bba96ce..1a60c62e2045 100644 --- a/samples/Makefile +++ b/samples/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # Makefile for Linux samples code | 1 | # Makefile for Linux samples code |
2 | 2 | ||
3 | obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ tracepoints/ trace_events/ \ | 3 | obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ \ |
4 | hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ | 4 | hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ |
diff --git a/samples/tracepoints/Makefile b/samples/tracepoints/Makefile deleted file mode 100644 index 36479ad9ae14..000000000000 --- a/samples/tracepoints/Makefile +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | # builds the tracepoint example kernel modules; | ||
2 | # then to use one (as root): insmod <module_name.ko> | ||
3 | |||
4 | obj-$(CONFIG_SAMPLE_TRACEPOINTS) += tracepoint-sample.o | ||
5 | obj-$(CONFIG_SAMPLE_TRACEPOINTS) += tracepoint-probe-sample.o | ||
6 | obj-$(CONFIG_SAMPLE_TRACEPOINTS) += tracepoint-probe-sample2.o | ||
diff --git a/samples/tracepoints/tp-samples-trace.h b/samples/tracepoints/tp-samples-trace.h deleted file mode 100644 index 4d46be965961..000000000000 --- a/samples/tracepoints/tp-samples-trace.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef _TP_SAMPLES_TRACE_H | ||
2 | #define _TP_SAMPLES_TRACE_H | ||
3 | |||
4 | #include <linux/proc_fs.h> /* for struct inode and struct file */ | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | DECLARE_TRACE(subsys_event, | ||
8 | TP_PROTO(struct inode *inode, struct file *file), | ||
9 | TP_ARGS(inode, file)); | ||
10 | DECLARE_TRACE_NOARGS(subsys_eventb); | ||
11 | #endif | ||
diff --git a/samples/tracepoints/tracepoint-probe-sample.c b/samples/tracepoints/tracepoint-probe-sample.c deleted file mode 100644 index 744c0b9652a7..000000000000 --- a/samples/tracepoints/tracepoint-probe-sample.c +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | /* | ||
2 | * tracepoint-probe-sample.c | ||
3 | * | ||
4 | * sample tracepoint probes. | ||
5 | */ | ||
6 | |||
7 | #include <linux/module.h> | ||
8 | #include <linux/file.h> | ||
9 | #include <linux/dcache.h> | ||
10 | #include "tp-samples-trace.h" | ||
11 | |||
12 | /* | ||
13 | * Here the caller only guarantees locking for struct file and struct inode. | ||
14 | * Locking must therefore be done in the probe to use the dentry. | ||
15 | */ | ||
16 | static void probe_subsys_event(void *ignore, | ||
17 | struct inode *inode, struct file *file) | ||
18 | { | ||
19 | path_get(&file->f_path); | ||
20 | dget(file->f_path.dentry); | ||
21 | printk(KERN_INFO "Event is encountered with filename %s\n", | ||
22 | file->f_path.dentry->d_name.name); | ||
23 | dput(file->f_path.dentry); | ||
24 | path_put(&file->f_path); | ||
25 | } | ||
26 | |||
27 | static void probe_subsys_eventb(void *ignore) | ||
28 | { | ||
29 | printk(KERN_INFO "Event B is encountered\n"); | ||
30 | } | ||
31 | |||
32 | static int __init tp_sample_trace_init(void) | ||
33 | { | ||
34 | int ret; | ||
35 | |||
36 | ret = register_trace_subsys_event(probe_subsys_event, NULL); | ||
37 | WARN_ON(ret); | ||
38 | ret = register_trace_subsys_eventb(probe_subsys_eventb, NULL); | ||
39 | WARN_ON(ret); | ||
40 | |||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | module_init(tp_sample_trace_init); | ||
45 | |||
46 | static void __exit tp_sample_trace_exit(void) | ||
47 | { | ||
48 | unregister_trace_subsys_eventb(probe_subsys_eventb, NULL); | ||
49 | unregister_trace_subsys_event(probe_subsys_event, NULL); | ||
50 | tracepoint_synchronize_unregister(); | ||
51 | } | ||
52 | |||
53 | module_exit(tp_sample_trace_exit); | ||
54 | |||
55 | MODULE_LICENSE("GPL"); | ||
56 | MODULE_AUTHOR("Mathieu Desnoyers"); | ||
57 | MODULE_DESCRIPTION("Tracepoint Probes Samples"); | ||
diff --git a/samples/tracepoints/tracepoint-probe-sample2.c b/samples/tracepoints/tracepoint-probe-sample2.c deleted file mode 100644 index 9fcf990e5d4b..000000000000 --- a/samples/tracepoints/tracepoint-probe-sample2.c +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* | ||
2 | * tracepoint-probe-sample2.c | ||
3 | * | ||
4 | * 2nd sample tracepoint probes. | ||
5 | */ | ||
6 | |||
7 | #include <linux/module.h> | ||
8 | #include <linux/fs.h> | ||
9 | #include "tp-samples-trace.h" | ||
10 | |||
11 | /* | ||
12 | * Here the caller only guarantees locking for struct file and struct inode. | ||
13 | * Locking must therefore be done in the probe to use the dentry. | ||
14 | */ | ||
15 | static void probe_subsys_event(void *ignore, | ||
16 | struct inode *inode, struct file *file) | ||
17 | { | ||
18 | printk(KERN_INFO "Event is encountered with inode number %lu\n", | ||
19 | inode->i_ino); | ||
20 | } | ||
21 | |||
22 | static int __init tp_sample_trace_init(void) | ||
23 | { | ||
24 | int ret; | ||
25 | |||
26 | ret = register_trace_subsys_event(probe_subsys_event, NULL); | ||
27 | WARN_ON(ret); | ||
28 | |||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | module_init(tp_sample_trace_init); | ||
33 | |||
34 | static void __exit tp_sample_trace_exit(void) | ||
35 | { | ||
36 | unregister_trace_subsys_event(probe_subsys_event, NULL); | ||
37 | tracepoint_synchronize_unregister(); | ||
38 | } | ||
39 | |||
40 | module_exit(tp_sample_trace_exit); | ||
41 | |||
42 | MODULE_LICENSE("GPL"); | ||
43 | MODULE_AUTHOR("Mathieu Desnoyers"); | ||
44 | MODULE_DESCRIPTION("Tracepoint Probes Samples"); | ||
diff --git a/samples/tracepoints/tracepoint-sample.c b/samples/tracepoints/tracepoint-sample.c deleted file mode 100644 index f4d89e008c32..000000000000 --- a/samples/tracepoints/tracepoint-sample.c +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | /* tracepoint-sample.c | ||
2 | * | ||
3 | * Executes a tracepoint when /proc/tracepoint-sample is opened. | ||
4 | * | ||
5 | * (C) Copyright 2007 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | ||
6 | * | ||
7 | * This file is released under the GPLv2. | ||
8 | * See the file COPYING for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | #include <linux/sched.h> | ||
13 | #include <linux/proc_fs.h> | ||
14 | #include "tp-samples-trace.h" | ||
15 | |||
16 | DEFINE_TRACE(subsys_event); | ||
17 | DEFINE_TRACE(subsys_eventb); | ||
18 | |||
19 | struct proc_dir_entry *pentry_sample; | ||
20 | |||
21 | static int my_open(struct inode *inode, struct file *file) | ||
22 | { | ||
23 | int i; | ||
24 | |||
25 | trace_subsys_event(inode, file); | ||
26 | for (i = 0; i < 10; i++) | ||
27 | trace_subsys_eventb(); | ||
28 | return -EPERM; | ||
29 | } | ||
30 | |||
31 | static const struct file_operations mark_ops = { | ||
32 | .open = my_open, | ||
33 | .llseek = noop_llseek, | ||
34 | }; | ||
35 | |||
36 | static int __init sample_init(void) | ||
37 | { | ||
38 | printk(KERN_ALERT "sample init\n"); | ||
39 | pentry_sample = proc_create("tracepoint-sample", 0444, NULL, | ||
40 | &mark_ops); | ||
41 | if (!pentry_sample) | ||
42 | return -EPERM; | ||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | static void __exit sample_exit(void) | ||
47 | { | ||
48 | printk(KERN_ALERT "sample exit\n"); | ||
49 | remove_proc_entry("tracepoint-sample", NULL); | ||
50 | } | ||
51 | |||
52 | module_init(sample_init) | ||
53 | module_exit(sample_exit) | ||
54 | |||
55 | MODULE_LICENSE("GPL"); | ||
56 | MODULE_AUTHOR("Mathieu Desnoyers"); | ||
57 | MODULE_DESCRIPTION("Tracepoint sample"); | ||