Ref: https://elixir.bootlin.com/linux/v2.6.39/source/kernel/trace/trace.h#L246
struct tracer nop_trace __read_mostly =
{
.name = "nop",
.init = nop_trace_init,
.reset = nop_trace_reset,
.wait_pipe = poll_wait_pipe,
.flags = &nop_flags,
.set_flag = nop_set_flag
};
/* Our two options */
enum {
TRACE_NOP_OPT_ACCEPT = 0x1,
TRACE_NOP_OPT_REFUSE = 0x2
};
/* Options for the tracer (see trace_options file) */
static struct tracer_opt nop_opts[] = {
/* Option that will be accepted by set_flag callback */
{ TRACER_OPT(test_nop_accept, TRACE_NOP_OPT_ACCEPT) },
/* Option that will be refused by set_flag callback */
{ TRACER_OPT(test_nop_refuse, TRACE_NOP_OPT_REFUSE) },
{ } /* Always set a last empty entry */
};
static struct tracer_flags nop_flags = {
/* You can check your flags value here when you want. */
.val = 0, /* By default: all flags disabled */
.opts = nop_opts
};
Ref: https://elixir.bootlin.com/linux/v2.6.39/source/kernel/trace/trace_nop.c
# Start uprobe
echo 'p:readline /bin/bash:0xad610' >> uprobe_events
# Tracing
cat trace_pipe
# End uprobe
echo -:readline >> uprobe_events
Ref: https://opensource.com/article/17/7/dynamic-tracing-linux-user-and-kernel-space Ref: https://elixir.bootlin.com/linux/v3.19.8/source/kernel/trace