Skip to contentSkip to conversation

[2.6.37] tracing: various fixes

GIT PULL New Steven Rostedt 1 participant 4 messages Dec 2, 2010 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

Ingo,

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

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

John Reiser (1):
ftrace: Have recordmcount honor endianness in fn_ELF_R_INFO

Peter Zijlstra (1):
scripts/tags.sh: Add magic for trace-events

Slava Pestov (1):
tracing: Fix panic when lseek() called on "trace" opened for writing

----

 kernel/trace/trace.c   |   10 +++++++++-
 scripts/recordmcount.h |    2 +-
 scripts/tags.sh        |    4 +++-
 3 files changed, 13 insertions(+), 3 deletions(-)
author maintainer
#1 lore raw

PATCH 1/3 tracing: Fix panic when lseek() called on "trace" opened for writing

From: Slava Pestov <[email protected]>

The file_ops struct for the "trace" special file defined llseek as seq_lseek(). However, if the file was opened for writing only, seq_open() was not called, and the seek would dereference a null pointer, file->private_data.

This patch introduces a new wrapper for seq_lseek() which checks if the file descriptor is opened for reading first. If not, it does nothing.

LKML-Reference: <[email protected]>

---
 kernel/trace/trace.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
kernel/trace/trace.c +9 -1
index ee6a733..21db0de 100644
@@ -2339,11 +2339,19 @@ tracing_write_stub(struct file *filp, const char __user *ubuf,
 	return count;
 }
 
+static loff_t tracing_seek(struct file *file, loff_t offset, int origin)
+{
+	if (file->f_mode & FMODE_READ)
+		return seq_lseek(file, offset, origin);
+	else
+		return 0;
+}
+
 static const struct file_operations tracing_fops = {
 	.open		= tracing_open,
 	.read		= seq_read,
 	.write		= tracing_write_stub,
-	.llseek		= seq_lseek,
+	.llseek		= tracing_seek,
 	.release	= tracing_release,
 };
 
Signature · 1 line
1.7.2.3
author maintainer
#2 lore raw

PATCH 2/3 scripts/tags.sh: Add magic for trace-events

In reply to Steven Rostedt

From: Peter Zijlstra <[email protected]>

Make tags find the trace-event definitions

LKML-Reference: <1290591835.2072.438.camel@laptop>

---
 scripts/tags.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
scripts/tags.sh +3 -1
index 8509bb5..bbbe584 100755
@@ -125,7 +125,9 @@ exuberant()
 	-I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
 	--extra=+f --c-kinds=-px                                \
 	--regex-asm='/^ENTRY\(([^)]*)\).*/\1/'                  \
-	--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/'
+	--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
+	--regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/'		\
+	--regex-c++='/^DEFINE_EVENT\(([^,)]*).*/trace_\1/'
 
 	all_kconfigs | xargs $1 -a                              \
 	--langdef=kconfig --language-force=kconfig              \
Signature · 1 line
1.7.2.3
author maintainer
#3 lore raw

PATCH 3/3 ftrace: Have recordmcount honor endianness in fn_ELF_R_INFO

In reply to Steven Rostedt

From: John Reiser <[email protected]>

It looks to me like the change which introduced "virtual functions" forgot about cross-platform endianness.

Thank you to Arnaud for supplying before+after data files do_mounts*.o.

This fixes a MIPS build failure triggered by recordmcount.

---
 scripts/recordmcount.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/recordmcount.h +1 -1
index 58e933a..3966717 100644
@@ -119,7 +119,7 @@ static uint_t (*Elf_r_sym)(Elf_Rel const *rp) = fn_ELF_R_SYM;
 
 static void fn_ELF_R_INFO(Elf_Rel *const rp, unsigned sym, unsigned type)
 {
-	rp->r_info = ELF_R_INFO(sym, type);
+	rp->r_info = _w(ELF_R_INFO(sym, type));
 }
 static void (*Elf_r_info)(Elf_Rel *const rp, unsigned sym, unsigned type) = fn_ELF_R_INFO;
 
Signature · 1 line
1.7.2.3