Skip to content
Commit ccea8727 authored by Ravi Bangoria's avatar Ravi Bangoria Committed by Steven Rostedt (VMware)
Browse files

trace_uprobe/sdt: Prevent multiple reference counter for same uprobe

We assume to have only one reference counter for one uprobe.
Don't allow user to add multiple trace_uprobe entries having
same inode+offset but different reference counter.

Ex,
  # echo "p:sdt_tick/loop2 /home/ravi/tick:0x6e4(0x10036)" > uprobe_events
  # echo "p:sdt_tick/loop2_1 /home/ravi/tick:0x6e4(0xfffff)" >> uprobe_events
  bash: echo: write error: Invalid argument

  # dmesg
  trace_kprobe: Reference counter offset mismatch.

There is one exception though:
When user is trying to replace the old entry with the new
one, we allow this if the new entry does not conflict with
any other existing entries.

Link: http://lkml.kernel.org/r/20180820044250.11659-4-ravi.bangoria@linux.ibm.com



Acked-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Reviewed-by: default avatarSong Liu <songliubraving@fb.com>
Reviewed-by: default avatarOleg Nesterov <oleg@redhat.com>
Tested-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarRavi Bangoria <ravi.bangoria@linux.ibm.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 22bad382
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment