tracing/probes: Fixes for v6.5-rc2
Masami Hiramatsu (Google)
maintainercover tracing/probes: Fixes for v6.5-rc2
These two patches are probe-events fixes for v6.5-rc2.
One is to fix btf_type_by_id() return value check and the other is fixing selftest.
Thank you,
---
Masami Hiramatsu (Google) (2):
tracing/probes: Fix to add NULL check for BTF APIs selftests/ftrace: Fix to check fprobe event eneblement
kernel/trace/trace_probe.c | 8 ++++---- .../ftrace/test.d/dynevent/add_remove_btfarg.tc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
--
Masami Hiramatsu (Google) <[email protected]>
Masami Hiramatsu (Google)
maintainerPATCH 1/2 tracing/probes: Fix to add NULL check for BTF APIs
From: Masami Hiramatsu (Google) <[email protected]>
Since find_btf_func_param() abd btf_type_by_id() can return NULL, the caller must check the return value correctly.
--- kernel/trace/trace_probe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/trace/trace_probe.c +4 -4
@@ -386,12 +386,12 @@ static const struct btf_type *find_btf_func_proto(const char *funcname)/* Get BTF_KIND_FUNC type */ t =btf_type_by_id (btf, id); -if (!btf_type_is_func (t)) +if (!t || !btf_type_is_func (t))return ERR_PTR (-ENOENT );/* The type of BTF_KIND_FUNC is BTF_KIND_FUNC_PROTO */ t =btf_type_by_id (btf, t->type); -if (!btf_type_is_func_proto (t)) +if (!t || !btf_type_is_func_proto (t))return ERR_PTR (-ENOENT );return t;
@@ -443,7 +443,7 @@ static int parse_btf_arg(const char *varname, struct fetch_insn *code,if (!ctx->params) { params =find_btf_func_param (ctx->funcname, &ctx->nr_params, ctx->flags &TPARG_FL_TPOINT ); -if (IS_ERR (params)) { +if (IS_ERR_OR_NULL (params)) {trace_probe_log_err (ctx->offset,NO_BTF_ENTRY );return PTR_ERR (params); }
@@ -1273,7 +1273,7 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[], params =find_btf_func_param (ctx->funcname, &nr_params, ctx->flags &TPARG_FL_TPOINT ); -if (IS_ERR (params)) { +if (IS_ERR_OR_NULL (params)) {if (args_idx !=-1 ) {/* $arg* requires BTF info */ trace_probe_log_err (0 ,NOSUP_BTFARG );
Masami Hiramatsu (Google)
maintainerPATCH 2/2 selftests/ftrace: Fix to check fprobe event eneblement
In reply to Masami Hiramatsu (Google)From: Masami Hiramatsu (Google) <[email protected]>
Fix to check the availability of fprobe and kprobes for add_remove_btfarg.tc.
Only if both kprobe and fprobe are not supported, it should return "unsupported".
--- .../ftrace/test.d/dynevent/add_remove_btfarg.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/ftrace/test.d/dynevent/add_remove_btfarg.tc +1 -1
@@ -13,7 +13,7 @@ if grep -qF "f[:[<group>/][<event>]] <func-name>[%return] [<args>]" README ; the FPROBES=yes fi -if [ -z "$KPROBES" -a "$FPROBES" ] ; then +if [ -z "$KPROBES" -a -z "$FPROBES" ] ; then exit_unsupported fi
Quoted 11 lines · On Tue, 25 Jul 2023 10:37:10 +0900 "Masami Hiramatsu (Google)"…
These two patches are probe-events fixes for v6.5-rc2.
One is to fixbtf_type_by_id()return value check and the other is fixing selftest.Thank you,
---
Masami Hiramatsu (Google) (2):
tracing/probes: Fix to add NULL check for BTF APIs selftests/ftrace: Fix to check fprobe event eneblement
For both patches:
-- Steve
Quoted 8 lines
kernel/trace/trace_probe.c | 8 ++++---- .../ftrace/test.d/dynevent/add_remove_btfarg.tc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)--
Masami Hiramatsu (Google) <[email protected]>
Masami Hiramatsu (Google)
maintainerQuoted 11 lines · On Mon, 24 Jul 2023 22:40:17 -0400 Steven Rostedt <[email protected]> wrote:
Quoted 8 lines · On Tue, 25 Jul 2023 10:37:10 +0900 "Masami Hiramatsu (Google)"…
These two patches are probe-events fixes for v6.5-rc2.
One is to fixbtf_type_by_id()return value check and the other is fixing selftest.Thank you,
---
Quoted 7 lines
Quoted 3 lines
Masami Hiramatsu (Google) (2):
tracing/probes: Fix to add NULL check for BTF APIs selftests/ftrace: Fix to check fprobe event eneblementFor both patches:
Reviewed-by Steven Rostedt (Google) <[email protected]>
Thanks!
Quoted 12 lines
-- Steve
Quoted 8 lines
kernel/trace/trace_probe.c | 8 ++++---- .../ftrace/test.d/dynevent/add_remove_btfarg.tc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)--
Masami Hiramatsu (Google) <[email protected]>
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>