Skip to content

uprobes/tracing: uretprobes, initial preparations

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4uprobes/tracing: Kill the pointless task_pt_regs() callskernel/trace/trace_uprobe.c+2 -22 replies
2/4uprobes/tracing: Kill the pointless seq_print_ip_sym() callkernel/trace/trace_uprobe.c+1 -72 replies
3/4uprobes/tracing: Kill the pointless local_save_flags/preempt_count callskernel/trace/trace_uprobe.c+3 -719 replies
4/4uprobes/tracing: generalize struct uprobe_trace_entry_headkernel/trace/trace.h kernel/trace/trace_uprobe.c+35 -3114 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAnton ArapovSrikar DronamrajuMasami Hiramatsu
SeriesT-b A-b A-b A-b A-b A-b
1/4A-b A-b
2/4A-b A-b
3/4A-b A-b A-b A-b A-b
4/4A-b T-b T-b T-b T-b T-b T-b T-b A-b A-b A-b A-b A-b A-b A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/4] uprobes/tracing: uretprobes, initial preparations

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