Tracing updates for v2.6.31
Subsystems (27)
Linus,
Please pull the latest tracing-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git tracing-for-linus
This tree underwent a workflow change since the last cycle - instead of a criss-cross daily merge cycle with lots of merge commit we transitioned to a fast-forward mostly-linear tree structure. We also reduced the number of merges drastically via various measures: from 15% down to ~4%.
Hopefully this new tree structure looks nicer than the .30-rc1 one - with the same good quality.
There's still a lot of tracing changes - with hopefully the last and near-final tracepoint version. Better runtime filters, continued conversions to generic event-tracepoints (which show up all at once, instead of being tied to splintered specialistic plugins), performance optimizations and much more.
Note: in 'make oldconfig' there's a new menu that shows up by default if KERNEL_DEBUGGING is enabled - but no new options are selected by default.
Thanks,
Ingo
------------------>
Alan D. Brunelle (2):
blktrace: correct remap names
blktrace: from-sector redundant in trace_block_remap
Avadh Patel (1):
tracing: add saved_cmdlines file to show cached task comms
Chris Wright (1):
x86: use native register access for native tlb flushing
Christoph Hellwig (1):
tracing: small trave_events sample Makefile cleanup
Frederic Weisbecker (12):
tracing/ftrace: factorize the tracing files creation tracing/lockdep: report the time waited for a lock tracing/core: Add current context on tracing recursion warning tracing/ring-buffer: Add unlock recursion protection on discard tracing/events: provide string with undefined size support tracing/lock: provide lock_acquired event support for dynamic size string tracing/events: protect __get_str()
tracing/filters: support for filters of dynamic sized arrays tracing/filters: support for operator reserved characters in strings tracing/stat: replace trace_stat_session by stat_session tracing/stat: replace linked list by an rbtree for sorting tracing/stat: remove unappropriate safe walk on list
Heiko Carstens (2):
tracing: fix build failure on s390
trace: disable preemption before taking raw spinlocks
Ingo Molnar (6):
x86, bts: cleanups
x86, bts: detect size of DS fields, fix
mm, x86, ptrace, bts: defer branch trace stopping, cleanup mm, x86, ptrace, bts: defer branch trace stopping, remove dead code
tracing: make the trace clocks available generally Revert "x86, bts: reenable ptrace branch trace support"
Jason Baron (3):
kerneldoc, tracing: make kernel-doc understand TRACE_EVENT() macro (take #2)
tracing: add new tracepoints docbook
tracing: add irq tracepoint documentation
Jaswinder Singh Rajput (1):
tracing: trace_output.c, fix false positive compiler warning
Jeremy Fitzhardinge (1):
tracing: avoid warnings from zero-arg tracepoints
Lai Jiangshan (2):
ring_buffer: compressed event header
tracing: add trace_event_read_lock()
Li Zefan (31):
tracing: use macros to denote usec and nsec per second
blktrace: fix output of unknown events
blktrace: fix output of BLK_TC_PC events
blktrace: support per-partition tracing for ftrace plugin
blktrace: add trace/ to /sys/block/sda
blktrace: fix context-info when mixed-using blk tracer and trace events
tracing: fix file mode of trace and README
tracing/filters: don't remove old filters when failed to write subsys->filter tracing/filters: allow user-input to be integer-like string tracing/events: make struct trace_entry->type to be int type tracing/events: don't say hi when loading the trace event sample tracing/events: make SAMPLE_TRACE_EVENTS default to n tracing/events: fix memory leak when unloading module tracing/events: fix concurrent access to ftrace_events list tracing/events: fix concurrent access to ftrace_events list, fix tracing/events: clean up for ftrace_set_clr_event() tracing/events: simplify system_enable_read()
blktrace: pdu_buf of pc events should be unsigned
blktrace: from-sector redundant in trace_block_remap, cleanup tracing/filters: add missing unlock in a failure path tracing/filters: fix off-by-one bug
tracing/events: Documentation updates
tracing/events: change the type of __str_loc_item to unsigned short tracing/stat: change dummpy_cmp() to return -1
tracing/stat: remember to free root node
tracing/stat: do some cleanups
tracing/events: fix a typo in __string() format output tracing/events: put TP_fast_assign into braces
tracing/events: introduce __dynamic_array()
tracing/events: convert block trace points to TRACE_EVENT() tracing/events: convert block trace points to TRACE_EVENT(), fix !CONFIG_BLOCK
Markus Metzger (29):
x86, bts: detect size of DS fields
x86, bts: add selftest for BTS
x86, bts: correct comment style in ds.c
x86, hw-branch-tracer: keep resources on stop
x86, hw-branch-tracer: add selftest
x86, bts: use atomic memory allocation
x86, bts: fix race when bts tracer is removed
sched, hw-branch-tracer: add wait_task_context_switch() function to sched.h mm, x86, ptrace, bts: defer branch trace stopping
x86, bts: wait until traced task has been scheduled out
x86, bts: fix race between per-task and per-cpu branch tracing x86, bts: use trace_clock_global() for timestamps
x86, debugctlmsr: add _on_cpu variants to debugctlmsr functions x86, bts, hw-branch-tracer: add _noirq variants to the debug store interface x86, hw-branch-tracer: allocate selftest iterator on heap
x86, ds: fix compiler warning
x86, ds: fix bounds check in ds selftest
x86, ds: selftest each cpu
x86, ds: add task tracing selftest
x86, ds: add leakage warning
x86, ds: use single debug store cpu configuration
x86, ptrace: add bts context unconditionally
x86, ds: dont use TIF_DEBUGCTLMSR
x86, ds: fix bad ds_reset_pebs()
x86, ds: allow small debug store buffers
x86, ds: support Core i7
x86, ds: fix buffer alignment in debug store selftest
x86, bts: reenable ptrace branch trace support
x86, bts, mm: clean up buffer allocation
Mathieu Desnoyers (1):
tracepoint: trace_sched_migrate_task(): remove parameter
Mike Frysinger (1):
ftrace/documentation: fix typo in function grapher name
Ming Lei (2):
tracing: fix check for return value of register_module_notifier
ftrace: fix check for return value of register_module_notifier in event_trace_init
Pekka Enberg (1):
kmemtrace: fix kernel parameter documentation
Peter Zijlstra (1):
ring-buffer: pass in lockdep class key for reader_lock
Shawn Du (1):
blktrace: support per-partition tracing
Stefan Raspl (1):
blktrace: remove debugfs entries on bad path
Steven Rostedt (111):
tracing: add handler to trace_stat
tracing: add function profiler
tracing: move function profiler data out of function struct
tracing: adding function timings to function profiler
tracing: make the function profiler per cpu
function-graph: add option to calculate graph time or not
tracing: clean up tracing profiler
tracing: remove on the fly allocator from function profiler
tracing: add average time in function to function profiler
function-graph: use int instead of atomic for ftrace_graph_active x86, function-graph: only save return values on x86_64
ring-buffer: add ring_buffer_discard_commit
tracing/filters: use ring_buffer_discard_commit for discarded events
tracing: consolidate trace and trace_event headers
tracing: create automated trace defines
tracing: make trace_seq operations available for core kernel tracing/events: move declarations from trace directory to core include tracing/events: move the ftrace event tracing code to core tracing/events: convert event call sites to use a link list tracing/events: add export symbols for trace events in modules tracing/events: add support for modules to TRACE_EVENT tracing/events: fix compile for modules disabled tracing/events: fix lockdep system name
tracing/events: move trace point headers into include/trace/events tracing/events: add trace-events-sample
ftrace: use module notifier for function tracer tracing/events: add startup tests for events tracing/events/ring-buffer: expose format of ring buffer headers to users tracing/events: perform function tracing in event selftests tracing/events: enable code with EVENT_TRACING not EVENT_TRACER
tracing: add EXPORT_SYMBOL_GPL for trace commits
tracing: add same level recursion detection
tracing: protect trace_printk from recursion
tracing: remove format attribute of inline function
tracing: change branch profiling to a choice selection
tracing: create menuconfig for tracing infrastructure
tracing: rename EVENT_TRACER config to ENABLE_EVENT_TRACING tracing/events: call the correct event trace selftest init function
tracing: remove dangling semicolon
tracing: fix recursive test level calculation
tracing: remove recursive test from ring_buffer_event_discard
tracing: use recursive counter over irq level
tracing: use nowakeup version of commit for function event trace tests
ring-buffer: only warn on wrap if buffer is bigger than two pages tracing/wakeup: move access to wakeup_cpu into spinlock
tracing: increase size of number of possible events
tracing: add size checks for exported ftrace internal structures
tracing: fix cut and paste macro error
tracing/lockdep: convert lockdep to use TRACE_EVENT macro tracing/irq: convert irq traces to use TRACE_EVENT macro
tracing: remove deprecated TRACE_FORMAT
tracing/events: reuse trace event ids after overflow tracing/events: make modules have their own file_operations structure
tracing: convert ftrace_dump spinlocks to raw
tracing: fix ref count in splice pages
tracing: only add splice page if entries exist
tracing: have splice only copy full pages
ring-buffer: fix printk output
ring-buffer: export symbols
ring-buffer: add counters for commit overrun and nmi dropped entries
tracing: export stats of ring buffers to userspace
ring-buffer: convert cpu buffer entries to local_t
ring-buffer: record page entries in buffer page descriptor
ring-buffer: have read page swap increment counter with page entries
ring-buffer: disable writers when resetting buffers
tracing: use proper export symbol for tracing api
ring-buffer: move big if statement down
ring-buffer: add benchmark and tester
ring-buffer: remove unneeded conditional in rb_reserve_next
ring-buffer: check for failed allocation in ring buffer benchmark
ring-buffer: make moving the tail page a separate function
ring-buffer: change test to be more latency friendly
tracing: update sample with TRACE_INCLUDE_FILE
tracing: reset ring buffer when removing modules with events
tracing: add hierarchical enabling of events
ring-buffer: remove complex calculations in ring-buffer-test
tracing: append ":*" to internal setting of system events
tracing: have menu default enabled when kernel debug is configured
ring-buffer: only periodically call cond_resched to ring-buffer-benchmark
ring-buffer: add total count in ring-buffer-benchmark
ring-buffer: change WARN_ON from checking preempt_count to preemptible
tracing: initialize return value for __ftrace_set_clr_event
tracing: add trace_set_clr_event to export event enabling function
ring-buffer: replace constants with time macros in ring-buffer-benchmark
ring-buffer: check for divide by zero in ring-buffer-benchmark
ring-buffer: remove type parameter from rb_reserve_next_event
ring-buffer: move calculation of event length
ring-buffer: small optimizations
ring-buffer: use internal time stamp function
ring-buffer: move code around to remove some branches x86/stacktrace: return 0 instead of -1 for stack ops
tracing: stop stack trace on first empty entry
tracing: add __print_flags for events
tracing: add previous task state info to sched switch event
tracing: add flag output for kmem events
tracing: add __print_symbolic to trace events
tracing: convert irq events to use __print_symbolic
ftrace: add kernel command line function filtering
tracing: fix config options to not show when automatically selected
tracing: combine the default tracers into one config
tracing: remove redundant SOFTIRQ from softirq event traces
tracing: make trace pipe recognize latency format flag
ftrace: do not profile functions when disabled
ring-buffer: try to discard unneeded timestamps
ring-buffer: discard timestamps that are at the start of the buffer
tracing: add annotation to what type of stack trace is recorded
ring-buffer: fix ret in rb_add_time_stamp
tracing: fix the block trace points print size
tracing: add trace_seq_vprint interface
tracing: add protection around module events unload
tracing: do not translate event helper macros in print format
Steven Whitehouse (2):
tracing: add exports to use __print_symbolic and __print_flags from a module
tracing: fix multiple use of __print_flags and __print_symbolic
Stuart Bennett (3):
tracing: x86, mmiotrace: code consistency/legibility improvement
tracing: x86, mmiotrace: refactor clearing/restore of page presence
tracing: x86, mmiotrace: only register for die notifier when tracer active
Theodore Ts'o (2):
tracing: Add documentation for the power tracer
tracing: Document the event tracing system
Tim Abbott (1):
ftrace: use .sched.text, not .text.sched in recordmcount.pl
Tim Bird (1):
ring-buffer: fix bug in ring_buffer_discard_commit
Tom Zanussi (9):
tracing/filters: add run-time field descriptions to TRACE_EVENT_FORMAT events tracing/filters: add TRACE_EVENT_FORMAT_NOFILTER event macro tracing/infrastructure: separate event tracer from event support tracing/filters: use ring_buffer_discard_commit() in filter_check_discard() tracing/filters: allow on-the-fly filter switching tracing/filters: add filter_mutex to protect filter predicates tracing/filters: move preds into event_filter object tracing/filters: distinguish between signed and unsigned fields tracing/filters: a better event parser
Zhaolei (12):
ftrace: clean up enable logic for sched_switch
tracing, net, skb tracepoint: make skb tracepoint use the TRACE_EVENT() macro tracing, kmemtrace: Separate include/trace/kmemtrace.h to kmemtrace part and tracepoint part tracing, kmemtrace: Make kmem tracepoints use TRACE_EVENT macro
tracing: Remove include/trace/kmem_event_types.h
ftrace: Add task_comm support for trace_event
ftrace: clean up of using ftrace_event_enable_disable()
ftrace: don't convert function's local variable name in macro
ftrace, workqueuetrace: make workqueue tracepoints use TRACE_EVENT macro
trace_workqueue: use list_for_each_entry() instead of list_for_each_entry_safe()
trace_workqueue: remove cpu_workqueue_stats->first_entry
trace_workqueue: remove blank line between each cpu
walimis (3):
tracing/trace_stack: fix the number of entries in the header tracing/events: fix output format of kernel stack tracing/events: fix output format of user stack
Documentation/DocBook/Makefile | 3 +-
Documentation/DocBook/tracepoint.tmpl | 89 ++
Documentation/kernel-parameters.txt | 27 +-
Documentation/trace/events.txt | 90 ++
Documentation/trace/ftrace.txt | 2 +-
Documentation/trace/power.txt | 17 +
arch/x86/Kconfig.debug | 9 +
arch/x86/include/asm/ds.h | 82 +-
arch/x86/include/asm/processor.h | 35 +-
arch/x86/include/asm/ptrace.h | 9 +-
arch/x86/include/asm/tlbflush.h | 8 +-
arch/x86/kernel/Makefile | 1 +
arch/x86/kernel/ds.c | 921 +++++++++++-----
arch/x86/kernel/ds_selftest.c | 408 +++++++
arch/x86/kernel/ds_selftest.h | 15 +
arch/x86/kernel/entry_64.S | 19 +-
arch/x86/kernel/process.c | 5 +-
arch/x86/kernel/process_32.c | 3 +-
arch/x86/kernel/process_64.c | 3 +-
arch/x86/kernel/ptrace.c | 284 +++--
arch/x86/kernel/stacktrace.c | 2 +-
arch/x86/mm/kmmio.c | 104 +-
arch/x86/mm/mmio-mod.c | 2 +
block/blk-core.c | 21 +-
block/blk-sysfs.c | 7 +-
block/compat_ioctl.c | 2 +-
block/elevator.c | 8 +-
drivers/md/dm.c | 8 +-
drivers/scsi/sg.c | 1 +
fs/bio.c | 3 +-
include/asm-generic/vmlinux.lds.h | 2 +-
include/linux/blktrace_api.h | 45 +-
include/linux/ftrace.h | 17 +-
include/linux/ftrace_event.h | 172 +++
include/linux/init_task.h | 1 +
include/linux/kmemtrace.h | 25 +
include/linux/mm.h | 7 +-
include/linux/mmiotrace.h | 2 +
include/linux/module.h | 8 +
include/linux/ptrace.h | 10 -
include/linux/ring_buffer.h | 66 +-
include/linux/sched.h | 17 +-
include/linux/slab_def.h | 2 +-
include/linux/slub_def.h | 2 +-
include/linux/trace_seq.h | 92 ++
include/linux/tracepoint.h | 8 +-
include/trace/block.h | 76 --
include/trace/define_trace.h | 75 ++
include/trace/events/block.h | 498 ++++++++
include/trace/events/irq.h | 145 +++
include/trace/events/kmem.h | 231 ++++
include/trace/events/lockdep.h | 96 ++
.../trace/{sched_event_types.h => events/sched.h} | 29 +-
include/trace/events/skb.h | 40 +
include/trace/events/workqueue.h | 100 ++
include/trace/ftrace.h | 591 ++++++++++
include/trace/irq.h | 9 -
include/trace/irq_event_types.h | 55 -
include/trace/kmemtrace.h | 63 -
include/trace/lockdep.h | 9 -
include/trace/lockdep_event_types.h | 44 -
include/trace/sched.h | 9 -
include/trace/skb.h | 11 -
include/trace/trace_event_types.h | 5 -
include/trace/trace_events.h | 5 -
include/trace/workqueue.h | 25 -
init/main.c | 2 +-
kernel/Makefile | 1 +
kernel/exit.c | 6 +-
kernel/fork.c | 9 +-
kernel/irq/handle.c | 5 +-
kernel/kthread.c | 5 +-
kernel/lockdep.c | 16 +-
kernel/module.c | 26 +-
kernel/ptrace.c | 10 -
kernel/sched.c | 55 +-
kernel/signal.c | 4 +-
kernel/softirq.c | 7 +-
kernel/trace/Kconfig | 143 ++-
kernel/trace/Makefile | 20 +-
kernel/trace/blktrace.c | 272 ++++-
kernel/trace/events.c | 14 -
kernel/trace/ftrace.c | 772 ++++++++++++--
kernel/trace/kmemtrace.c | 10 +-
kernel/trace/ring_buffer.c | 777 ++++++++-----
kernel/trace/ring_buffer_benchmark.c | 416 +++++++
kernel/trace/trace.c | 383 ++++---
kernel/trace/trace.h | 243 ++---
kernel/trace/trace_boot.c | 5 +-
kernel/trace/trace_branch.c | 8 +-
kernel/trace/trace_event_profile.c | 24 +-
kernel/trace/trace_event_types.h | 12 +-
kernel/trace/trace_events.c | 839 ++++++++++++---
kernel/trace/trace_events_filter.c | 1204 ++++++++++++++++----
kernel/trace/trace_events_stage_1.h | 39 -
kernel/trace/trace_events_stage_2.h | 176 ---
kernel/trace/trace_events_stage_3.h | 281 -----
kernel/trace/trace_export.c | 110 ++-
kernel/trace/trace_functions_graph.c | 25 +-
kernel/trace/trace_hw_branches.c | 203 ++--
kernel/trace/trace_mmiotrace.c | 6 +-
kernel/trace/trace_output.c | 240 ++++-
kernel/trace/trace_output.h | 34 +-
kernel/trace/trace_power.c | 8 +-
kernel/trace/trace_printk.c | 6 +-
kernel/trace/trace_sched_switch.c | 12 +-
kernel/trace/trace_sched_wakeup.c | 8 +-
kernel/trace/trace_selftest.c | 58 +
kernel/trace/trace_stack.c | 15 +-
kernel/trace/trace_stat.c | 208 +++--
kernel/trace/trace_stat.h | 2 +-
kernel/trace/trace_sysprof.c | 6 +-
kernel/trace/trace_workqueue.c | 25 +-
kernel/workqueue.c | 11 +-
mm/bounce.c | 5 +-
mm/mlock.c | 51 +-
mm/slab.c | 2 +-
mm/slob.c | 2 +-
mm/slub.c | 2 +-
mm/util.c | 11 +-
net/core/drop_monitor.c | 2 +-
net/core/net-traces.c | 4 +-
net/core/skbuff.c | 2 +-
samples/Kconfig | 6 +
samples/Makefile | 2 +-
samples/trace_events/Makefile | 6 +
samples/trace_events/trace-events-sample.c | 52 +
samples/trace_events/trace-events-sample.h | 129 +++
scripts/kernel-doc | 22 +
scripts/recordmcount.pl | 6 +-
130 files changed, 8926 insertions(+), 2919 deletions(-)
create mode 100644 Documentation/DocBook/tracepoint.tmpl
create mode 100644 Documentation/trace/events.txt
create mode 100644 Documentation/trace/power.txt
create mode 100644 arch/x86/kernel/ds_selftest.c
create mode 100644 arch/x86/kernel/ds_selftest.h
create mode 100644 include/linux/ftrace_event.h
create mode 100644 include/linux/kmemtrace.h
create mode 100644 include/linux/trace_seq.h
delete mode 100644 include/trace/block.h
create mode 100644 include/trace/define_trace.h
create mode 100644 include/trace/events/block.h
create mode 100644 include/trace/events/irq.h
create mode 100644 include/trace/events/kmem.h
create mode 100644 include/trace/events/lockdep.h
rename include/trace/{sched_event_types.h => events/sched.h} (91%)
create mode 100644 include/trace/events/skb.h
create mode 100644 include/trace/events/workqueue.h
create mode 100644 include/trace/ftrace.h
delete mode 100644 include/trace/irq.h
delete mode 100644 include/trace/irq_event_types.h
delete mode 100644 include/trace/kmemtrace.h
delete mode 100644 include/trace/lockdep.h
delete mode 100644 include/trace/lockdep_event_types.h
delete mode 100644 include/trace/sched.h
delete mode 100644 include/trace/skb.h
delete mode 100644 include/trace/trace_event_types.h
delete mode 100644 include/trace/trace_events.h
delete mode 100644 include/trace/workqueue.h
delete mode 100644 kernel/trace/events.c
create mode 100644 kernel/trace/ring_buffer_benchmark.c
delete mode 100644 kernel/trace/trace_events_stage_1.h
delete mode 100644 kernel/trace/trace_events_stage_2.h
delete mode 100644 kernel/trace/trace_events_stage_3.h
create mode 100644 samples/trace_events/Makefile
create mode 100644 samples/trace_events/trace-events-sample.c
create mode 100644 samples/trace_events/trace-events-sample.hDocumentation/DocBook/Makefile +2 -1
@@ -13,7 +13,8 @@ DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ mac80211.xml debugobjects.xml sh.xml regulator.xml \ - alsa-driver-api.xml writing-an-alsa-driver.xml + alsa-driver-api.xml writing-an-alsa-driver.xml \ + tracepoint.xml ### # The build process is as follows (targets):
Documentation/DocBook/tracepoint.tmpl new file +89 -0
89 lines not on this page · raw message
Documentation/kernel-parameters.txt +15 -12
@@ -56,7 +56,6 @@ parameter is applicable: ISAPNP ISA PnP code is enabled. ISDN Appropriate ISDN support is enabled. JOY Appropriate joystick support is enabled. - KMEMTRACE kmemtrace is enabled. LIBATA Libata driver is enabled LP Printer support is enabled. LOOP Loopback device support is enabled.
@@ -752,12 +751,25 @@ and is between 256 and 4096 characters. It is defined in the file ia64_pal_cache_flush instead of SAL_CACHE_FLUSH. ftrace=[tracer] - [ftrace] will set and start the specified tracer + [FTRACE] will set and start the specified tracer as early as possible in order to facilitate early boot debugging. ftrace_dump_on_oops - [ftrace] will dump the trace buffers on oops. + [FTRACE] will dump the trace buffers on oops. + + ftrace_filter=[function-list] + [FTRACE] Limit the functions traced by the function + tracer at boot up. function-list is a comma separated + list of functions. This list can be changed at run + time by the set_ftrace_filter file in the debugfs + tracing directory. + + ftrace_notrace=[function-list] + [FTRACE] Do not trace the functions specified in + function-list. This list can be changed at run time + by the set_ftrace_notrace file in the debugfs + tracing directory. gamecon.map[2|3]= [HW,JOY] Multisystem joystick and NES/SNES/PSX pad
@@ -1054,15 +1066,6 @@ and is between 256 and 4096 characters. It is defined in the file use the HighMem zone if it exists, and the Normal zone if it does not. - kmemtrace.enable= [KNL,KMEMTRACE] Format: { yes | no } - Controls whether kmemtrace is enabled - at boot-time. - - kmemtrace.subbufs=n [KNL,KMEMTRACE] Overrides the number of - subbufs kmemtrace's relay channel has. Set this - higher than default (KMEMTRACE_N_SUBBUFS in code) if - you experience buffer overruns. - kgdboc= [HW] kgdb over consoles. Requires a tty driver that supports console polling. (only serial suported for now)
Documentation/trace/events.txt new file +90 -0
90 lines not on this page · raw message
Documentation/trace/ftrace.txt +1 -1
@@ -179,7 +179,7 @@ Here is the list of current tracers that may be configured. Function call tracer to trace all kernel functions. - "function_graph_tracer" + "function_graph" Similar to the function tracer except that the function tracer probes the functions on their entry
Documentation/trace/power.txt new file +17 -0
@@ -0,0 +1,17 @@ +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/Kconfig.debug +9 -0
@@ -167,6 +167,15 @@ config IOMMU_LEAK Add a simple leak tracer to the IOMMU code. This is useful when you are debugging a buggy device driver that leaks IOMMU mappings. +config X86_DS_SELFTEST + bool "DS selftest" + default y + depends on DEBUG_KERNEL + depends on X86_DS + ---help--- + Perform Debug Store selftests at boot time. + If in doubt, say "N". + config HAVE_MMIOTRACE_SUPPORT def_bool y
arch/x86/include/asm/ds.h +56 -26
144 lines not on this page · raw message
arch/x86/include/asm/processor.h +28 -7
@@ -460,14 +460,8 @@ struct thread_struct {unsigned io_bitmap_max;/* MSR_IA32_DEBUGCTLMSR value to switch in if TIF_DEBUGCTLMSR is set. */ unsigned long debugctlmsr; -#ifdef CONFIG_X86_DS -/* Debug Store context; see include/asm-x86/ds.h; goes into MSR_IA32_DS_AREA */ +/* Debug Store context; see asm/ds.h */ struct ds_context *ds_ctx; -#endif /* CONFIG_X86_DS */ -#ifdef CONFIG_X86_PTRACE_BTS -/* the signal to send on a bts buffer overflow */ -unsigned int bts_ovfl_signal; -#endif /* CONFIG_X86_PTRACE_BTS */ };static inline unsigned long native_get_debugreg (int regno)
@@ -795,6 +789,21 @@ static inline unsigned long get_debugctlmsr(void)return debugctlmsr; } +static inline unsigned long get_debugctlmsr_on_cpu (int cpu) +{ +u64 debugctlmsr =0 ; +u32 val1, val2; + +#ifndef CONFIG_X86_DEBUGCTLMSR +if (boot_cpu_data.x86 <6 ) +return 0 ; +#endif +rdmsr_on_cpu (cpu,MSR_IA32_DEBUGCTLMSR , &val1, &val2); + debugctlmsr = val1 | ((u64 )val2 <<32 ); + +return debugctlmsr; +} +static inline void update_debugctlmsr (unsigned long debugctlmsr) {#ifndef CONFIG_X86_DEBUGCTLMSR
@@ -804,6 +813,18 @@ static inline void update_debugctlmsr(unsigned long debugctlmsr)wrmsrl (MSR_IA32_DEBUGCTLMSR , debugctlmsr); } +static inline void update_debugctlmsr_on_cpu (int cpu, +unsigned long debugctlmsr) +{ +#ifndef CONFIG_X86_DEBUGCTLMSR +if (boot_cpu_data.x86 <6 ) +return ; +#endif +wrmsr_on_cpu (cpu,MSR_IA32_DEBUGCTLMSR , + (u32)((u64 )debugctlmsr), + (u32)((u64 )debugctlmsr >>32 )); +} +/* * from system description table in BIOS. Mostly for MCA use, but * others may find it useful:
arch/x86/include/asm/ptrace.h +4 -5
@@ -235,12 +235,11 @@ extern int do_get_thread_area(struct task_struct *p, int idx,extern int do_set_thread_area (struct task_struct *p,int idx,struct user_desc __user *info,int can_allocate); -extern void x86_ptrace_untrace (struct task_struct *); -extern void x86_ptrace_fork (struct task_struct *child, -unsigned long clone_flags); +#ifdef CONFIG_X86_PTRACE_BTS +extern void ptrace_bts_untrace (struct task_struct *tsk); -#define arch_ptrace_untrace (tsk) x86_ptrace_untrace(tsk) -#define arch_ptrace_fork (child, flags) x86_ptrace_fork(child, flags) +#define arch_ptrace_untrace (tsk) ptrace_bts_untrace(tsk) +#endif /* CONFIG_X86_PTRACE_BTS */ #endif /* __KERNEL__ */
arch/x86/include/asm/tlbflush.h +4 -4
@@ -17,7 +17,7 @@static inline void __native_flush_tlb (void ) { -write_cr3 (read_cr3 ()); +native_write_cr3 (native_read_cr3 ()); }static inline void __native_flush_tlb_global (void )
@@ -32,11 +32,11 @@ static inline void __native_flush_tlb_global(void)*/ raw_local_irq_save (flags); - cr4 =read_cr4 (); + cr4 =native_read_cr4 ();/* clear PGE */ -write_cr4 (cr4 & ~X86_CR4_PGE ); +native_write_cr4 (cr4 & ~X86_CR4_PGE );/* write old PGE again and flush TLBs */ -write_cr4 (cr4); +native_write_cr4 (cr4);raw_local_irq_restore (flags); }
arch/x86/kernel/Makefile +1 -0
@@ -44,6 +44,7 @@ obj-y += process.o obj-y += i387.o xsave.o obj-y += ptrace.o obj-$(CONFIG_X86_DS) += ds.o +obj-$(CONFIG_X86_DS_SELFTEST) += ds_selftest.o obj-$(CONFIG_X86_32) += tls.o obj-$(CONFIG_IA32_EMULATION) += tls.o obj-y += step.o
arch/x86/kernel/ds.c +663 -258
1,395 lines not on this page · raw message
arch/x86/kernel/ds_selftest.c new file +408 -0
408 lines not on this page · raw message
arch/x86/kernel/ds_selftest.h new file +15 -0
@@ -0,0 +1,15 @@ +/* +* Debug Store support - selftest +* +* +* Copyright (C) 2009 Intel Corporation. +* Markus Metzger <[email protected]>, 2009 +*/ + +#ifdef CONFIG_X86_DS_SELFTEST +extern int ds_selftest_bts (void ); +extern int ds_selftest_pebs (void ); +#else +static inline int ds_selftest_bts (void ) {return 0 ; } +static inline int ds_selftest_pebs (void ) {return 0 ; } +#endif
arch/x86/kernel/entry_64.S +3 -16
@@ -147,27 +147,14 @@ END(ftrace_graph_caller) GLOBAL(return_to_handler) subq $80, %rsp + /* Save the return values */ movq %rax, (%rsp) - movq %rcx, 8(%rsp) - movq %rdx, 16(%rsp) - movq %rsi, 24(%rsp) - movq %rdi, 32(%rsp) - movq %r8, 40(%rsp) - movq %r9, 48(%rsp) - movq %r10, 56(%rsp) - movq %r11, 64(%rsp) + movq %rdx, 8(%rsp) call ftrace_return_to_handler movq %rax, 72(%rsp) - movq 64(%rsp), %r11 - movq 56(%rsp), %r10 - movq 48(%rsp), %r9 - movq 40(%rsp), %r8 - movq 32(%rsp), %rdi - movq 24(%rsp), %rsi - movq 16(%rsp), %rdx - movq 8(%rsp), %rcx + movq 8(%rsp), %rdx movq (%rsp), %rax addq $72, %rsp retq
arch/x86/kernel/process.c +3 -2
@@ -14,6 +14,7 @@#include <asm/idle.h> #include <asm/uaccess.h> #include <asm/i387.h> +#include <asm/ds.h> unsigned long idle_halt;EXPORT_SYMBOL (idle_halt);
@@ -45,6 +46,8 @@ void free_thread_xstate(struct task_struct *tsk)kmem_cache_free (task_xstate_cachep, tsk->thread.xstate); tsk->thread.xstate =NULL ; } + +WARN (tsk->thread.ds_ctx,"leaking DS context\n" ); }void free_thread_info (struct thread_info *ti)
@@ -83,8 +86,6 @@ void exit_thread(void)put_cpu ();kfree (bp); } - -ds_exit_thread (current); }void flush_thread (void )
arch/x86/kernel/process_32.c +2 -1
@@ -290,7 +290,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, p->thread.io_bitmap_max =0 ; } -ds_copy_thread (p, current); +clear_tsk_thread_flag (p,TIF_DS_AREA_MSR ); + p->thread.ds_ctx =NULL ;clear_tsk_thread_flag (p,TIF_DEBUGCTLMSR ); p->thread.debugctlmsr =0 ;
arch/x86/kernel/process_64.c +2 -1
@@ -335,7 +335,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, goto out; } -ds_copy_thread (p, me); +clear_tsk_thread_flag (p,TIF_DS_AREA_MSR ); + p->thread.ds_ctx =NULL ;clear_tsk_thread_flag (p,TIF_DEBUGCTLMSR ); p->thread.debugctlmsr =0 ;
arch/x86/kernel/ptrace.c +182 -102
419 lines not on this page · raw message
arch/x86/kernel/stacktrace.c +1 -1
@@ -20,7 +20,7 @@ save_stack_warning_symbol(void *data, char *msg, unsigned long symbol)static int save_stack_stack (void *data,char *name) { -return -1 ; +return 0 ; }static void save_stack_address (void *data,unsigned long addr,int reliable)
arch/x86/mm/kmmio.c +61 -43
164 lines not on this page · raw message
include/linux/blktrace_api.h +33 -12
45 lines not on this page · raw message
include/linux/ftrace_event.h new file +172 -0
172 lines not on this page · raw message
include/linux/ring_buffer.h +58 -8
66 lines not on this page · raw message
include/linux/trace_seq.h new file +92 -0
92 lines not on this page · raw message
include/trace/block.h deleted +0 -76
76 lines not on this page · raw message
include/trace/define_trace.h new file +75 -0
75 lines not on this page · raw message
include/trace/events/block.h new file +498 -0
498 lines not on this page · raw message
include/trace/events/irq.h new file +145 -0
145 lines not on this page · raw message
include/trace/events/kmem.h new file +231 -0
231 lines not on this page · raw message
include/trace/events/lockdep.h new file +96 -0
96 lines not on this page · raw message
include/trace/events/sched.h renamed from include/trace/sched_event_types.h +19 -10
Lines of this file are not shown. View the raw message.
include/trace/events/workqueue.h new file +100 -0
100 lines not on this page · raw message
include/trace/ftrace.h new file +591 -0
591 lines not on this page · raw message
include/trace/irq_event_types.h deleted +0 -55
55 lines not on this page · raw message
include/trace/kmemtrace.h deleted +0 -63
63 lines not on this page · raw message
include/trace/lockdep_event_types.h deleted +0 -44
44 lines not on this page · raw message
include/trace/trace_event_types.h deleted +0 -5
Lines of this file are not shown. View the raw message.
kernel/sched.c +47 -8
55 lines not on this page · raw message
kernel/trace/Kconfig +110 -33
143 lines not on this page · raw message
kernel/trace/blktrace.c +229 -43
272 lines not on this page · raw message
kernel/trace/ftrace.c +705 -67
772 lines not on this page · raw message
kernel/trace/ring_buffer.c +506 -271
777 lines not on this page · raw message
kernel/trace/ring_buffer_benchmark.c new file +416 -0
416 lines not on this page · raw message
kernel/trace/trace.c +253 -130
383 lines not on this page · raw message
kernel/trace/trace.h +98 -145
243 lines not on this page · raw message
kernel/trace/trace_events.c +700 -139
839 lines not on this page · raw message
kernel/trace/trace_events_filter.c +963 -241
1,204 lines not on this page · raw message
kernel/trace/trace_events_stage_1.h deleted +0 -39
Lines of this file are not shown. View the raw message.
kernel/trace/trace_events_stage_2.h deleted +0 -176
176 lines not on this page · raw message
kernel/trace/trace_events_stage_3.h deleted +0 -281
281 lines not on this page · raw message
kernel/trace/trace_export.c +107 -3
110 lines not on this page · raw message
kernel/trace/trace_hw_branches.c +105 -98
203 lines not on this page · raw message
kernel/trace/trace_output.c +213 -27
240 lines not on this page · raw message
kernel/trace/trace_selftest.c +58 -0
58 lines not on this page · raw message
kernel/trace/trace_stat.c +128 -80
208 lines not on this page · raw message
mm/mlock.c +21 -30
51 lines not on this page · raw message
samples/trace_events/trace-events-sample.c new file +52 -0
52 lines not on this page · raw message
samples/trace_events/trace-events-sample.h new file +129 -0
129 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.