tracing: Extract out common code for kprobes/uprobes trace events