User: Password:
Subscribe / Log in / New account

uprobes/tracing: uretprobes, initial preparations

From:  Oleg Nesterov <>
To:  Ananth N Mavinakayanahalli <>, Srikar Dronamraju <>, Steven Rostedt <>
Subject:  [PATCH 0/4] uprobes/tracing: uretprobes, initial preparations
Date:  Fri, 29 Mar 2013 19:15:20 +0100
Message-ID:  <>
Cc:  Anton Arapov <>, Frederic Weisbecker <>, Ingo Molnar <>,
Archive-link:  Article


uretprobes code is almost ready, we need to teach trace_uprobe.c
to support them.

This looks simple, but there is a nasty complication. We do not
want to copy-and-paste the code like trace_kprobe.c does. Just look
at kprobe_event_define_fields() and kretprobe_event_define_fields().
They are non-trivial but almost identical. And there are a lot more

So I'd like to send 4/4 for review before I'll do other changes.
The patch itself doesn't make sense and complicates the source code a
bit. But note how easy we can change, say, uprobe_event_define_fields(),

	-	size = SIZEOF_TRACE_ENTRY(1);
	+	if (!trace_probe_is_return(tu)) {
	+		size = SIZEOF_TRACE_ENTRY(1);
	+	} else {
	+		size = SIZEOF_TRACE_ENTRY(2);
	+	}

without copy-and-paste. The same simple change is possible for other
helpers playing with uprobe_trace_entry_head.

In fact personally I think that trace_kprobe.c should be cleanuped
this way.

Off-topic question... Why uprobe_perf_func() passes "addr = ip" to
perf_trace_buf_submit() ? This just sets perf_sample_data->addr for
PERF_SAMPLE_ADDR, do we really need this? and we already have
perf_sample_data->ip initialized by perf. Just curious.


 kernel/trace/trace.h        |    5 ---
 kernel/trace/trace_uprobe.c |   77 +++++++++++++++++++++----------------------
 2 files changed, 38 insertions(+), 44 deletions(-)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds