All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] [GIT PULL][v3.6] tracing: simple updates
@ 2012-06-15  1:01 Steven Rostedt
  2012-06-15  1:01 ` [PATCH 1/3] ftrace: Remove a superfluous check Steven Rostedt
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Steven Rostedt @ 2012-06-15  1:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 831 bytes --]


Ingo,

I understand that I'm currently on Thomas's "most loved" list, I figured
I would send out these simple changes. Nothing that should cause me
another brown paper bag fix in this.

Please pull the latest tip/perf/core tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
tip/perf/core

Head SHA1: 7374e82771c6d5a9af2080be46f64a5826c7efb1


Borislav Petkov (1):
      ftrace: Remove a superfluous check

Steven Rostedt (2):
      tracing: Add comments for the other bits of ftrace_event_call.flags
      tracing: Register the ftrace internal events during early boot

----
 include/linux/ftrace_event.h |    3 +++
 kernel/trace/ftrace.c        |    8 ++------
 kernel/trace/trace_output.c  |    2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH 1/3] ftrace: Remove a superfluous check
  2012-06-15  1:01 [PATCH 0/3] [GIT PULL][v3.6] tracing: simple updates Steven Rostedt
@ 2012-06-15  1:01 ` Steven Rostedt
  2012-06-15  1:01 ` [PATCH 2/3] tracing: Add comments for the other bits of ftrace_event_call.flags Steven Rostedt
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2012-06-15  1:01 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Borislav Petkov,
	John Kacur, Borislav Petkov

[-- Attachment #1: Type: text/plain, Size: 1460 bytes --]

From: Borislav Petkov <bp@amd64.org>

register_ftrace_function() checks ftrace_disabled and calls
__register_ftrace_function which does it again.

Drop the first check and add the unlikely hint to the second one. Also,
drop the label as John correctly notices.

No functional change.

Link: http://lkml.kernel.org/r/20120329171140.GE6409@aftab

Cc: Borislav Petkov <bp@amd64.org>
Cc: John Kacur <jkacur@redhat.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index a008663..b4f20fb 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -312,7 +312,7 @@ static int remove_ftrace_list_ops(struct ftrace_ops **list,
 
 static int __register_ftrace_function(struct ftrace_ops *ops)
 {
-	if (ftrace_disabled)
+	if (unlikely(ftrace_disabled))
 		return -ENODEV;
 
 	if (FTRACE_WARN_ON(ops == &global_ops))
@@ -4299,16 +4299,12 @@ int register_ftrace_function(struct ftrace_ops *ops)
 
 	mutex_lock(&ftrace_lock);
 
-	if (unlikely(ftrace_disabled))
-		goto out_unlock;
-
 	ret = __register_ftrace_function(ops);
 	if (!ret)
 		ret = ftrace_startup(ops, 0);
 
-
- out_unlock:
 	mutex_unlock(&ftrace_lock);
+
 	return ret;
 }
 EXPORT_SYMBOL_GPL(register_ftrace_function);
-- 
1.7.10



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH 2/3] tracing: Add comments for the other bits of ftrace_event_call.flags
  2012-06-15  1:01 [PATCH 0/3] [GIT PULL][v3.6] tracing: simple updates Steven Rostedt
  2012-06-15  1:01 ` [PATCH 1/3] ftrace: Remove a superfluous check Steven Rostedt
@ 2012-06-15  1:01 ` Steven Rostedt
  2012-06-15  1:01 ` [PATCH 3/3] tracing: Register the ftrace internal events during early boot Steven Rostedt
  2012-06-20 12:35 ` [PATCH 0/3] [GIT PULL][v3.6] tracing: simple updates Ingo Molnar
  3 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2012-06-15  1:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner

[-- Attachment #1: Type: text/plain, Size: 1149 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

	TRACE_EVENT_FL_ENABLED_BIT,
	TRACE_EVENT_FL_FILTERED_BIT,
	TRACE_EVENT_FL_RECORDED_CMD_BIT,

Have comments about what they are, but:

	TRACE_EVENT_FL_CAP_ANY_BIT,
	TRACE_EVENT_FL_NO_SET_FILTER_BIT,
	TRACE_EVENT_FL_IGNORE_ENABLE_BIT,

do not, making them second class citizens. To prevent another
class warfare, these bits have protested for their right to be
commented. And By Golly! I'll give them what they want!

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/ftrace_event.h |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 176a939..1aff183 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -207,6 +207,9 @@ struct ftrace_event_call {
 	 *   bit 1:		enabled
 	 *   bit 2:		filter_active
 	 *   bit 3:		enabled cmd record
+	 *   bit 4:		allow trace by non root (cap any)
+	 *   bit 5:		failed to apply filter
+	 *   bit 6:		ftrace internal event (do not enable)
 	 *
 	 * Changes to flags must hold the event_mutex.
 	 *
-- 
1.7.10



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH 3/3] tracing: Register the ftrace internal events during early boot
  2012-06-15  1:01 [PATCH 0/3] [GIT PULL][v3.6] tracing: simple updates Steven Rostedt
  2012-06-15  1:01 ` [PATCH 1/3] ftrace: Remove a superfluous check Steven Rostedt
  2012-06-15  1:01 ` [PATCH 2/3] tracing: Add comments for the other bits of ftrace_event_call.flags Steven Rostedt
@ 2012-06-15  1:01 ` Steven Rostedt
  2012-06-20 12:35 ` [PATCH 0/3] [GIT PULL][v3.6] tracing: simple updates Ingo Molnar
  3 siblings, 0 replies; 5+ messages in thread
From: Steven Rostedt @ 2012-06-15  1:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

All trace events including ftrace internel events (like trace_printk
and function tracing), register functions that describe how to print
their output. The events may be recorded as soon as the ring buffer
is allocated, but they are just raw binary in the buffer. The mapping
of event ids to how to print them are held within a structure that
is registered on system boot.

If a crash happens in boot up before these functions are registered
then their output (via ftrace_dump_on_oops) will be useless:

Dumping ftrace buffer:
---------------------------------
   <...>-1       0.... 319705us : Unknown type 6
---------------------------------

This can be quite frustrating for a kernel developer trying to see
what is going wrong.

There's no reason to register them so late in the boot up process.
They can be registered by early_initcall().

Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_output.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index df611a0..123b189 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -1325,4 +1325,4 @@ __init static int init_events(void)
 
 	return 0;
 }
-device_initcall(init_events);
+early_initcall(init_events);
-- 
1.7.10



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 0/3] [GIT PULL][v3.6] tracing: simple updates
  2012-06-15  1:01 [PATCH 0/3] [GIT PULL][v3.6] tracing: simple updates Steven Rostedt
                   ` (2 preceding siblings ...)
  2012-06-15  1:01 ` [PATCH 3/3] tracing: Register the ftrace internal events during early boot Steven Rostedt
@ 2012-06-20 12:35 ` Ingo Molnar
  3 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2012-06-20 12:35 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: linux-kernel, Ingo Molnar, Andrew Morton, Thomas Gleixner


* Steven Rostedt <rostedt@goodmis.org> wrote:

> Ingo,
> 
> I understand that I'm currently on Thomas's "most loved" list, I figured
> I would send out these simple changes. Nothing that should cause me
> another brown paper bag fix in this.
> 
> Please pull the latest tip/perf/core tree, which can be found at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
> tip/perf/core
> 
> Head SHA1: 7374e82771c6d5a9af2080be46f64a5826c7efb1
> 
> 
> Borislav Petkov (1):
>       ftrace: Remove a superfluous check
> 
> Steven Rostedt (2):
>       tracing: Add comments for the other bits of ftrace_event_call.flags
>       tracing: Register the ftrace internal events during early boot
> 
> ----
>  include/linux/ftrace_event.h |    3 +++
>  kernel/trace/ftrace.c        |    8 ++------
>  kernel/trace/trace_output.c  |    2 +-
>  3 files changed, 6 insertions(+), 7 deletions(-)

Pulled, thanks Steve!

	Ingo

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

end of thread, other threads:[~2012-06-20 12:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-15  1:01 [PATCH 0/3] [GIT PULL][v3.6] tracing: simple updates Steven Rostedt
2012-06-15  1:01 ` [PATCH 1/3] ftrace: Remove a superfluous check Steven Rostedt
2012-06-15  1:01 ` [PATCH 2/3] tracing: Add comments for the other bits of ftrace_event_call.flags Steven Rostedt
2012-06-15  1:01 ` [PATCH 3/3] tracing: Register the ftrace internal events during early boot Steven Rostedt
2012-06-20 12:35 ` [PATCH 0/3] [GIT PULL][v3.6] tracing: simple updates Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.