All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@linux.intel.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Fix powerTOP regression with 2.6.39-rc5
Date: Fri, 06 May 2011 13:08:23 -0700	[thread overview]
Message-ID: <4DC45537.6070609@linux.intel.com> (raw)

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

 From c2db3ab8cff0d1cfb9582fc149df2794978a332e Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Thu, 5 May 2011 23:55:18 -0400
Subject: [PATCH] Regression: partial revert "tracing: Remove lock_depth 
from event entry"

This patch partially reverts commit 
e6e1e2593592a8f6f6380496655d8c6f67431266.
That commit changed the structure layout of the trace structure, which in
turn broke PowerTOP (1.9x generation) quite badly.

I appreciate not wanting to expose the variable in question, and 
PowerTOP was
not using it, so I've replaced the variable with just a padding field....
... that way if in the future a new field is needed it can just use this 
padding
variable.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
  include/linux/ftrace_event.h |    1 +
  kernel/trace/trace.c         |    1 +
  kernel/trace/trace_events.c  |    1 +
  3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 22b32af1..b5a550a 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -37,6 +37,7 @@ struct trace_entry {
      unsigned char        flags;
      unsigned char        preempt_count;
      int            pid;
+    int            padding;
  };

  #define FTRACE_MAX_EVENT                        \
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d38c16a..1cb49be 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1110,6 +1110,7 @@ tracing_generic_entry_update(struct trace_entry 
*entry, unsigned long flags,

      entry->preempt_count        = pc & 0xff;
      entry->pid            = (tsk) ? tsk->pid : 0;
+    entry->padding            = 0;
      entry->flags =
  #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
          (irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index e88f74f..2fe1103 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -116,6 +116,7 @@ static int trace_define_common_fields(void)
      __common_field(unsigned char, flags);
      __common_field(unsigned char, preempt_count);
      __common_field(int, pid);
+    __common_field(int, padding);

      return ret;
  }
-- 
1.7.2.2


[-- Attachment #2: 0001-Regression-partial-revert-tracing-Remove-lock_depth.patch --]
[-- Type: text/plain, Size: 2126 bytes --]

>From c2db3ab8cff0d1cfb9582fc149df2794978a332e Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Thu, 5 May 2011 23:55:18 -0400
Subject: [PATCH] Regression: partial revert "tracing: Remove lock_depth from event entry"

This patch partially reverts commit e6e1e2593592a8f6f6380496655d8c6f67431266.
That commit changed the structure layout of the trace structure, which in
turn broke PowerTOP (1.9x generation) quite badly.

I appreciate not wanting to expose the variable in question, and PowerTOP was
not using it, so I've replaced the variable with just a padding byte....
... that way if in the future a new field is needed it can just use this padding
byte.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 include/linux/ftrace_event.h |    1 +
 kernel/trace/trace.c         |    1 +
 kernel/trace/trace_events.c  |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 22b32af1..b5a550a 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -37,6 +37,7 @@ struct trace_entry {
 	unsigned char		flags;
 	unsigned char		preempt_count;
 	int			pid;
+	int			padding;
 };
 
 #define FTRACE_MAX_EVENT						\
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d38c16a..1cb49be 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1110,6 +1110,7 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,
 
 	entry->preempt_count		= pc & 0xff;
 	entry->pid			= (tsk) ? tsk->pid : 0;
+	entry->padding			= 0;
 	entry->flags =
 #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
 		(irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index e88f74f..2fe1103 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -116,6 +116,7 @@ static int trace_define_common_fields(void)
 	__common_field(unsigned char, flags);
 	__common_field(unsigned char, preempt_count);
 	__common_field(int, pid);
+	__common_field(int, padding);
 
 	return ret;
 }
-- 
1.7.2.2


             reply	other threads:[~2011-05-06 20:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06 20:08 Arjan van de Ven [this message]
2011-05-06 20:20 ` Fix powerTOP regression with 2.6.39-rc5 Steven Rostedt
2011-05-06 20:51   ` Linus Torvalds
2011-05-06 21:10     ` Steven Rostedt
2011-05-06 21:24       ` Linus Torvalds
2011-05-06 21:14     ` Steven Rostedt
2011-05-06 21:28       ` Linus Torvalds
2011-05-06 21:29     ` Arjan van de Ven
2011-05-06 21:57       ` Steven Rostedt
2011-05-07  6:58     ` Ingo Molnar
2011-05-07 10:45       ` Steven Rostedt
2011-05-07 14:44         ` Ingo Molnar
2011-05-07 17:20           ` Steven Rostedt
2011-05-07 17:59             ` Arjan van de Ven
2011-05-08 21:08               ` Frederic Weisbecker
2011-05-08 21:56                 ` Arjan van de Ven
2011-05-07 19:00             ` Ingo Molnar
2011-05-10  3:07               ` Steven Rostedt
2011-05-10  4:44                 ` Dave Chinner
2011-05-10  5:39                   ` Steven Rostedt
2011-05-10  7:36                     ` Dave Chinner
2011-05-10  7:54                 ` Ingo Molnar
2011-05-10  8:09                 ` Ingo Molnar
2011-05-10  8:32                   ` Arjan van de Ven
2011-05-10  8:44                     ` Ingo Molnar
2011-05-10  9:14                       ` Pekka Enberg
2011-05-10  8:41                 ` Ingo Molnar
2011-05-10 13:06                   ` Steven Rostedt
2011-05-11 21:51                     ` Ingo Molnar
2011-05-11 22:36                       ` Steven Rostedt
2011-05-17  7:15                       ` Michael Rubin
2011-05-17 11:19                         ` Steven Rostedt
2011-05-17 13:24                           ` David Ahern
2011-05-17 13:27                             ` Steven Rostedt
2011-05-17 13:30                               ` Ingo Molnar
2011-05-10  8:47                 ` Ingo Molnar
2011-05-10 10:33                   ` Steven Rostedt
2011-05-10 19:13                     ` David Sharp
2011-05-09 23:37             ` David Sharp
2011-05-10  7:39               ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DC45537.6070609@linux.intel.com \
    --to=arjan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.