From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796134386; b=b6BRG4dR0/zgFxvDcgniC1/r54uK1reCSSi9mVSXrmCcOWJ9Ci+ai7OW9eborA+qx0d/ KEx2Tu9LZv3zLhAD5Ol5pLntWsvBKO+cRYUmHkYRvSuDMCe+3rbvXiuAO/iNVbHmFMg78 J3YmiK4ZPhq6nZnzV2/GcWF4YBs8DhDLRwB88vycFxoqn1hwmYEB+JkZEluQVIN/z4+Cv YH+c5QqZmepwbyRjDSJacOe0bz1ICqfU21qBBHMGYy9/BX8vDjl7NB6biD/HjExqpUpCb pIipkrdZN0ndNTyzmyfSIR3+f0/MAiPFCZQD2TRkO3/9sBB3rPGfzbORqkERUfq57qg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796134386; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=YbEiS5JuFj7fBNO9ijQ36SAKyMLAfdz/yp1f5eSjoDk=; b=t2+vd/xd8kvTST9QkUyBXg87GyTNmHhpjwZixJH1Ckk7XrwVt3Pi2Bvt2wcKm0a1AEEP Y0Gu0Y9dF9/k/KKGFLMkKnOmlfOqd/TPSTe9lBFnXlM/4HKERQMVIl5S5tvoULQ1e7FRE WMSGUmqXa+6jQW/O0JmAxAIjDqMXOxfevRR6WS7YICxOOB++s6WubFlqSim9CG4KgxDP5 ZQgde9g6qweh4963p2oL7kawRA9ziUXuhio7qkyxrFxN+W7bAcTDbfdXW+1+/Xd6Zv+xC Mkg/eUlG7aueWUt2nCz5xuYlBPrCUCfO3ew+KSSuS6agdAPdfhgfbuWv7BUBjrUfGhw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Ed+GXZ/o"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 719E1606A31A; Tue, 1 Dec 2026 14:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ed+GXZ/o Received: by smtp.kernel.org (Postfix) with ESMTPSA id B95C51F0089B; Tue, 1 Dec 2026 14:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796134386; bh=YbEiS5JuFj7fBNO9ijQ36SAKyMLAfdz/yp1f5eSjoDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ed+GXZ/oYR4QX4SwsXgGtrV4tn3Bh9BvsSWHRr1f6TphA9wtWFZlYLYqITBNQTZJ6 0uiBkQWZfhwZWjGPoq1fXfmBRP72aHxEEyMS0ZBhjoFHOvJnuvL7234yPJml2YtBaQ Fs6nP2WOr+MvpF3sIr7GSJvkahmbKoFbVZZnqh8LCOoGccM9o6CRkQfQg/jQbbKXz9 sxbat5sv2R4e42z12kkb/wsc9NRQ3P/NXZztbkQ/UhXFfVMoI1eH1v2hdHB+AeGSs9 JP4jTreO4Px7v+DCI+UhzkSNYtmapUZTiFtX6J/Nu+MKaq0fTGaX6SUH2U+VxWvCqB GjuYo8HQfRQiQ== From: "Masami Hiramatsu (Google)" To: Steven Rostedt , Peter Zijlstra , Ingo Molnar Cc: Jinchao Wang , Mathieu Desnoyers , Thomas Gleixner , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Alexander Shishkin , Ian Rogers , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-perf-users@vger.kernel.org, x86@kernel.org Subject: [PATCH v21 11/11] tracing/wprobe: Support BTF struct offset resolution in set_wprobe trigger Date: Mon, 30 Nov 2026 02:03:03 +0000 Message-ID: <20261130020252.32126-12-mhiramat@kernel.org> X-Mailer: UndineD 0.1 In-Reply-To: <20261130020252.32126-1-mhiramat@kernel.org> References: <20261130020252.32126-1-mhiramat@kernel.org> X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Allow set_wprobe trigger to use BTF struct offset resolution to specify the target address field. Link: https://lore.kernel.org/all/59637b96946653393a7ad3c7de094094796b39c2.1785067572.git.wangjinchao600@gmail.com/ Signed-off-by: Masami Hiramatsu (Google) --- Changes in v21: - Pass orig_cmd and base_offset into wprobe_trigger_field_parse() and wprobe_trigger_typecast_parse() for untruncated error logging. - Use clear_dynamic_events in cleanup_wprobe_triggers() in trigger-wprobe-btf-offset.tc. Changes in v20: - Verify resolved non-zero BTF offset in trigger file and test clear_wprobe with BTF struct offset resolution in trigger-wprobe-btf-offset.tc. - Drop redundant fprobe README check in trigger-wprobe-btf-offset.tc. Changes in v18: - In get_offset_of_field(), rename mtype to container and document that it represents the containing structure/union type (handling anonymous structures/unions) rather than member's own type. - In get_offset_of_field(), verify bit offset is byte-aligned before returning byte offset. - Add "set_wprobe:":README to requires line in trigger-wprobe-btf-offset.tc so the test is skipped if CONFIG_WPROBE_TRIGGERS is disabled. Changes in v15: - Duplicate field string to avoid modifying glob in place in wprobe_trigger_typecast_parse() so tracing_log_err() prints pristine command string. - Remove leftover offset and adjust debug print in wprobe_trigger_print(). - Document BTF struct offset resolution syntax in wprobetrace.rst. - Add explicit failure checks with fail helper in trigger-wprobe-btf-offset.tc. - Declare fprobe README requirement in trigger-wprobe-btf-offset.tc. Changes in v14: - Update dummy wprobe event definition to use '-1' instead of '0'. - Pass member_type to btf_find_struct_member() and check its kflag in get_offset_of_field(). Changes in v13: - Check for field token before calling wprobe_trigger_field_parse() in clear_wprobe to avoid spurious error log entries on numeric counts. Changes in v12: - Refactor field parsing logic into wprobe_trigger_field_parse(). - Remove unused variable count_str in wprobe_trigger_cmd_parse(). --- Documentation/trace/wprobetrace.rst | 7 + kernel/trace/trace_wprobe.c | 315 +++++++++++++----- .../trigger/trigger-wprobe-btf-offset.tc | 94 ++++++ 3 files changed, 334 insertions(+), 82 deletions(-) create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/trigger-wprobe-btf-offset.tc diff --git a/Documentation/trace/wprobetrace.rst b/Documentation/trace/wprobetrace.rst index b0fb81f03e2c..943f01cc5937 100644 --- a/Documentation/trace/wprobetrace.rst +++ b/Documentation/trace/wprobetrace.rst @@ -90,10 +90,17 @@ Combination with trigger action The event trigger action can extend the utilization of this wprobe. - set_wprobe:WPEVENT:FIELD[+|-ADJUST][:COUNT] +- set_wprobe:WPEVENT:(STRUCT[,ASGN])EVENT_FIELD->MEMBER[+|-ADJUST][:COUNT] - clear_wprobe:WPEVENT[:FIELD[+|-ADJUST][:COUNT]] +- clear_wprobe:WPEVENT[:(STRUCT[,ASGN])EVENT_FIELD->MEMBER[+|-ADJUST][:COUNT]] Set these triggers to the target event, then the WPROBE event will be setup to trace the memory access at FIELD[+|-ADJUST] address. +If BTF is supported, the target address can also be resolved using BTF +struct offset resolution: `(STRUCT[,ASGN])EVENT_FIELD->MEMBER[+|-ADJUST]`. +Here, EVENT_FIELD is an event field containing a pointer to STRUCT (or to +the ASGN member if ASGN is specified), and MEMBER is the struct member whose +offset is resolved automatically via BTF. When clear_wprobe is hit, if FIELD is NOT specified, the WPEVENT is forcibly cleared. If FIELD[+|-ADJUST] is set, it clears WPEVENT only if its watching address is the same as the FIELD[+|-ADJUST] value. diff --git a/kernel/trace/trace_wprobe.c b/kernel/trace/trace_wprobe.c index 0d40082462a2..b7e323d4d93d 100644 --- a/kernel/trace/trace_wprobe.c +++ b/kernel/trace/trace_wprobe.c @@ -29,6 +29,7 @@ #include #include "trace.h" +#include "trace_btf.h" #include "trace_dynevent.h" #include "trace_probe.h" #include "trace_probe_kernel.h" @@ -1326,6 +1327,227 @@ static void wprobe_trigger_free(struct event_trigger_data *data) } } +#ifdef CONFIG_PROBE_EVENTS_BTF_ARGS + +static int get_offset_of_field(struct btf *btf, const struct btf_type *type, char *field_name) +{ + const struct btf_member *field; + const struct btf_type *container; + int bitoffs = 0; + u32 anon_offs; + char *next; + + do { + next = strchr(field_name, '.'); + if (next) + *next++ = '\0'; + + anon_offs = 0; + /* + * btf_find_struct_member() returns the actual containing + * structure/union type in @container (which can be an + * inner anonymous struct/union rather than @type). + */ + field = btf_find_struct_member(btf, type, field_name, &anon_offs, &container); + if (IS_ERR_OR_NULL(field)) + return -ENOENT; + + if (btf_type_kflag(container)) { + /* Reject bitfield member access */ + if (BTF_MEMBER_BITFIELD_SIZE(field->offset)) + return -EINVAL; + bitoffs += anon_offs + BTF_MEMBER_BIT_OFFSET(field->offset); + } else { + bitoffs += anon_offs + field->offset; + } + + field_name = next; + if (next) { + type = btf_type_skip_modifiers(btf, field->type, NULL); + if (!type) + return -ENOENT; + } + } while (next); + + if (bitoffs % BITS_PER_BYTE) + return -EINVAL; + + return bitoffs / BITS_PER_BYTE; +} + +/* btf_put(NULL) is acceptable. */ +DEFINE_FREE(btf_put, struct btf *, btf_put(_T)) + +/* parse typecast: (TYPE[,ASGN])EVENT_FIELD->FIELD[.SUBFIELD...][+-OFFS] and set adjust. */ +static int wprobe_trigger_typecast_parse(char *field_str, + struct trace_event_file *file, + struct wprobe_trigger_data *wprobe_data, + const char *orig_cmd, int base_offset) +{ + struct btf *btf __free(btf_put) = NULL; + char *buf __free(kfree) = NULL; + struct ftrace_event_field *field; + const struct btf_type *type; + char *assign_field; + char *event_field; + char *type_field; + char *type_name; + char *offs; + long val = 0; + int event_field_offset; + int id, adjust; + + buf = kstrdup(field_str, GFP_KERNEL); + if (!buf) + return -ENOMEM; + + type_name = buf + 1; + event_field = strchr(type_name, ')'); + if (!event_field) { + wprobe_trigger_log_err(file, orig_cmd, + base_offset + (type_name - buf), + DEREF_OPEN_BRACE); + return -EINVAL; + } + *event_field++ = '\0'; + + /* Check the optional assign field. */ + assign_field = strchr(type_name, ','); + if (assign_field) + *assign_field++ = '\0'; + + /* Get the type field name. */ + type_field = strstr(event_field, "->"); + if (!type_field) { + wprobe_trigger_log_err(file, orig_cmd, + base_offset + (event_field - buf), + TYPECAST_REQ_FIELD); + return -EINVAL; + } + *type_field = '\0'; + type_field += 2; + + offs = strpbrk(type_field, "+-"); + if (offs) { + if (kstrtol(offs, 0, &val) < 0) { + wprobe_trigger_log_err(file, orig_cmd, + base_offset + (offs - buf), + BAD_DEREF_OFFS); + return -EINVAL; + } + *offs = '\0'; + } + + /* find type from BTF */ + id = bpf_find_btf_id(type_name, BTF_KIND_STRUCT, &btf); + if (id < 0) { + wprobe_trigger_log_err(file, orig_cmd, + base_offset + (type_name - buf), + BAD_BTF_TID); + return id; + } + + type = btf_type_by_id(btf, id); + if (!type) { + wprobe_trigger_log_err(file, orig_cmd, + base_offset + (type_name - buf), + BAD_BTF_TID); + return -EINVAL; + } + + adjust = get_offset_of_field(btf, type, type_field); + if (adjust < 0) { + wprobe_trigger_log_err(file, orig_cmd, + base_offset + (type_field - buf), + NO_BTF_FIELD); + return adjust; + } + wprobe_data->adjust = adjust + val; + + if (assign_field) { + /* assign_field should be a struct field */ + adjust = get_offset_of_field(btf, type, assign_field); + if (adjust < 0) { + wprobe_trigger_log_err(file, orig_cmd, + base_offset + (assign_field - buf), + NO_BTF_FIELD); + return adjust; + } + wprobe_data->adjust -= adjust; + } + + event_field_offset = base_offset + (event_field - buf); + field = trace_find_event_field(file->event_call, event_field); + if (!field) { + wprobe_trigger_log_err(file, orig_cmd, event_field_offset, + NO_EVENT_FIELD); + return -ENOENT; + } + if (field->size != sizeof(void *)) { + wprobe_trigger_log_err(file, orig_cmd, event_field_offset, + WPROBE_BAD_FIELD); + return -ENOEXEC; + } + wprobe_data->offset = field->offset; + wprobe_data->field = kstrdup(event_field, GFP_KERNEL); + if (!wprobe_data->field) + return -ENOMEM; + + return 0; +} +#else +static int wprobe_trigger_typecast_parse(char *field_str, + struct trace_event_file *file, + struct wprobe_trigger_data *wprobe_data, + const char *orig_cmd, int base_offset) +{ + wprobe_trigger_log_err(file, orig_cmd, base_offset, NOSUP_BTFARG); + return -EOPNOTSUPP; +} +#endif /* CONFIG_PROBE_EVENTS_BTF_ARGS */ + +static int wprobe_trigger_field_parse(char *field_str, struct trace_event_file *file, + struct wprobe_trigger_data *wprobe_data, + const char *orig_cmd, int base_offset) +{ + struct ftrace_event_field *field; + char *offs; + + if (field_str[0] == '(') + return wprobe_trigger_typecast_parse(field_str, file, wprobe_data, + orig_cmd, base_offset); + + offs = strpbrk(field_str, "+-"); + if (offs) { + long val; + + if (kstrtol(offs, 0, &val) < 0) { + wprobe_trigger_log_err(file, orig_cmd, + base_offset + (offs - field_str), + BAD_DEREF_OFFS); + return -EINVAL; + } + wprobe_data->adjust = val; + *offs = '\0'; + } + + field = trace_find_event_field(file->event_call, field_str); + if (!field) { + wprobe_trigger_log_err(file, orig_cmd, base_offset, NO_EVENT_FIELD); + return -ENOENT; + } + if (field->size != sizeof(void *)) { + wprobe_trigger_log_err(file, orig_cmd, base_offset, WPROBE_BAD_FIELD); + return -ENOEXEC; + } + wprobe_data->offset = field->offset; + wprobe_data->field = kstrdup(field_str, GFP_KERNEL); + if (!wprobe_data->field) + return -ENOMEM; + + return 0; +} + static int wprobe_trigger_cmd_parse(struct event_command *cmd_ops, struct trace_event_file *file, char *glob, char *cmd, @@ -1340,9 +1562,7 @@ static int wprobe_trigger_cmd_parse(struct event_command *cmd_ops, struct trace_event_file *wprobe_file; struct trace_array *tr = file->tr; char *orig_cmd __free(kfree) = NULL; - char *event_str, *field_str, *comment; - struct ftrace_event_field *field; - struct trace_event_call *event; + char *event_str, *comment; bool remove, clear = false; struct trace_wprobe *tw; char *param, *filter; @@ -1429,10 +1649,8 @@ static int wprobe_trigger_cmd_parse(struct event_command *cmd_ops, /* clear_wprobe does not need field, but can have optional field. */ if (!clear) { - char *offs; + char *field_str = strsep(¶m, ":"); - /* Find target field, which must be equivalent to "void *" */ - field_str = strsep(¶m, ":"); if (!field_str) { wprobe_trigger_log_err(file, orig_cmd, (event_str - glob) + strlen(event_str), @@ -1440,88 +1658,21 @@ static int wprobe_trigger_cmd_parse(struct event_command *cmd_ops, ret = -EINVAL; goto out_free; } - - offs = strpbrk(field_str, "+-"); - if (offs) { - long val; - - if (kstrtol(offs, 0, &val) < 0) { - wprobe_trigger_log_err(file, orig_cmd, - offs - glob, - BAD_DEREF_OFFS); - ret = -EINVAL; - goto out_free; - } - wprobe_data->adjust = val; - *offs = '\0'; - } - - event = file->event_call; - field = trace_find_event_field(event, field_str); - if (!field) { - wprobe_trigger_log_err(file, orig_cmd, field_str - glob, - NO_EVENT_FIELD); - ret = -ENOENT; - goto out_free; - } - - if (field->size != sizeof(void *)) { - wprobe_trigger_log_err(file, orig_cmd, field_str - glob, - WPROBE_BAD_FIELD); - ret = -ENOEXEC; - goto out_free; - } - wprobe_data->offset = field->offset; - wprobe_data->field = kstrdup(field_str, GFP_KERNEL); - if (!wprobe_data->field) { - ret = -ENOMEM; + ret = wprobe_trigger_field_parse(field_str, file, wprobe_data, + orig_cmd, field_str - glob); + if (ret < 0) goto out_free; - } - } else if (param && (isalpha(param[0]) || param[0] == '_')) { + } else if (param && (isalpha(param[0]) || param[0] == '_' || param[0] == '(')) { if (strncmp(param, "count=", 6) != 0 && (strcmp(param, "unlimited") != 0 || trace_find_event_field(file->event_call, "unlimited"))) { - char *offs; - - field_str = strsep(¶m, ":"); - offs = strpbrk(field_str, "+-"); - if (offs) { - long val; - - if (kstrtol(offs, 0, &val) < 0) { - wprobe_trigger_log_err(file, orig_cmd, - offs - glob, - BAD_DEREF_OFFS); - ret = -EINVAL; - goto out_free; - } - wprobe_data->adjust = val; - *offs = '\0'; - } - - event = file->event_call; - field = trace_find_event_field(event, field_str); - if (!field) { - wprobe_trigger_log_err(file, orig_cmd, - field_str - glob, - NO_EVENT_FIELD); - ret = -ENOENT; - goto out_free; - } + char *field_str = strsep(¶m, ":"); - if (field->size != sizeof(void *)) { - wprobe_trigger_log_err(file, orig_cmd, - field_str - glob, - WPROBE_BAD_FIELD); - ret = -ENOEXEC; + ret = wprobe_trigger_field_parse(field_str, file, + wprobe_data, orig_cmd, + field_str - glob); + if (ret < 0) goto out_free; - } - wprobe_data->offset = field->offset; - wprobe_data->field = kstrdup(field_str, GFP_KERNEL); - if (!wprobe_data->field) { - ret = -ENOMEM; - goto out_free; - } } } diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-wprobe-btf-offset.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-wprobe-btf-offset.tc new file mode 100644 index 000000000000..46e3e5c29ba2 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-wprobe-btf-offset.tc @@ -0,0 +1,94 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: event trigger - test set_wprobe trigger with BTF struct offset +# requires: dynamic_events "w[:[/][]] [r|w|rw]@[:]":README "f[:[/][]] [%return] []":README events/sched/sched_process_fork/trigger "[(structname[,field])][->field[->field|.field...]]":README "set_wprobe:":README + +fail() { #msg + echo "$1" + exit_fail +} + +rmmod trace-events-sample ||: +if ! modprobe trace-events-sample ; then + echo "No trace-events sample module - please make CONFIG_SAMPLE_TRACE_EVENTS=m" + exit_unresolved +fi + +cleanup_wprobe_triggers() { + if [ -f events/fprobes/testevent/trigger ]; then + reset_trigger_file events/fprobes/testevent/trigger || true + fi + echo 0 > events/enable 2>/dev/null || true + clear_dynamic_events 2>/dev/null || true + sleep 1 + rmmod trace-events-sample 2>/dev/null || true + return 0 +} + +trap cleanup_wprobe_triggers EXIT + +echo 0 > tracing_on + +# we will skip this test if the target function does not exist. +if ! grep -wq "sample_timer_cb" /proc/kallsyms; then + echo "UNRESOLVED: sample_timer_cb not found" + exit_unresolved +fi + +:;: "Add a wprobe event watching 8 bytes" ;: +echo 'w:watch rw@-1:8 address=$addr value=$value' >> dynamic_events + +:;: "Add fprobe event for sample_timer_cb" ;: +# sample_timer_cb(struct timer_list *t) +# container_of(t, struct foo_timer_data, timer) +echo 'f:fprobes/testevent sample_timer_cb timer=t' >> dynamic_events + +:;: "Enable all events before setting triggers" ;: +echo 1 > tracing_on +echo 1 >> events/fprobes/testevent/enable + +:;: "Set set_wprobe trigger using BTF struct offset resolution" ;: +# Syntax: set_wprobe:WPEVENT:(STRUCT,FIELD)EVENT_FIELD->MEMBER +# (foo_timer_data,timer) is the BTF struct type and field name +# timer->expires is the struct member whose offset is resolved automatically via BTF +echo 'set_wprobe:watch:(foo_timer_data,timer)timer->timer.expires' >> events/fprobes/testevent/trigger +if ! grep -Eq '^set_wprobe:watch:timer\+[1-9][0-9]*:unlimited' events/fprobes/testevent/trigger; then + fail "Failed to set set_wprobe trigger with resolved non-zero BTF offset" +fi + +# Wait for sample_timer_cb to fire and set_wprobe trigger to activate +sleep 3 + +:;: "Check set_wprobe trigger activated the watchpoint" ;: +if ! grep -q watch trace; then + fail "Failed to trigger watchpoint" +fi + +:;: "Test clear_wprobe with BTF struct offset resolution" ;: +echo 'clear_wprobe:watch:(foo_timer_data,timer)timer->timer.expires' >> events/fprobes/testevent/trigger +echo '!set_wprobe:watch:(foo_timer_data,timer)timer->timer.expires' >> events/fprobes/testevent/trigger +sleep 2 +clear_trace +sleep 1 +if ! grep -q '^0\*' events/wprobes/watch/enable; then + fail "clear_wprobe with BTF offset did not soft-disable watchpoint" +fi +if grep -q watch trace; then + fail "Failed to clear watchpoint with BTF offset" +fi + +:;: "Remove wprobe triggers" ;: +echo '!clear_wprobe:watch:(foo_timer_data,timer)timer->timer.expires' >> events/fprobes/testevent/trigger +if grep -q ^set_wprobe events/fprobes/testevent/trigger; then + fail "Failed to remove set_wprobe trigger" +fi +if grep -q ^clear_wprobe events/fprobes/testevent/trigger; then + fail "Failed to remove clear_wprobe trigger" +fi + +:;: "Disable events and remove dynamic events" ;: +echo 0 > events/enable +echo > dynamic_events +clear_trace + +exit 0 -- 2.43.0