linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Heiko Carstens <hca@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 3/5] fprobe: Fix accounting of when to unregister from function graph
Date: Wed, 19 Feb 2025 09:45:49 -0500	[thread overview]
Message-ID: <20250219094549.4d0899cc@gandalf.local.home> (raw)
In-Reply-To: <20250219095332.f9667fe4f414ec9945093b73@kernel.org>

On Wed, 19 Feb 2025 09:53:32 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:

> Can you use this version?
> 
> diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
> index 2560b312ad57..7d282c08549e 100644
> --- a/kernel/trace/fprobe.c
> +++ b/kernel/trace/fprobe.c
> @@ -409,7 +409,8 @@ static void fprobe_graph_remove_ips(unsigned long *addrs, int num)
>  		return;
>  	}
>  
> -	ftrace_set_filter_ips(&fprobe_graph_ops.ops, addrs, num, 1, 0);
> +	if (num)
> +		ftrace_set_filter_ips(&fprobe_graph_ops.ops, addrs, num, 1, 0);
>  }
>  
>  static int symbols_cmp(const void *a, const void *b)
> @@ -679,8 +680,7 @@ int unregister_fprobe(struct fprobe *fp)
>  	}
>  	del_fprobe_hash(fp);
>  
> -	if (count)
> -		fprobe_graph_remove_ips(addrs, count);
> +	fprobe_graph_remove_ips(addrs, count);
>  
>  	kfree_rcu(hlist_array, rcu);
>  	fp->hlist_array = NULL;

Yes, that looks better. I'll add that to v2.

-- Steve

  reply	other threads:[~2025-02-19 14:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-18 19:30 [PATCH 0/5] ftrace: Fix fprobe with function graph accounting Steven Rostedt
2025-02-18 19:30 ` [PATCH 1/5] ftrace: Fix accounting of adding subops to a manager ops Steven Rostedt
2025-02-18 19:30 ` [PATCH 2/5] ftrace: Do not add duplicate entries in subops " Steven Rostedt
2025-02-18 19:30 ` [PATCH 3/5] fprobe: Fix accounting of when to unregister from function graph Steven Rostedt
2025-02-19  0:53   ` Masami Hiramatsu
2025-02-19 14:45     ` Steven Rostedt [this message]
2025-02-18 19:30 ` [PATCH 4/5] fprobe: Always unregister fgraph function from ops Steven Rostedt
2025-02-19  0:57   ` Masami Hiramatsu
2025-02-19 14:53     ` Steven Rostedt
2025-02-18 19:30 ` [PATCH 5/5] selftests/ftrace: Update fprobe test to check enabled_functions file Steven Rostedt
2025-02-19  1:01   ` Masami Hiramatsu
2025-02-19 15:00     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250219094549.4d0899cc@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=agordeev@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=svens@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).