[lkml]   [2010]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[RFC PATCHSET] sched,perf: unify tracers in sched and move perf on top of TP
Hello, all.

This patchset does the following two things.

* 0001-0007: Unify the three tracers (tracepoints, perf_events and
preempt/sched notifiers) in scheduler.

* 0008-0012: Move perf hooks in sched on top of tracepoints if TPs are

It probably should be two separate patchsets with the first part on
top of sched/core which then gets pulled into perf branch, on top of
which the second part is applied but in the spirit of RFC I'm posting
it as a single chunk on top of mainline+perf/urgent.

This patchset contains the following 12 patches.


0001-0006 move tracers in sched around and massage them here and there
to bring the related ones together and make them take the same
arguments. The only change worth noting would be 0005 where
perf_event_task_sched_in() is moved after finish_lock_switch() which
costs the function a pair of local_irq_disable/enable() when switching
a task context in when there's a context to switch in (the unlikely

0007 implements SCHED_EVENT[_RQ]() macros which can define all or any
subset of the three at once and uses them to replace all trace calls.

0008-0011 prepare to move sched perf functions on top of matching TPs
and make them enabled on demand.

0012 makes all sched perf functions TP probe functions and
enable/disable them on-demand.

The whole patchset is more or less straight forward except that the
on-demand (or rather off-demand?) disabling of perf functions in 0012
is somewhat complicated because the callback which can determine when
to turn it off is called under rq lock while unregistering requires a
thread context. As rq lock is depended upon by workqueue, tasklet and
timer, none of those can be used directly. It's worked around by
having a periodic timer polling for completion.

This patchset is available in the following git branch.

git:// sched-trace

The tree is on top of linus#master + sched/urgent for now. Diffstat

arch/ia64/kvm/Kconfig | 2
arch/powerpc/kvm/Kconfig | 2
arch/s390/kvm/Kconfig | 2
arch/x86/kvm/Kconfig | 2
include/linux/kvm_host.h | 4
include/linux/perf_event.h | 39 ++++-
include/linux/preempt.h | 48 -------
include/linux/sched.h | 52 +++++++
include/trace/events/sched.h | 14 ++
init/Kconfig | 2
kernel/perf_event.c | 288 +++++++++++++++++++++++++++++++++++++------
kernel/sched.c | 175 ++++++++++++++------------
virt/kvm/kvm_main.c | 28 +---
13 files changed, 459 insertions(+), 199 deletions(-)



 \ /
  Last update: 2010-05-04 14:43    [W:0.112 / U:6.808 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site