linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [git pull] latency tracer
@ 2008-02-08 21:45 Ingo Molnar
  2008-02-09  7:01 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ingo Molnar @ 2008-02-08 21:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Steven Rostedt, linux-kernel, Andrew Morton


Linus, please pull the latency tracer tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched.git

Find the shortlog below.

This is the latency tracer from -rt, split up and much cleaned up by 
Steve Rostedt, Arnaldo Carvalho and myself. The main motivation of this 
tracer is to be utilized by high-level user tools such as LatencyTOP, to 
analyze system behavior and to enable users to give feedback to kernel 
developers.

It has been in -rt for years and was found to be very useful there, and 
in the last month it has been posted to lkml by Steve about 10 times. 
[This final version is simpler and cleaner than the last lkml version 
(v10) - lets start simple. ]

It does include one very interesting new feature that deserves to be 
mentioned outside of the shortlog: 'dynamic ftrace' - which is a 
transparent kernel-image-patcher mechanism that lazily patches out 
mcount callsites from all functions that get executed. [if tracing is 
disabled] These patched out callsites are remembered, and are patched 
back in when tracing is enabled.

This technique does not just accelelerate the "tracing disabled" case 
enormously, we were in fact unable to measure _any_ performance 
difference (within noise) between an mcount-enabled dyn-ftrace [but 
tracing-disabled] and a vanilla kernel (!), on modern CPUs.

There is still the cost of the +5 byte function size that mcount causes, 
and the resulting +~1% kernel text size increase, but the overhead was 
not measurable in micro or macro benchmarks that we tried. (probably 
because there are no branches added to the hot paths and the only 
overhead is the NOP that is inserted into the prologue of the function - 
which modern CPUs will just eat up as if it didnt exist.)

All in one, i think this is one of the most promising developments in 
terms of Linux kernel instrumentation that happened in the past few 
years:

- it gives us full, very meaningful instrumentation (there are 
  70,000+ function calls in an allyesconfig kernel)

- the instrumentation sites can be flexibly selected and there's no 
  measurable performance overhead (that we could measure)

- there's near zero "collateral" maintenance overhead to other 
  subsystems (!)

- the technique [of mcount based tracing] has been tested in -rt for 
  years so we know the impact pretty well.

- the mcount call sites [on exported functions] can be used by
  SystemTap to do low-overhead patching as well and to access the
  function parameters in a predictable way. [as long as the parameter 
  signature of the function does not change.]

And no, i'm not biased at all ;-)

there are 6 tracers available with this pull:

  # cat /debug/tracing/available_tracers
  wakeup preemptirqsoff preemptoff irqsoff ftrace sched_switch none

these are the well-known and popular tracer variants from -rt. (But i'd 
expect more tracers to show up - the design is extensible.)

the patch does change generic include files too, so i made a test-build 
on ppc64 as well (besides the usual x86 grind), and it built fine. No 
architectures are supposed to (or expected to) break.

( This tree also includes the RCU enhancements for NO_HZ - Steve's box 
  was locking up under PREEMPT_RCU without this. These bits have been 
  under testing for months too. )

Thanks,

	Ingo

------------------>
Arnaldo Carvalho de Melo (2):
      ftrace: add basic support for gcc profiler instrumentation
      ftrace: annotate core code that should not be traced

Ingo Molnar (3):
      sched: add latency tracer callbacks to the scheduler
      ftrace: output formatting
      ftrace: dyn overflow debug

Steven Rostedt (19):
      rcu: add support for dynamic ticks and preempt rcu
      printk: dont wake up klogd with the rq locked
      ftrace: add preempt_enable/disable notrace macros
      x86: add notrace annotations to vsyscall.
      ftrace: latency tracer infrastructure
      ftrace: function tracer
      ftrace: make the task state char-string visible to all
      ftrace: add tracing of context switches
      ftrace: tracer for scheduler wakeup latency
      ftrace: trace irq disabled critical timings
      ftrace: trace preempt off critical timings
      ftrace: have ftrace use its ret as the dummy function
      ftrace: remove ftrace_enabled variable
      ftrace: add notrace annotations for NMI routines
      ftrace: dynamic enabling/disabling of function calls
      ftrace: add ftrace_enabled sysctl to disable mcount function
      ftrace: calculate instruction instead of storing it
      ftrace: use an atomic counter for sorting
      ftrace: make "none" the default tracer

 Makefile                          |    3 +
 arch/x86/Kconfig                  |    1 +
 arch/x86/kernel/Makefile          |    1 +
 arch/x86/kernel/entry_32.S        |   27 +
 arch/x86/kernel/entry_64.S        |   37 +
 arch/x86/kernel/ftrace.c          |  237 ++++++
 arch/x86/kernel/nmi_32.c          |    3 +-
 arch/x86/kernel/nmi_64.c          |    6 +-
 arch/x86/kernel/process_32.c      |    3 +
 arch/x86/kernel/process_64.c      |    3 +
 arch/x86/kernel/traps_32.c        |   12 +-
 arch/x86/kernel/traps_64.c        |   11 +-
 arch/x86/kernel/vsyscall_64.c     |    3 +-
 arch/x86/lib/Makefile             |    1 +
 arch/x86/lib/thunk_32.S           |   47 ++
 arch/x86/lib/thunk_64.S           |   19 +-
 arch/x86/vdso/vclock_gettime.c    |   15 +-
 arch/x86/vdso/vgetcpu.c           |    3 +-
 include/asm-x86/irqflags.h        |   24 +-
 include/asm-x86/vsyscall.h        |    3 +-
 include/linux/ftrace.h            |   92 +++
 include/linux/hardirq.h           |   10 +
 include/linux/irqflags.h          |   13 +-
 include/linux/linkage.h           |    8 +
 include/linux/preempt.h           |   34 +-
 include/linux/rcuclassic.h        |    3 +
 include/linux/rcupreempt.h        |   22 +
 include/linux/sched.h             |   30 +
 kernel/Makefile                   |    2 +
 kernel/fork.c                     |    2 +-
 kernel/lockdep.c                  |   23 +-
 kernel/printk.c                   |   16 +-
 kernel/rcupreempt.c               |  224 ++++++-
 kernel/sched.c                    |   47 ++-
 kernel/softirq.c                  |    1 +
 kernel/sysctl.c                   |   11 +
 kernel/time/tick-sched.c          |    3 +
 kernel/trace/Kconfig              |  111 +++
 kernel/trace/Makefile             |   10 +
 kernel/trace/ftrace.c             |  521 +++++++++++++
 kernel/trace/trace.c              | 1547 +++++++++++++++++++++++++++++++++++++
 kernel/trace/trace.h              |  185 +++++
 kernel/trace/trace_functions.c    |   73 ++
 kernel/trace/trace_irqsoff.c      |  505 ++++++++++++
 kernel/trace/trace_sched_switch.c |  125 +++
 kernel/trace/trace_sched_wakeup.c |  310 ++++++++
 lib/Kconfig.debug                 |    2 +
 lib/smp_processor_id.c            |    2 +-
 48 files changed, 4324 insertions(+), 67 deletions(-)
 create mode 100644 arch/x86/kernel/ftrace.c
 create mode 100644 arch/x86/lib/thunk_32.S
 create mode 100644 include/linux/ftrace.h
 create mode 100644 kernel/trace/Kconfig
 create mode 100644 kernel/trace/Makefile
 create mode 100644 kernel/trace/ftrace.c
 create mode 100644 kernel/trace/trace.c
 create mode 100644 kernel/trace/trace.h
 create mode 100644 kernel/trace/trace_functions.c
 create mode 100644 kernel/trace/trace_irqsoff.c
 create mode 100644 kernel/trace/trace_sched_switch.c
 create mode 100644 kernel/trace/trace_sched_wakeup.c


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [git pull] latency tracer
  2008-02-08 21:45 [git pull] latency tracer Ingo Molnar
@ 2008-02-09  7:01 ` Ingo Molnar
  2008-02-09  7:23 ` Andrew Morton
  2008-02-09 14:21 ` Ingo Molnar
  2 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2008-02-09  7:01 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Steven Rostedt, linux-kernel, Andrew Morton


* Ingo Molnar <mingo@elte.hu> wrote:

> It does include one very interesting new feature that deserves to be 
> mentioned outside of the shortlog: 'dynamic ftrace' - which is a 
> transparent kernel-image-patcher mechanism that lazily patches out 
> mcount callsites from all functions that get executed. [if tracing is 
> disabled] These patched out callsites are remembered, and are patched 
> back in when tracing is enabled.
> 
> This technique does not just accelelerate the "tracing disabled" case 
> enormously, we were in fact unable to measure _any_ performance 
> difference (within noise) between an mcount-enabled dyn-ftrace [but 
> tracing-disabled] and a vanilla kernel (!), on modern CPUs.

hot off the presses: Steve has just finished doing a complete set of 
lmbench and hbackbench runs (on 2.8GHz Xeons, dual socket). The 
comparison results are at:

    http://rostedt.homelinux.com/dyn-ftrace-lmbench/lmbench-table

the results show zero lmbench/hackbench overhead from dyn-ftrace (with 
thousands of functions instrumented) apart of the usual lmbench jitter.

The core kernel results for example [these used to be rather sensitive 
on mcount overhead]:

Host                 OS  Mhz null null      open slct sig  sig  fork exec sh
                             call  I/O stat clos TCP  inst hndl proc proc proc
--------- ------------- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
ftrace-jm  Linux 2.6.24 2783 0.65 0.74 4.74 6.96 5.28 0.76 4.29 290. 866. 2626
ftrace-no  Linux 2.6.24 2784 0.65 0.74 4.75 7.14 5.31 0.76 3.92 282. 837. 2591
no-patche  Linux 2.6.24 2786 0.64 0.71 4.86 7.10 5.34 0.78 3.89 283. 829. 2572
patched-n  Linux 2.6.24 2784 0.64 0.71 4.72 6.98 5.35 0.78 3.94 284. 832. 2582

"ftrace-jm": dyn-ftrace, 2-byte JMPs patched in the mcount callsite 
"ftrace-no": dyn-ftrace, 5-byte NOPs patched in (devel patch, not in 
             this pull request)
"no-patche": no patches [vanilla Linus -git kernel]
"patched-n": patched with the ftrace tree, all tracer options off

i can see an outlier in the "Create" results - that's noise i think 
because the patched+options-off kernel is in essence the same as 
vanilla. "File reread" is noisy and unreliable as ever. 16-task 
ctx-switch results are noisy too (especially the 64k working set ones) - 
this is a HT system hence the multi-threaded results are fundamentally 
noisy due to sibling interaction.

The hackbench results look good too.

enabling full tracing of all the tens of thousands of kernel functions 
makes things measurably slower - but that is expected. (filtered 
patching of a user-selected list of function names is an upcoming 
feature)

the full raw results are at:

   http://rostedt.homelinux.com/dyn-ftrace-lmbench/

	Ingo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [git pull] latency tracer
  2008-02-08 21:45 [git pull] latency tracer Ingo Molnar
  2008-02-09  7:01 ` Ingo Molnar
@ 2008-02-09  7:23 ` Andrew Morton
  2008-02-09  7:37   ` Ingo Molnar
  2008-02-09 14:21 ` Ingo Molnar
  2 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2008-02-09  7:23 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linus Torvalds, Steven Rostedt, linux-kernel

On Fri, 8 Feb 2008 22:45:22 +0100 Ingo Molnar <mingo@elte.hu> wrote:

> Linus, please pull the latency tracer tree from:
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched.git
> 
> Find the shortlog below.
> 
> This is the latency tracer from -rt

I've never seen any of this code before and googling several of the 
patch titles turns up this email and nothing else.

Could we get the patches out for review in the usual way please?

Bear in mind that people will actually want to understand how this
code works.   Particularly architecture maintainers.  (I assume it's
portable to non-x86?).


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [git pull] latency tracer
  2008-02-09  7:23 ` Andrew Morton
@ 2008-02-09  7:37   ` Ingo Molnar
  2008-02-09  8:05     ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2008-02-09  7:37 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linus Torvalds, Steven Rostedt, linux-kernel


* Andrew Morton <akpm@linux-foundation.org> wrote:

> On Fri, 8 Feb 2008 22:45:22 +0100 Ingo Molnar <mingo@elte.hu> wrote:
> 
> > Linus, please pull the latency tracer tree from:
> > 
> >    git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched.git
> > 
> > Find the shortlog below.
> > 
> > This is the latency tracer from -rt
> 
> I've never seen any of this code before and googling several of the 
> patch titles turns up this email and nothing else.

there might be some confusion here. Google for "mcount tracing utility" 
- there's 2270 hits. There's been 8 full series posted to lkml in the 
past month:

 Date: Thu, 03 Jan 2008 02:16:09 -0500
 Subject: [RFC PATCH 00/11] mcount tracing utility

 Date: Wed, 09 Jan 2008 18:29:14 -0500
 Subject: [RFC PATCH 00/22 -v2] mcount and latency tracing utility -v2

 Date: Tue, 15 Jan 2008 15:49:07 -0500
 Subject: [RFC PATCH 00/30 v3] mcount and latency tracing utility -v3

 Date: Mon, 21 Jan 2008 10:22:31 -0500
 Subject: [RFC PATCH 00/23 -v4] mcount and latency tracing utility -v4

 Date: Wed, 23 Jan 2008 11:02:36 -0500
 Subject: [PATCH 00/20 -v5] mcount and latency tracing utility -v5

 Date: Fri, 25 Jan 2008 23:21:52 -0500
 Subject: [PATCH 00/23 -v6] mcount and latency tracing utility -v6

 Date: Tue, 29 Jan 2008 22:15:21 -0500
 Subject: [PATCH 00/22 -v7] mcount and latency tracing utility -v7

 Date: Wed, 30 Jan 2008 16:03:57 -0500
 Subject: [PATCH 00/23 -v8] mcount and latency tracing utility -v8

it derives from the same latency tracer code that we wrote for -rt that 
has been around for years:

   http://people.redhat.com/mingo/latency-tracing-patches/

we renamed the concept to 'ftrace' during pre-merge cleanups, perhaps 
that is what caused you to not recognize this? (mcount is a confusing 
name and ties it to a gcc feature while there's nothing gcc specific 
about this concept.)

	Ingo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [git pull] latency tracer
  2008-02-09  7:37   ` Ingo Molnar
@ 2008-02-09  8:05     ` Andrew Morton
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2008-02-09  8:05 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linus Torvalds, Steven Rostedt, linux-kernel

On Sat, 9 Feb 2008 08:37:56 +0100 Ingo Molnar <mingo@elte.hu> wrote:

> 
> * Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > On Fri, 8 Feb 2008 22:45:22 +0100 Ingo Molnar <mingo@elte.hu> wrote:
> > 
> > > Linus, please pull the latency tracer tree from:
> > > 
> > >    git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched.git
> > > 
> > > Find the shortlog below.
> > > 
> > > This is the latency tracer from -rt
> > 
> > I've never seen any of this code before and googling several of the 
> > patch titles turns up this email and nothing else.
> 
> there might be some confusion here. Google for "mcount tracing utility" 
> - there's 2270 hits. There's been 8 full series posted to lkml in the 
> past month:
> 
> ..
>
> we renamed the concept to 'ftrace' during pre-merge cleanups, perhaps 
> that is what caused you to not recognize this? (mcount is a confusing 
> name and ties it to a gcc feature while there's nothing gcc specific 
> about this concept.)
> 

Oh.  That clang you heard was a penny dropping.

I'd been kind of ignoring those patches assuming I had a couple more
months.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [git pull] latency tracer
  2008-02-08 21:45 [git pull] latency tracer Ingo Molnar
  2008-02-09  7:01 ` Ingo Molnar
  2008-02-09  7:23 ` Andrew Morton
@ 2008-02-09 14:21 ` Ingo Molnar
  2 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2008-02-09 14:21 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Steven Rostedt, linux-kernel, Andrew Morton


* Ingo Molnar <mingo@elte.hu> wrote:

> Linus, please pull the latency tracer tree from:
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched.git

i've updated the git tree - find the shortlog below.

It's a few small changes (got rid of the DONT_TRACE_NMI complication, 
Steve removed the max_mutex, removed 2 lines of leftover debugging 
code), and streamlined the splitup to reduce the number of patches from 
24 to 18. No bugs have been found in the tracer code in overnight 
testing, and the queue still is bisectable at every patch point with 
tracers on and off as well.
 
(i've attached the delta patch below the diffstat, relative to 
yesterday's tree - the full patch would be too large for lkml.)

	Ingo

------------------>
Arnaldo Carvalho de Melo (2):
      ftrace: annotate core code that should not be traced
      ftrace: add basic support for gcc profiler instrumentation

Ingo Molnar (2):
      sched: add latency tracer callbacks to the scheduler
      tracing: add notrace to linkage.h

Steven Rostedt (14):
      rcu: add support for dynamic ticks and preempt rcu
      printk: dont wake up klogd with the rq locked
      ftrace: add preempt_enable/disable notrace macros
      ftrace: make the task state char-string visible to all
      x86: add notrace annotations to vsyscall.
      ftrace: add notrace annotations for NMI routines
      ftrace: latency tracer infrastructure
      ftrace: function tracer
      ftrace: add tracing of context switches
      ftrace: tracer for scheduler wakeup latency
      ftrace: trace irq disabled critical timings
      ftrace: trace preempt off critical timings
      ftrace: dynamic enabling/disabling of function calls
      ftrace: add ftrace_enabled sysctl to disable mcount function

 Makefile                          |    3 +
 arch/x86/Kconfig                  |    1 +
 arch/x86/kernel/Makefile          |    1 +
 arch/x86/kernel/entry_32.S        |   27 +
 arch/x86/kernel/entry_64.S        |   37 +
 arch/x86/kernel/ftrace.c          |  237 ++++++
 arch/x86/kernel/nmi_32.c          |    3 +-
 arch/x86/kernel/nmi_64.c          |    6 +-
 arch/x86/kernel/process_32.c      |    3 +
 arch/x86/kernel/process_64.c      |    3 +
 arch/x86/kernel/traps_32.c        |   12 +-
 arch/x86/kernel/traps_64.c        |   11 +-
 arch/x86/kernel/vsyscall_64.c     |    3 +-
 arch/x86/lib/Makefile             |    1 +
 arch/x86/lib/thunk_32.S           |   47 ++
 arch/x86/lib/thunk_64.S           |   19 +-
 arch/x86/vdso/vclock_gettime.c    |   15 +-
 arch/x86/vdso/vgetcpu.c           |    3 +-
 include/asm-x86/irqflags.h        |   24 +-
 include/asm-x86/vsyscall.h        |    3 +-
 include/linux/ftrace.h            |   93 +++
 include/linux/hardirq.h           |   10 +
 include/linux/irqflags.h          |   13 +-
 include/linux/linkage.h           |    2 +
 include/linux/preempt.h           |   34 +-
 include/linux/rcuclassic.h        |    3 +
 include/linux/rcupreempt.h        |   22 +
 include/linux/sched.h             |   30 +
 kernel/Makefile                   |    2 +
 kernel/fork.c                     |    2 +-
 kernel/lockdep.c                  |   23 +-
 kernel/printk.c                   |   16 +-
 kernel/rcupreempt.c               |  224 ++++++-
 kernel/sched.c                    |   47 ++-
 kernel/softirq.c                  |    1 +
 kernel/sysctl.c                   |   11 +
 kernel/time/tick-sched.c          |    3 +
 kernel/trace/Kconfig              |  107 +++
 kernel/trace/Makefile             |   10 +
 kernel/trace/ftrace.c             |  519 +++++++++++++
 kernel/trace/trace.c              | 1547 +++++++++++++++++++++++++++++++++++++
 kernel/trace/trace.h              |  185 +++++
 kernel/trace/trace_functions.c    |   73 ++
 kernel/trace/trace_irqsoff.c      |  486 ++++++++++++
 kernel/trace/trace_sched_switch.c |  125 +++
 kernel/trace/trace_sched_wakeup.c |  310 ++++++++
 lib/Kconfig.debug                 |    2 +
 lib/smp_processor_id.c            |    2 +-
 48 files changed, 4294 insertions(+), 67 deletions(-)
 create mode 100644 arch/x86/kernel/ftrace.c
 create mode 100644 arch/x86/lib/thunk_32.S
 create mode 100644 include/linux/ftrace.h
 create mode 100644 kernel/trace/Kconfig
 create mode 100644 kernel/trace/Makefile
 create mode 100644 kernel/trace/ftrace.c
 create mode 100644 kernel/trace/trace.c
 create mode 100644 kernel/trace/trace.h
 create mode 100644 kernel/trace/trace_functions.c
 create mode 100644 kernel/trace/trace_irqsoff.c
 create mode 100644 kernel/trace/trace_sched_switch.c
 create mode 100644 kernel/trace/trace_sched_wakeup.c


--------------{ delta patch }------------->

Index: linux/arch/x86/kernel/nmi_32.c
===================================================================
--- linux.orig/arch/x86/kernel/nmi_32.c
+++ linux/arch/x86/kernel/nmi_32.c
@@ -320,7 +320,7 @@ EXPORT_SYMBOL(touch_nmi_watchdog);
 
 extern void die_nmi(struct pt_regs *, const char *msg);
 
-notrace_nmi __kprobes int
+notrace __kprobes int
 nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
 {
 
Index: linux/arch/x86/kernel/nmi_64.c
===================================================================
--- linux.orig/arch/x86/kernel/nmi_64.c
+++ linux/arch/x86/kernel/nmi_64.c
@@ -314,7 +314,7 @@ void touch_nmi_watchdog(void)
 }
 EXPORT_SYMBOL(touch_nmi_watchdog);
 
-notrace_nmi __kprobes int
+notrace __kprobes int
 nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
 {
 	int sum;
@@ -386,7 +386,7 @@ nmi_watchdog_tick(struct pt_regs *regs, 
 
 static unsigned ignore_nmis;
 
-asmlinkage notrace_nmi __kprobes void
+asmlinkage notrace __kprobes void
 do_nmi(struct pt_regs *regs, long error_code)
 {
 	nmi_enter();
Index: linux/arch/x86/kernel/traps_32.c
===================================================================
--- linux.orig/arch/x86/kernel/traps_32.c
+++ linux/arch/x86/kernel/traps_32.c
@@ -665,7 +665,7 @@ gp_in_kernel:
 	}
 }
 
-static notrace_nmi __kprobes void
+static notrace __kprobes void
 mem_parity_error(unsigned char reason, struct pt_regs * regs)
 {
 	printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x on "
@@ -688,7 +688,7 @@ mem_parity_error(unsigned char reason, s
 	clear_mem_error(reason);
 }
 
-static notrace_nmi __kprobes void
+static notrace __kprobes void
 io_check_error(unsigned char reason, struct pt_regs * regs)
 {
 	unsigned long i;
@@ -705,7 +705,7 @@ io_check_error(unsigned char reason, str
 	outb(reason, 0x61);
 }
 
-static notrace_nmi __kprobes void
+static notrace __kprobes void
 unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
 {
 #ifdef CONFIG_MCA
@@ -727,7 +727,7 @@ unknown_nmi_error(unsigned char reason, 
 
 static DEFINE_SPINLOCK(nmi_print_lock);
 
-void notrace_nmi __kprobes die_nmi(struct pt_regs *regs, const char *msg)
+void notrace __kprobes die_nmi(struct pt_regs *regs, const char *msg)
 {
 	if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 2, SIGINT) ==
 	    NOTIFY_STOP)
@@ -758,7 +758,7 @@ void notrace_nmi __kprobes die_nmi(struc
 	do_exit(SIGSEGV);
 }
 
-static notrace_nmi __kprobes void default_do_nmi(struct pt_regs *regs)
+static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
 {
 	unsigned char reason = 0;
 
@@ -798,7 +798,7 @@ static notrace_nmi __kprobes void defaul
 
 static int ignore_nmis;
 
-notrace_nmi __kprobes void do_nmi(struct pt_regs *regs, long error_code)
+notrace __kprobes void do_nmi(struct pt_regs *regs, long error_code)
 {
 	int cpu;
 
Index: linux/arch/x86/kernel/traps_64.c
===================================================================
--- linux.orig/arch/x86/kernel/traps_64.c
+++ linux/arch/x86/kernel/traps_64.c
@@ -598,7 +598,7 @@ void die(const char * str, struct pt_reg
 	oops_end(flags, regs, SIGSEGV);
 }
 
-notrace_nmi __kprobes void
+notrace __kprobes void
 die_nmi(char *str, struct pt_regs *regs, int do_panic)
 {
 	unsigned long flags = oops_begin();
@@ -766,7 +766,7 @@ asmlinkage void __kprobes do_general_pro
 	die("general protection fault", regs, error_code);
 }
 
-static notrace_nmi __kprobes void
+static notrace __kprobes void
 mem_parity_error(unsigned char reason, struct pt_regs * regs)
 {
 	printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n",
@@ -790,7 +790,7 @@ mem_parity_error(unsigned char reason, s
 	outb(reason, 0x61);
 }
 
-static notrace_nmi __kprobes void
+static notrace __kprobes void
 io_check_error(unsigned char reason, struct pt_regs * regs)
 {
 	printk("NMI: IOCK error (debug interrupt?)\n");
@@ -804,7 +804,7 @@ io_check_error(unsigned char reason, str
 	outb(reason, 0x61);
 }
 
-static notrace_nmi __kprobes void
+static notrace __kprobes void
 unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
 {
 	printk(KERN_EMERG "Uhhuh. NMI received for unknown reason %02x.\n",
@@ -819,7 +819,7 @@ unknown_nmi_error(unsigned char reason, 
 
 /* Runs on IST stack. This code must keep interrupts off all the time.
    Nested NMIs are prevented by the CPU. */
-asmlinkage notrace_nmi  __kprobes void default_do_nmi(struct pt_regs *regs)
+asmlinkage notrace  __kprobes void default_do_nmi(struct pt_regs *regs)
 {
 	unsigned char reason = 0;
 	int cpu;
Index: linux/include/linux/ftrace.h
===================================================================
--- linux.orig/include/linux/ftrace.h
+++ linux/include/linux/ftrace.h
@@ -2,6 +2,7 @@
 #define _LINUX_FTRACE_H
 
 #ifdef CONFIG_FTRACE
+
 #include <linux/linkage.h>
 
 extern int ftrace_enabled;
Index: linux/include/linux/linkage.h
===================================================================
--- linux.orig/include/linux/linkage.h
+++ linux/include/linux/linkage.h
@@ -5,12 +5,6 @@
 
 #define notrace __attribute__((no_instrument_function))
 
-#ifdef CONFIG_DONT_TRACE_NMI
-# define notrace_nmi __attribute__((no_instrument_function))
-#else
-# define notrace_nmi
-#endif
-
 #ifdef __cplusplus
 #define CPP_ASMLINKAGE extern "C"
 #else
Index: linux/kernel/trace/Kconfig
===================================================================
--- linux.orig/kernel/trace/Kconfig
+++ linux/kernel/trace/Kconfig
@@ -11,9 +11,6 @@ config TRACING
 	bool
 	select DEBUG_FS
 
-config DONT_TRACE_NMI
-	bool
-
 config FTRACE
 	bool "Kernel Function Tracer"
 	depends on DEBUG_KERNEL && HAVE_FTRACE
@@ -95,7 +92,6 @@ config DYNAMIC_FTRACE
 	bool "enable/disable ftrace tracepoints dynamically"
 	depends on FTRACE
 	default y
-	select DONT_TRACE_NMI
 	help
          This option will modify all the calls to ftrace dynamically
 	 (will patch them out of the binary image and replaces them
Index: linux/kernel/trace/ftrace.c
===================================================================
--- linux.orig/kernel/trace/ftrace.c
+++ linux/kernel/trace/ftrace.c
@@ -346,8 +346,6 @@ static int notrace __ftrace_update_code(
 
 		/* all CPUS are stopped, we are safe to modify code */
 		hlist_for_each_entry(p, t, &head, node) {
-			unsigned short y;
-			y = *(short *)(p->ip-5);
 			ftrace_code_disable(p);
 			ftrace_update_cnt++;
 		}
Index: linux/kernel/trace/trace_irqsoff.c
===================================================================
--- linux.orig/kernel/trace/trace_irqsoff.c
+++ linux/kernel/trace/trace_irqsoff.c
@@ -21,8 +21,6 @@
 static struct trace_array		*irqsoff_trace __read_mostly;
 static int				tracer_enabled __read_mostly;
 
-static __cacheline_aligned_in_smp	DEFINE_MUTEX(max_mutex);
-
 static DEFINE_PER_CPU(int, tracing_cpu);
 
 enum {
@@ -147,8 +145,7 @@ check_critical_timing(struct trace_array
 
 	latency = nsecs_to_usecs(delta);
 
-	if (data->critical_sequence != max_sequence ||
-	    !mutex_trylock(&max_mutex))
+	if (data->critical_sequence != max_sequence)
 		goto out;
 
 	tracing_max_latency = delta;
@@ -183,8 +180,6 @@ check_critical_timing(struct trace_array
 
 	max_sequence++;
 
-	mutex_unlock(&max_mutex);
-
 out:
 	data->critical_sequence = max_sequence;
 	data->preempt_timestamp = now(cpu);
@@ -409,16 +404,6 @@ static void notrace irqsoff_tracer_close
 		start_irqsoff_tracer(iter->tr);
 }
 
-static void irqsoff_tracer_start(struct trace_iterator *iter)
-{
-	mutex_lock(&max_mutex);
-}
-
-static void irqsoff_tracer_stop(struct trace_iterator *iter)
-{
-	mutex_unlock(&max_mutex);
-}
-
 #ifdef CONFIG_IRQSOFF_TRACER
 static void irqsoff_tracer_init(struct trace_array *tr)
 {
@@ -433,8 +418,6 @@ static struct tracer irqsoff_tracer __re
 	.reset		= irqsoff_tracer_reset,
 	.open		= irqsoff_tracer_open,
 	.close		= irqsoff_tracer_close,
-	.start		= irqsoff_tracer_start,
-	.stop		= irqsoff_tracer_stop,
 	.ctrl_update	= irqsoff_tracer_ctrl_update,
 	.print_max	= 1,
 };
@@ -458,8 +441,6 @@ static struct tracer preemptoff_tracer _
 	.reset		= irqsoff_tracer_reset,
 	.open		= irqsoff_tracer_open,
 	.close		= irqsoff_tracer_close,
-	.start		= irqsoff_tracer_start,
-	.stop		= irqsoff_tracer_stop,
 	.ctrl_update	= irqsoff_tracer_ctrl_update,
 	.print_max	= 1,
 };
@@ -468,27 +449,27 @@ static struct tracer preemptoff_tracer _
 # define register_preemptoff(trace) do { } while (0)
 #endif
 
-
 #if defined(CONFIG_IRQSOFF_TRACER) && \
 	defined(CONFIG_PREEMPT_TRACER)
+
 static void preemptirqsoff_tracer_init(struct trace_array *tr)
 {
 	trace_type = TRACER_IRQS_OFF | TRACER_PREEMPT_OFF;
 
 	__irqsoff_tracer_init(tr);
 }
+
 static struct tracer preemptirqsoff_tracer __read_mostly =
 {
-	.name = "preemptirqsoff",
-	.init = preemptirqsoff_tracer_init,
-	.reset = irqsoff_tracer_reset,
-	.open = irqsoff_tracer_open,
-	.close = irqsoff_tracer_close,
-	.start = irqsoff_tracer_start,
-	.stop = irqsoff_tracer_stop,
-	.ctrl_update = irqsoff_tracer_ctrl_update,
-	.print_max = 1,
+	.name		= "preemptirqsoff",
+	.init		= preemptirqsoff_tracer_init,
+	.reset		= irqsoff_tracer_reset,
+	.open		= irqsoff_tracer_open,
+	.close		= irqsoff_tracer_close,
+	.ctrl_update	= irqsoff_tracer_ctrl_update,
+	.print_max	= 1,
 };
+
 # define register_preemptirqsoff(trace) register_tracer(&trace)
 #else
 # define register_preemptirqsoff(trace) do { } while (0)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-09 14:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-08 21:45 [git pull] latency tracer Ingo Molnar
2008-02-09  7:01 ` Ingo Molnar
2008-02-09  7:23 ` Andrew Morton
2008-02-09  7:37   ` Ingo Molnar
2008-02-09  8:05     ` Andrew Morton
2008-02-09 14:21 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).