aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 21:14:31 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 21:14:31 -0500
commit090f8ccba37034cec5a5972a70abeaae7eb0222b (patch)
tree0b7cf8a4bb94601816399acfb336835fbf309a2a /include/trace
parentaefb058b0c27dafb15072406fbfd92d2ac2c8790 (diff)
parentcc1b39dbf9f55a438e8a21a694394c20e6a17129 (diff)
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar: "Lots of activity: 211 files changed, 8328 insertions(+), 4116 deletions(-) most of it on the tooling side. Main changes: * ftrace enhancements and fixes from Steve Rostedt. * uprobes fixes, cleanups and preparation for the ARM port from Oleg Nesterov. * UAPI fixes, from David Howels - prepares the arch/x86 UAPI transition * Separate perf tests into multiple objects, one per test, from Jiri Olsa. * Make hardware event translations available in sysfs, from Jiri Olsa. * Fixes to /proc/pid/maps parsing, preparatory to supporting data maps, from Namhyung Kim * Implement ui_progress for GTK, from Namhyung Kim * Add framework for automated perf_event_attr tests, where tools with different command line options will be run from a 'perf test', via python glue, and the perf syscall will be intercepted to verify that the perf_event_attr fields set by the tool are those expected, from Jiri Olsa * Add a 'link' method for hists, so that we can have the leader with buckets for all the entries in all the hists. This new method is now used in the default 'diff' output, making the sum of the 'baseline' column be 100%, eliminating blind spots. * libtraceevent fixes for compiler warnings trying to make perf it build on some distros, like fedora 14, 32-bit, some of the warnings really pointed to real bugs. * Add a browser for 'perf script' and make it available from the report and annotate browsers. It does filtering to find the scripts that handle events found in the perf.data file used. From Feng Tang * perf inject changes to allow showing where a task sleeps, from Andrew Vagin. * Makefile improvements from Namhyung Kim. * Add --pre and --post command hooks in 'stat', from Peter Zijlstra. * Don't stop synthesizing threads when one vanishes, this is for the existing threads when we start a tool like trace. * Use sched:sched_stat_runtime to provide a thread summary, this produces the same output as the 'trace summary' subcommand of tglx's original "trace" tool. * Support interrupted syscalls in 'trace' * Add an event duration column and filter in 'trace'. * There are references to the man pages in some tools, so try to build Documentation when installing, warning the user if that is not possible, from Borislav Petkov. * Give user better message if precise is not supported, from David Ahern. * Try to find cross-built objdump path by using the session environment information in the perf.data file header, from Irina Tirdea, original patch and idea by Namhyung Kim. * Diplays more output on features check for make V=1, so that one can figure out what is happening by looking at gcc output, etc. From Jiri Olsa. * Add on_exit implementation for systems without one, e.g. Android, from Bernhard Rosenkraenzer. * Only process events for vcpus of interest, helps handling large number of events, from David Ahern. * Cross compilation fixes for Android, from Irina Tirdea. * Add documentation on compiling for Android, from Irina Tirdea. * perf diff improvements from Jiri Olsa. * Target (task/user/cpu/syswide) handling improvements, from Namhyung Kim. * Add support in 'trace' for tracing workload given by command line, from Namhyung Kim. * ... and much more." * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (194 commits) uprobes: Use percpu_rw_semaphore to fix register/unregister vs dup_mmap() race perf evsel: Introduce is_group_member method perf powerpc: Use uapi/unistd.h to fix build error tools: Pass the target in descend tools: Honour the O= flag when tool build called from a higher Makefile tools: Define a Makefile function to do subdir processing perf ui: Always compile browser setup code perf ui: Add ui_progress__finish() perf ui gtk: Implement ui_progress functions perf ui: Introduce generic ui_progress helper perf ui tui: Move progress.c under ui/tui directory perf tools: Add basic event modifier sanity check perf tools: Omit group members from perf_evlist__disable/enable perf tools: Ensure single disable call per event in record comand perf tools: Fix 'disabled' attribute config for record command perf tools: Fix attributes for '{}' defined event groups perf tools: Use sscanf for parsing /proc/pid/maps perf tools: Add gtk.<command> config option for launching GTK browser perf tools: Fix compile error on NO_NEWT=1 build perf hists: Initialize all of he->stat with zeroes ...
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/ftrace.h76
-rw-r--r--include/trace/syscall.h23
2 files changed, 1 insertions, 98 deletions
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index a763888a36f9..40dc5e8fe340 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -545,8 +545,7 @@ ftrace_raw_event_##call(void *__data, proto) \
545 { assign; } \ 545 { assign; } \
546 \ 546 \
547 if (!filter_current_check_discard(buffer, event_call, entry, event)) \ 547 if (!filter_current_check_discard(buffer, event_call, entry, event)) \
548 trace_nowake_buffer_unlock_commit(buffer, \ 548 trace_buffer_unlock_commit(buffer, event, irq_flags, pc); \
549 event, irq_flags, pc); \
550} 549}
551/* 550/*
552 * The ftrace_test_probe is compiled out, it is only here as a build time check 551 * The ftrace_test_probe is compiled out, it is only here as a build time check
@@ -620,79 +619,6 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
620 619
621#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 620#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
622 621
623/*
624 * Define the insertion callback to perf events
625 *
626 * The job is very similar to ftrace_raw_event_<call> except that we don't
627 * insert in the ring buffer but in a perf counter.
628 *
629 * static void ftrace_perf_<call>(proto)
630 * {
631 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
632 * struct ftrace_event_call *event_call = &event_<call>;
633 * extern void perf_tp_event(int, u64, u64, void *, int);
634 * struct ftrace_raw_##call *entry;
635 * struct perf_trace_buf *trace_buf;
636 * u64 __addr = 0, __count = 1;
637 * unsigned long irq_flags;
638 * struct trace_entry *ent;
639 * int __entry_size;
640 * int __data_size;
641 * int __cpu
642 * int pc;
643 *
644 * pc = preempt_count();
645 *
646 * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args);
647 *
648 * // Below we want to get the aligned size by taking into account
649 * // the u32 field that will later store the buffer size
650 * __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),
651 * sizeof(u64));
652 * __entry_size -= sizeof(u32);
653 *
654 * // Protect the non nmi buffer
655 * // This also protects the rcu read side
656 * local_irq_save(irq_flags);
657 * __cpu = smp_processor_id();
658 *
659 * if (in_nmi())
660 * trace_buf = rcu_dereference_sched(perf_trace_buf_nmi);
661 * else
662 * trace_buf = rcu_dereference_sched(perf_trace_buf);
663 *
664 * if (!trace_buf)
665 * goto end;
666 *
667 * trace_buf = per_cpu_ptr(trace_buf, __cpu);
668 *
669 * // Avoid recursion from perf that could mess up the buffer
670 * if (trace_buf->recursion++)
671 * goto end_recursion;
672 *
673 * raw_data = trace_buf->buf;
674 *
675 * // Make recursion update visible before entering perf_tp_event
676 * // so that we protect from perf recursions.
677 *
678 * barrier();
679 *
680 * //zero dead bytes from alignment to avoid stack leak to userspace:
681 * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL;
682 * entry = (struct ftrace_raw_<call> *)raw_data;
683 * ent = &entry->ent;
684 * tracing_generic_entry_update(ent, irq_flags, pc);
685 * ent->type = event_call->id;
686 *
687 * <tstruct> <- do some jobs with dynamic arrays
688 *
689 * <assign> <- affect our values
690 *
691 * perf_tp_event(event_call->id, __addr, __count, entry,
692 * __entry_size); <- submit them to perf counter
693 *
694 * }
695 */
696 622
697#ifdef CONFIG_PERF_EVENTS 623#ifdef CONFIG_PERF_EVENTS
698 624
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 31966a4fb8cc..84bc4197e736 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -31,27 +31,4 @@ struct syscall_metadata {
31 struct ftrace_event_call *exit_event; 31 struct ftrace_event_call *exit_event;
32}; 32};
33 33
34#ifdef CONFIG_FTRACE_SYSCALLS
35extern unsigned long arch_syscall_addr(int nr);
36extern int init_syscall_trace(struct ftrace_event_call *call);
37
38extern int reg_event_syscall_enter(struct ftrace_event_call *call);
39extern void unreg_event_syscall_enter(struct ftrace_event_call *call);
40extern int reg_event_syscall_exit(struct ftrace_event_call *call);
41extern void unreg_event_syscall_exit(struct ftrace_event_call *call);
42extern int
43ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s);
44enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags,
45 struct trace_event *event);
46enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags,
47 struct trace_event *event);
48#endif
49
50#ifdef CONFIG_PERF_EVENTS
51int perf_sysenter_enable(struct ftrace_event_call *call);
52void perf_sysenter_disable(struct ftrace_event_call *call);
53int perf_sysexit_enable(struct ftrace_event_call *call);
54void perf_sysexit_disable(struct ftrace_event_call *call);
55#endif
56
57#endif /* _TRACE_SYSCALL_H */ 34#endif /* _TRACE_SYSCALL_H */