perfcounters for v2.6.32, part 2
Subsystems (5)
Linus,
Please pull the latest perfcounters-core-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git perfcounters-core-for-linus
This is the second (final) bit of perfcounter updates. Amongst other things it adds two new tools: 'perf timeline' (boot and runtime time analysis based on SVGs), and 'perf sched' (a family of text based tools for scheduler analysis). It also rounds up BTS support.
Note, two commits with 'mingo' as the author snuck in from a box where i did not have Git set up properly:
mingo (2):
perf sched: Print PIDs too
perf sched: Add support for sched:sched_stat_runtime events
The signoff line is correct, but can redo the tree if these commits are a problem. Should not occur in the future.
Thanks,
Ingo
------------------>
Arjan van de Ven (12):
perf: Add a timestamp to fork events
perf: Store trace event name/id pairs in perf.data
perf: Allow perf utilities to have "callback" options without arguments
perf: Add a sample_event type to the event_union
tracing, perf: Convert the power tracer into an event tracer
perf: Add a SVG helper library file
perf: Add the timechart tool
perf timechart: Add "perf timechart record"
perf utils: Be consistent about minimum text size in the svghelper tracing, x86, cpuidle: Move the end point of a C state in the power tracer
perf: Add timechart help text and add timechart to "perf help" perf utils: Use a define for the maximum length of a trace event
Frederic Weisbecker (11):
perf tools: Allow the specification of all tracepoints at once perf sched: Fix bad event alignment
perf sched: Make it easier to plug in new sub profilers
perf sched: Add sched latency profiling
perf sched: Rename struct lat_snapshot to struct work atoms
perf sched: Add involuntarily sleeping task in work atoms
perf sched: Export the total, max latency and total runtime to thread atoms list perf sched: Fix nsec to msec conversion
perf sched: Implement multidimensional sorting
perf tools: Add an option to multiplex counters in a single channel perf tools: Fix processing of randomly serialized sched traces
Ian Schram (1):
perf_counter: Fix perf_copy_attr() pointer arithmetic
Ingo Molnar (22):
perf: Add 'perf sched' tool
perf sched: Import schedbench.c
perf sched: Implement the scheduling workload replay engine perf sched: Tighten up the code
perf sched: Clean up latency and replay sub-commands perf sched: Display time in milliseconds, reorganize output perf sched: Add runtime stats
perf sched: Output runtime and context switch totals perf sched: Add 'perf sched latency' and 'perf sched replay' perf sched: Finish latency => atom rename and misc cleanups perf sched: Clean up PID sorting logic
perf sched: Implement the 'perf sched record' subcommand
perf_counter: Allow mmap if paranoid checks are turned off perf sched: Add 'perf sched trace', improve documentation perf_counter, sched: Add sched_stat_runtime tracepoint perf tools: Implement counter output multiplexing perf sched: Fix 'perf sched latency' output on 32-bit systems perf sched: Account for lost events, increase default buffering perf sched: Sanity check context switch events
perf sched: Make idle thread and comm/pid names more consistent perf sched: Add 'perf sched map' scheduling event map printout perf sched: Determine the number of CPUs automatically
Li Zefan (3):
perf tools: Fix memory leak in read_ftrace_printk() perf tools: Increase MAX_EVENT_LENGTH
perf trace: Sample timestamp and cpu when using record flag
Markus Metzger (1):
x86, perf_counter, bts: Optimize BTS overflow handling
Mike Galbraith (1):
perf sched: Add --input=file option to builtin-sched.c
Peter Zijlstra (5):
perf_counter: Do not throttle single swcounter events
perf_counter: Allow for a wakeup watermark
perf record: Disable profiling before draining the buffer
perf_counter: Fix up swcounter throttling
sched_clock: Make it NMI safe
mingo (2):
perf sched: Print PIDs too
perf sched: Add support for sched:sched_stat_runtime events
Documentation/trace/power.txt | 17 - arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 7 +- arch/x86/kernel/cpu/perf_counter.c | 60 +- arch/x86/kernel/process.c | 25 +- drivers/cpuidle/cpuidle.c | 2 + include/linux/perf_counter.h | 80 +- include/trace/events/power.h | 81 ++ include/trace/events/sched.h | 33 + kernel/perf_counter.c | 394 +++--- kernel/sched_clock.c | 122 +- kernel/sched_fair.c | 1 + kernel/trace/Makefile | 2 +- kernel/trace/power-traces.c | 20 + kernel/trace/trace.h | 3 - kernel/trace/trace_entries.h | 17 - kernel/trace/trace_power.c | 218 --- scripts/tracing/power.pl | 108 -- tools/perf/Documentation/perf-sched.txt | 41 + tools/perf/Documentation/perf-timechart.txt | 35 + tools/perf/Documentation/perf-trace.txt | 25 + tools/perf/Makefile | 9 + tools/perf/builtin-record.c | 56 +- tools/perf/builtin-sched.c | 2004 +++++++++++++++++++++++++++ tools/perf/builtin-timechart.c | 1151 +++++++++++++++ tools/perf/builtin.h | 6 +- tools/perf/command-list.txt | 3 + tools/perf/perf.c | 2 + tools/perf/util/event.h | 10 +- tools/perf/util/header.c | 67 +- tools/perf/util/header.h | 6 + tools/perf/util/parse-events.c | 237 +++- tools/perf/util/parse-options.h | 2 + tools/perf/util/svghelper.c | 384 +++++ tools/perf/util/svghelper.h | 25 + tools/perf/util/thread.c | 4 +- tools/perf/util/thread.h | 9 +- tools/perf/util/trace-event-info.c | 7 +- tools/perf/util/trace-event-parse.c | 45 +- tools/perf/util/trace-event-read.c | 6 +- tools/perf/util/trace-event.h | 5 + 40 files changed, 4570 insertions(+), 759 deletions(-) delete mode 100644 Documentation/trace/power.txt create mode 100644 include/trace/events/power.h create mode 100644 kernel/trace/power-traces.c delete mode 100644 kernel/trace/trace_power.c delete mode 100644 scripts/tracing/power.pl create mode 100644 tools/perf/Documentation/perf-sched.txt create mode 100644 tools/perf/Documentation/perf-timechart.txt create mode 100644 tools/perf/Documentation/perf-trace.txt create mode 100644 tools/perf/builtin-sched.c create mode 100644 tools/perf/builtin-timechart.c create mode 100644 tools/perf/util/svghelper.c create mode 100644 tools/perf/util/svghelper.h
Documentation/trace/power.txt deleted +0 -17
@@ -1,17 +0,0 @@ -The power tracer collects detailed information about C-state and P-state -transitions, instead of just looking at the high-level "average" -information. - -There is a helper script found in scrips/tracing/power.pl in the kernel -sources which can be used to parse this information and create a -Scalable Vector Graphics (SVG) picture from the trace data. - -To use this tracer: - - echo 0 > /sys/kernel/debug/tracing/tracing_enabled - echo power > /sys/kernel/debug/tracing/current_tracer - echo 1 > /sys/kernel/debug/tracing/tracing_enabled - sleep 1 - echo 0 > /sys/kernel/debug/tracing/tracing_enabled - cat /sys/kernel/debug/tracing/trace | \ - perl scripts/tracing/power.pl > out.sv
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +2 -5
@@ -33,7 +33,7 @@#include <linux/cpufreq.h> #include <linux/compiler.h> #include <linux/dmi.h> -#include <trace/power.h> +#include <trace/events/power.h> #include <linux/acpi.h> #include <linux/io.h>
@@ -72,8 +72,6 @@ static DEFINE_PER_CPU(struct acpi_cpufreq_data *, drv_data); static DEFINE_PER_CPU(struct aperfmperf, old_perf); -DEFINE_TRACE (power_mark); -/* acpi_perf_data is a pointer to percpu data. */ static struct acpi_processor_performance *acpi_perf_data;
@@ -332,7 +330,6 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,unsigned int next_perf_state =0 ;/* Index into perf table */ unsigned int i;int result =0 ; -struct power_trace it;dprintk ("acpi_cpufreq_target %d (%d)\n" , target_freq, policy->cpu);
@@ -364,7 +361,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, } } -trace_power_mark (&it,POWER_PSTATE , next_perf_state); +trace_power_frequency (POWER_PSTATE , data->freq_table[next_state].frequency);switch (data->cpu_feature) {case SYSTEM_INTEL_MSR_CAPABLE :
arch/x86/kernel/cpu/perf_counter.c +37 -23
143 lines not on this page · raw message
arch/x86/kernel/process.c +6 -19
@@ -9,7 +9,7 @@#include <linux/pm.h> #include <linux/clockchips.h> #include <linux/random.h> -#include <trace/power.h> +#include <trace/events/power.h> #include <asm/system.h> #include <asm/apic.h> #include <asm/syscalls.h>
@@ -25,9 +25,6 @@ EXPORT_SYMBOL(idle_nomwait);struct kmem_cache *task_xstate_cachep; -DEFINE_TRACE (power_start); -DEFINE_TRACE (power_end); -int arch_dup_task_struct (struct task_struct *dst,struct task_struct *src) { *dst = *src;
@@ -299,9 +296,7 @@ static inline int hlt_use_halt(void)void default_idle (void ) {if (hlt_use_halt ()) { -struct power_trace it; - -trace_power_start (&it,POWER_CSTATE ,1 ); +trace_power_start (POWER_CSTATE ,1 );current_thread_info ()->status &= ~TS_POLLING ;/* * TS_POLLING-cleared state must be visible before we
@@ -314,7 +309,6 @@ void default_idle(void)else local_irq_enable ();current_thread_info ()->status |=TS_POLLING ; -trace_power_end (&it); }else {local_irq_enable ();/* loop is done by the caller */
@@ -372,9 +366,7 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait);*/ void mwait_idle_with_hints (unsigned long ax,unsigned long cx) { -struct power_trace it; - -trace_power_start (&it,POWER_CSTATE , (ax>>4 )+1 ); +trace_power_start (POWER_CSTATE , (ax>>4 )+1 );if (!need_resched ()) {if (cpu_has (¤t_cpu_data,X86_FEATURE_CLFLUSH_MONITOR ))clflush ((void *)¤t_thread_info ()->flags);
@@ -384,15 +376,13 @@ void mwait_idle_with_hints(unsigned long ax, unsigned long cx)if (!need_resched ())__mwait (ax, cx); } -trace_power_end (&it); }/* Default MONITOR/MWAIT with no hints, used for default C1 state */ static void mwait_idle (void ) { -struct power_trace it;if (!need_resched ()) { -trace_power_start (&it,POWER_CSTATE ,1 ); +trace_power_start (POWER_CSTATE ,1 );if (cpu_has (¤t_cpu_data,X86_FEATURE_CLFLUSH_MONITOR ))clflush ((void *)¤t_thread_info ()->flags);
@@ -402,7 +392,6 @@ static void mwait_idle(void)__sti_mwait (0 ,0 ); elselocal_irq_enable (); -trace_power_end (&it); }else local_irq_enable (); }
@@ -414,13 +403,11 @@ static void mwait_idle(void)*/ static void poll_idle (void ) { -struct power_trace it; - -trace_power_start (&it,POWER_CSTATE ,0 ); +trace_power_start (POWER_CSTATE ,0 );local_irq_enable ();while (!need_resched ())cpu_relax (); -trace_power_end (&it); +trace_power_end (0 ); }/*
drivers/cpuidle/cpuidle.c +2 -0
@@ -17,6 +17,7 @@#include <linux/cpuidle.h> #include <linux/ktime.h> #include <linux/hrtimer.h> +#include <trace/events/power.h> #include "cpuidle.h"
@@ -91,6 +92,7 @@ static void cpuidle_idle_call(void)/* give the governor an opportunity to reflect on the outcome */ if (cpuidle_curr_governor->reflect) cpuidle_curr_governor->reflect (dev); +trace_power_end (0 ); }/**
include/linux/perf_counter.h +74 -6
137 lines not on this page · raw message
include/trace/events/power.h new file +81 -0
81 lines not on this page · raw message
include/trace/events/sched.h +33 -0
@@ -380,6 +380,39 @@ TRACE_EVENT(sched_stat_wait, );/* +* Tracepoint for accounting runtime (time the task is executing +* on a CPU). +*/ +TRACE_EVENT (sched_stat_runtime, + + TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime), + +TP_ARGS (tsk, runtime, vruntime), + +TP_STRUCT__entry ( + __array( char, comm, TASK_COMM_LEN ) + __field( pid_t, pid ) + __field( u64, runtime ) +__field ( u64, vruntime ) + ), + + TP_fast_assign( + memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); + __entry->pid = tsk->pid; + __entry->runtime = runtime; + __entry->vruntime = vruntime; + ) +TP_perf_assign ( + __perf_count(runtime); + ), + +TP_printk ("task: %s:%d runtime: %Lu [ns], vruntime: %Lu [ns]" , + __entry->comm, __entry->pid, + (unsigned long long )__entry->runtime, + (unsigned long long )__entry->vruntime) +); + +/* * Tracepoint for accounting sleep time (time the task is not runnable, * including iowait, see below). */
kernel/perf_counter.c +216 -178
679 lines not on this page · raw message
kernel/sched_clock.c +53 -69
182 lines not on this page · raw message
kernel/sched_fair.c +1 -0
@@ -513,6 +513,7 @@ static void update_curr(struct cfs_rq *cfs_rq)if (entity_is_task (curr)) {struct task_struct *curtask =task_of (curr); +trace_sched_stat_runtime (curtask, delta_exec, curr->vruntime);cpuacct_charge (curtask, delta_exec);account_group_exec_runtime (curtask, delta_exec); }
kernel/trace/Makefile +1 -1
@@ -42,7 +42,6 @@ obj-$(CONFIG_BOOT_TRACER) += trace_boot.o obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += trace_functions_graph.o obj-$(CONFIG_TRACE_BRANCH_PROFILING) += trace_branch.o obj-$(CONFIG_HW_BRANCH_TRACER) += trace_hw_branches.o -obj-$(CONFIG_POWER_TRACER) += trace_power.o obj-$(CONFIG_KMEMTRACE) += kmemtrace.o obj-$(CONFIG_WORKQUEUE_TRACER) += trace_workqueue.o obj-$(CONFIG_BLK_DEV_IO_TRACE) += blktrace.o
@@ -54,5 +53,6 @@ obj-$(CONFIG_EVENT_TRACING) += trace_export.o obj-$(CONFIG_FTRACE_SYSCALLS) += trace_syscalls.o obj-$(CONFIG_EVENT_PROFILE) += trace_event_profile.o obj-$(CONFIG_EVENT_TRACING) += trace_events_filter.o +obj-$(CONFIG_EVENT_TRACING) += power-traces.o libftrace-y := ftrace.o
kernel/trace/power-traces.c new file +20 -0
@@ -0,0 +1,20 @@ +/* +* Power trace points +* +* Copyright (C) 2009 Arjan van de Ven <[email protected]> +*/ + +#include <linux/string.h> +#include <linux/types.h> +#include <linux/workqueue.h> +#include <linux/sched.h> +#include <linux/module.h> +#include <linux/slab.h> + +#define CREATE_TRACE_POINTS +#include <trace/events/power.h> + +EXPORT_TRACEPOINT_SYMBOL_GPL (power_start); +EXPORT_TRACEPOINT_SYMBOL_GPL (power_end); +EXPORT_TRACEPOINT_SYMBOL_GPL (power_frequency); +
kernel/trace/trace.h +0 -3
@@ -11,7 +11,6 @@#include <linux/ftrace.h> #include <trace/boot.h> #include <linux/kmemtrace.h> -#include <trace/power.h> #include <linux/trace_seq.h> #include <linux/ftrace_event.h>
@@ -37,7 +36,6 @@ enum trace_type {TRACE_HW_BRANCHES ,TRACE_KMEM_ALLOC ,TRACE_KMEM_FREE , -TRACE_POWER ,TRACE_BLK , __TRACE_LAST_TYPE,
@@ -207,7 +205,6 @@ extern void __ftrace_bad_type(void); IF_ASSIGN(var, ent, struct ftrace_graph_ret_entry, \TRACE_GRAPH_RET ); \ IF_ASSIGN(var, ent, struct hw_branch_entry, TRACE_HW_BRANCHES);\ - IF_ASSIGN(var, ent, struct trace_power, TRACE_POWER); \ IF_ASSIGN(var, ent, struct kmemtrace_alloc_entry, \TRACE_KMEM_ALLOC ); \ IF_ASSIGN(var, ent, struct kmemtrace_free_entry, \
kernel/trace/trace_entries.h +0 -17
@@ -330,23 +330,6 @@ FTRACE_ENTRY(hw_branch, hw_branch_entry,F_printk ("from: %llx to: %llx" , __entry->from, __entry->to) ); -FTRACE_ENTRY (power, trace_power, - -TRACE_POWER , - -F_STRUCT ( - __field_struct( struct power_trace, state_data ) - __field_desc( s64, state_data, stamp ) - __field_desc( s64, state_data, end ) - __field_desc( int, state_data, type ) -__field_desc ( int, state_data, state ) - ), - -F_printk ("%llx->%llx type:%u state:%u" , - __entry->stamp, __entry->end, - __entry->type, __entry->state) -); - FTRACE_ENTRY(kmem_alloc, kmemtrace_alloc_entry, TRACE_KMEM_ALLOC,
kernel/trace/trace_power.c deleted +0 -218
218 lines not on this page · raw message
scripts/tracing/power.pl deleted +0 -108
108 lines not on this page · raw message
tools/perf/Documentation/perf-sched.txt new file +41 -0
41 lines not on this page · raw message
tools/perf/Documentation/perf-timechart.txt new file +35 -0
@@ -0,0 +1,35 @@ +perf-timechart(1) +================= + +NAME +---- +perf-timechart - Tool to visualize total system behavior during a workload + +SYNOPSIS +-------- +[verse] +'perf timechart' {record} + +DESCRIPTION +----------- +There are two variants of perf timechart: + + 'perf timechart record <command>' to record the system level events + of an arbitrary workload. + + 'perf timechart' to turn a trace into a Scalable Vector Graphics file, + that can be viewed with popular SVG viewers such as 'Inkscape'. + +OPTIONS +------- +-o:: +--output=:: + Select the output file (default: output.svg) +-i:: +--input=:: + Select the input file (default: perf.data) + + +SEE ALSO +-------- +linkperf:perf-record[1]
tools/perf/Documentation/perf-trace.txt new file +25 -0
@@ -0,0 +1,25 @@ +perf-trace(1) +============== + +NAME +---- +perf-trace - Read perf.data (created by perf record) and display trace output + +SYNOPSIS +-------- +[verse] +'perf trace' [-i <file> | --input=file] symbol_name + +DESCRIPTION +----------- +This command reads the input file and displays the trace recorded. + +OPTIONS +------- +-D:: +--dump-raw-trace=:: + Display verbose dump of the trace data. + +SEE ALSO +-------- +linkperf:perf-record[1]
tools/perf/Makefile +9 -0
@@ -373,13 +373,16 @@ LIB_OBJS += util/thread.o LIB_OBJS += util/trace-event-parse.o LIB_OBJS += util/trace-event-read.o LIB_OBJS += util/trace-event-info.o +LIB_OBJS += util/svghelper.o BUILTIN_OBJS += builtin-annotate.o BUILTIN_OBJS += builtin-help.o +BUILTIN_OBJS += builtin-sched.o BUILTIN_OBJS += builtin-list.o BUILTIN_OBJS += builtin-record.o BUILTIN_OBJS += builtin-report.o BUILTIN_OBJS += builtin-stat.o +BUILTIN_OBJS += builtin-timechart.o BUILTIN_OBJS += builtin-top.o BUILTIN_OBJS += builtin-trace.o
@@ -710,6 +713,12 @@ builtin-help.o: builtin-help.c common-cmds.h PERF-CFLAGS '-DPERF_MAN_PATH="$(mandir_SQ)"' \ '-DPERF_INFO_PATH="$(infodir_SQ)"' $< +builtin-timechart.o: builtin-timechart.c common-cmds.h PERF-CFLAGS + $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \ + '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ + '-DPERF_MAN_PATH="$(mandir_SQ)"' \ + '-DPERF_INFO_PATH="$(infodir_SQ)"' $< + $(BUILT_INS): perf$X $(QUIET_BUILT_IN)$(RM) $@ && \ ln perf$X $@ 2>/dev/null || \
tools/perf/builtin-record.c +41 -15
95 lines not on this page · raw message
tools/perf/builtin-sched.c new file +2004 -0
961 lines not on this page · raw message
tools/perf/builtin-timechart.c new file +1151 -0
1,151 lines not on this page · raw message
tools/perf/util/header.c +63 -4
67 lines not on this page · raw message
tools/perf/util/parse-events.c +185 -52
237 lines not on this page · raw message
tools/perf/util/svghelper.c new file +384 -0
384 lines not on this page · raw message
tools/perf/util/trace-event-parse.c +35 -10
45 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.