trace_kprobe.c (2e7f3db5d886701c2a31219530845f642fe700d9) trace_kprobe.c (97c753e62e6c31a404183898d950d8c08d752dbd)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Kprobes-based tracing events
4 *
5 * Created by Masami Hiramatsu <mhiramat@redhat.com>
6 *
7 */
8#define pr_fmt(fmt) "trace_kprobe: " fmt

--- 207 unchanged lines hidden (view full) ---

216
217 return container_of(tp, struct trace_kprobe, tp);
218}
219
220bool trace_kprobe_on_func_entry(struct trace_event_call *call)
221{
222 struct trace_kprobe *tk = trace_kprobe_primary_from_call(call);
223
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Kprobes-based tracing events
4 *
5 * Created by Masami Hiramatsu <mhiramat@redhat.com>
6 *
7 */
8#define pr_fmt(fmt) "trace_kprobe: " fmt

--- 207 unchanged lines hidden (view full) ---

216
217 return container_of(tp, struct trace_kprobe, tp);
218}
219
220bool trace_kprobe_on_func_entry(struct trace_event_call *call)
221{
222 struct trace_kprobe *tk = trace_kprobe_primary_from_call(call);
223
224 return tk ? kprobe_on_func_entry(tk->rp.kp.addr,
224 return tk ? (kprobe_on_func_entry(tk->rp.kp.addr,
225 tk->rp.kp.addr ? NULL : tk->rp.kp.symbol_name,
225 tk->rp.kp.addr ? NULL : tk->rp.kp.symbol_name,
226 tk->rp.kp.addr ? 0 : tk->rp.kp.offset) : false;
226 tk->rp.kp.addr ? 0 : tk->rp.kp.offset) == 0) : false;
227}
228
229bool trace_kprobe_error_injectable(struct trace_event_call *call)
230{
231 struct trace_kprobe *tk = trace_kprobe_primary_from_call(call);
232
233 return tk ? within_error_injection_list(trace_kprobe_address(tk)) :
234 false;

--- 588 unchanged lines hidden (view full) ---

823 /* TODO: support .init module functions */
824 ret = traceprobe_split_symbol_offset(symbol, &offset);
825 if (ret || offset < 0 || offset > UINT_MAX) {
826 trace_probe_log_err(0, BAD_PROBE_ADDR);
827 goto parse_error;
828 }
829 if (is_return)
830 flags |= TPARG_FL_RETURN;
227}
228
229bool trace_kprobe_error_injectable(struct trace_event_call *call)
230{
231 struct trace_kprobe *tk = trace_kprobe_primary_from_call(call);
232
233 return tk ? within_error_injection_list(trace_kprobe_address(tk)) :
234 false;

--- 588 unchanged lines hidden (view full) ---

823 /* TODO: support .init module functions */
824 ret = traceprobe_split_symbol_offset(symbol, &offset);
825 if (ret || offset < 0 || offset > UINT_MAX) {
826 trace_probe_log_err(0, BAD_PROBE_ADDR);
827 goto parse_error;
828 }
829 if (is_return)
830 flags |= TPARG_FL_RETURN;
831 if (kprobe_on_func_entry(NULL, symbol, offset))
831 ret = kprobe_on_func_entry(NULL, symbol, offset);
832 if (ret == 0)
832 flags |= TPARG_FL_FENTRY;
833 flags |= TPARG_FL_FENTRY;
833 if (offset && is_return && !(flags & TPARG_FL_FENTRY)) {
834 /* Defer the ENOENT case until register kprobe */
835 if (ret == -EINVAL && is_return) {
834 trace_probe_log_err(0, BAD_RETPROBE);
835 goto parse_error;
836 }
837 }
838
839 trace_probe_log_set_index(0);
840 if (event) {
841 ret = traceprobe_parse_event_name(&event, &group, buf,

--- 1270 unchanged lines hidden ---
836 trace_probe_log_err(0, BAD_RETPROBE);
837 goto parse_error;
838 }
839 }
840
841 trace_probe_log_set_index(0);
842 if (event) {
843 ret = traceprobe_parse_event_name(&event, &group, buf,

--- 1270 unchanged lines hidden ---