All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] uprobes/tracing: uretprobes, initial preparations
@ 2013-03-29 18:15 Oleg Nesterov
  2013-03-29 18:15 ` [PATCH 1/4] uprobes/tracing: Kill the pointless task_pt_regs() calls Oleg Nesterov
                   ` (4 more replies)
  0 siblings, 5 replies; 59+ messages in thread
From: Oleg Nesterov @ 2013-03-29 18:15 UTC (permalink / raw)
  To: Ananth N Mavinakayanahalli, Srikar Dronamraju, Steven Rostedt
  Cc: Anton Arapov, Frederic Weisbecker, Ingo Molnar, linux-kernel

Hello.

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
examples.

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(),

	-	DEFINE_FIELD(vaddr[0], FIELD_STRING_IP);
	-	size = SIZEOF_TRACE_ENTRY(1);
	+	if (!trace_probe_is_return(tu)) {
	+		DEFINE_FIELD(vaddr[0], FIELD_STRING_IP);
	+		size = SIZEOF_TRACE_ENTRY(1);
	+	} else {
	+		DEFINE_FIELD(vaddr[0], FIELD_STRING_FUNC);
	+		DEFINE_FIELD(vaddr[1], FIELD_STRING_RETIP);
	+		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.

Oleg.

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


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

end of thread, other threads:[~2013-04-13 18:25 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-29 18:15 [PATCH 0/4] uprobes/tracing: uretprobes, initial preparations Oleg Nesterov
2013-03-29 18:15 ` [PATCH 1/4] uprobes/tracing: Kill the pointless task_pt_regs() calls Oleg Nesterov
2013-04-02  8:57   ` Anton Arapov
2013-04-04 14:24   ` Srikar Dronamraju
2013-03-29 18:15 ` [PATCH 2/4] uprobes/tracing: Kill the pointless seq_print_ip_sym() call Oleg Nesterov
2013-04-02  8:57   ` Anton Arapov
2013-04-04 14:24   ` Srikar Dronamraju
2013-03-29 18:15 ` [PATCH 3/4] uprobes/tracing: Kill the pointless local_save_flags/preempt_count calls Oleg Nesterov
2013-04-02  8:58   ` Anton Arapov
2013-04-04 14:25   ` Srikar Dronamraju
2013-04-05  3:47     ` Masami Hiramatsu
2013-04-05 15:01       ` Oleg Nesterov
2013-04-08  9:29         ` Masami Hiramatsu
2013-04-10 14:58           ` [PATCH 0/1] uprobes/tracing: Don't pass addr=ip to perf_trace_buf_submit() Oleg Nesterov
2013-04-10 14:58             ` [PATCH 1/1] " Oleg Nesterov
2013-04-11 10:19               ` Masami Hiramatsu
2013-04-13  9:28               ` Srikar Dronamraju
2013-04-11 10:38             ` [PATCH 0/1] " Masami Hiramatsu
2013-04-11 11:59               ` Oleg Nesterov
2013-04-12 18:01                 ` Steven Rostedt
2013-04-12 21:19                 ` Steven Rostedt
2013-04-13 14:02                   ` [PATCH 0/1] uprobes/perf: Avoid perf_trace_buf_prepare/submit if ->perf_events is empty Oleg Nesterov
2013-04-13 14:02                     ` [PATCH 1/1] " Oleg Nesterov
2013-04-13 18:22                     ` [PATCH 0/1] " Oleg Nesterov
2013-04-08 15:58   ` [PATCH 3/4] uprobes/tracing: Kill the pointless local_save_flags/preempt_count calls Steven Rostedt
2013-04-09 14:58     ` Oleg Nesterov
2013-04-09 15:12       ` Steven Rostedt
2013-03-29 18:15 ` [PATCH 4/4] uprobes/tracing: generalize struct uprobe_trace_entry_head Oleg Nesterov
2013-04-02  8:59   ` Anton Arapov
2013-04-04 14:25   ` Srikar Dronamraju
2013-04-08 15:55   ` Steven Rostedt
2013-04-09 14:50     ` Oleg Nesterov
2013-04-09 15:07       ` Steven Rostedt
2013-04-09 19:32         ` [PATCH v2 0/7] uprobes/tracing: uretprobes Oleg Nesterov
2013-04-09 19:32           ` [PATCH v2 1/7] uprobes/tracing: Generalize struct uprobe_trace_entry_head Oleg Nesterov
2013-04-09 19:32           ` [PATCH v2 2/7] uprobes/tracing: Introduce uprobe_{trace,perf}_print() helpers Oleg Nesterov
2013-04-09 19:32           ` [PATCH v2 3/7] uprobes/tracing: Introduce is_ret_probe() and uretprobe_dispatcher() Oleg Nesterov
2013-04-09 19:32           ` [PATCH v2 4/7] uprobes/tracing: Make uprobe_{trace,perf}_print() uretprobe-friendly Oleg Nesterov
2013-04-13  9:33             ` Srikar Dronamraju
2013-04-09 19:32           ` [PATCH v2 5/7] uprobes/tracing: Make register_uprobe_event() paths uretprobe-friendly Oleg Nesterov
2013-04-09 19:32           ` [PATCH v2 6/7] uprobes/tracing: Make seq_printf() code uretprobe-friendly Oleg Nesterov
2013-04-09 19:32           ` [PATCH v2 7/7] uprobes/tracing: Change create_trace_uprobe() to support uretprobes Oleg Nesterov
2013-04-01 16:08 ` [PATCH 0/6] uprobes/tracing: uretprobes Oleg Nesterov
2013-04-01 16:08   ` [PATCH 1/6] uprobes/tracing: Introduce uprobe_{trace,perf}_print() helpers Oleg Nesterov
2013-04-07 13:58     ` Srikar Dronamraju
2013-04-01 16:08   ` [PATCH 2/6] uprobes/tracing: Introduce is_ret_probe() and uretprobe_dispatcher() Oleg Nesterov
2013-04-07 14:12     ` Srikar Dronamraju
2013-04-01 16:08   ` [PATCH 3/6] uprobes/tracing: Make uprobe_{trace,perf}_print() uretprobe-friendly Oleg Nesterov
2013-04-07 10:31     ` Srikar Dronamraju
2013-04-09 13:33       ` Oleg Nesterov
2013-04-13  9:31         ` Srikar Dronamraju
2013-04-08 17:08     ` Steven Rostedt
2013-04-01 16:08   ` [PATCH 4/6] uprobes/tracing: Make register_uprobe_event() paths uretprobe-friendly Oleg Nesterov
2013-04-07 14:14     ` Srikar Dronamraju
2013-04-01 16:08   ` [PATCH 5/6] uprobes/tracing: Make seq_printf() code uretprobe-friendly Oleg Nesterov
2013-04-07 14:15     ` Srikar Dronamraju
2013-04-01 16:09   ` [PATCH 6/6] uprobes/tracing: Change create_trace_uprobe() to support uretprobes Oleg Nesterov
2013-04-07 14:17     ` Srikar Dronamraju
2013-04-02 13:25   ` [PATCH 0/6] uprobes/tracing: uretprobes Anton Arapov

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.