tracing: probeevent: Fix to support minus offset from symbol
authorMasami Hiramatsu <[email protected]>
Sat, 17 Mar 2018 12:38:10 +0000 (21:38 +0900)
committerSteven Rostedt (VMware) <[email protected]>
Fri, 23 Mar 2018 16:02:37 +0000 (12:02 -0400)
commitc5d343b6b7badd1f5fe0873eff2e8d63a193e732
tree56f571ff28c377ee42c9f3fb30f150e451c158a6
parent661e50bc853209e41a5c14a290ca4decc43cbfd1
tracing: probeevent: Fix to support minus offset from symbol

In Documentation/trace/kprobetrace.txt, it says

 @SYM[+|-offs] : Fetch memory at SYM +|- offs (SYM should be a data symbol)

However, the parser doesn't parse minus offset correctly, since
commit 2fba0c8867af ("tracing/kprobes: Fix probe offset to be
unsigned") drops minus ("-") offset support for kprobe probe
address usage.

This fixes the traceprobe_split_symbol_offset() to parse minus
offset again with checking the offset range, and add a minus
offset check in kprobe probe address usage.

Link: http://lkml.kernel.org/r/152129028983.31874.13419301530285775521.stgit@devbox
Cc: Ingo Molnar <[email protected]>
Cc: Tom Zanussi <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Ravi Bangoria <[email protected]>
Cc: [email protected]
Fixes: 2fba0c8867af ("tracing/kprobes: Fix probe offset to be unsigned")
Acked-by: Namhyung Kim <[email protected]>
Signed-off-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
kernel/trace/trace_kprobe.c
kernel/trace/trace_probe.c
kernel/trace/trace_probe.h