All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominique Martinet <asmadeus@codewreck.org>
To: unlisted-recipients:; (no To-header on input)
Cc: v9fs-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Christian Schoenebeck <linux_oss@crudebyte.com>,
	Tyler Hicks <tyhicks@linux.microsoft.com>,
	Eric Van Hensbergen <ericvh@gmail.com>,
	Latchesar Ionkov <lucho@ionkov.net>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Ingo Molnar <mingo@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v2 05/06] 9p fid refcount: add a 9p_fid_ref tracepoint
Date: Mon, 13 Jun 2022 16:00:52 +0900	[thread overview]
Message-ID: <YqbgpMJCVk44Q0zP@codewreck.org> (raw)
In-Reply-To: <20220612234634.1559778-1-asmadeus@codewreck.org>

Dominique Martinet wrote on Mon, Jun 13, 2022 at 08:46:34AM +0900:
> I've applied your suggestion to use DECLARE_TRACEPOINT + enable checks,
> it doesn't seem to have many users but it looks good to me.
>
> diff --git a/include/net/9p/client.h b/include/net/9p/client.h
> index 9fd38d674057..6f347983705d 100644
> --- a/include/net/9p/client.h
> +++ b/include/net/9p/client.h
> @@ -237,8 +238,17 @@ static inline int p9_req_try_get(struct p9_req_t *r)
>  
>  int p9_req_put(struct p9_req_t *r);
>  
> +/* We cannot have the real tracepoints in header files,
> + * use a wrapper function */
> +DECLARE_TRACEPOINT(9p_fid_ref);
> +void do_trace_9p_fid_get(struct p9_fid *fid);
> +void do_trace_9p_fid_put(struct p9_fid *fid);
> +
>  static inline struct p9_fid *p9_fid_get(struct p9_fid *fid)
>  {
> +	if (tracepoint_enabled(9p_fid_ref))

This here requires __tracepoint_9p_fid_ref exported...

> diff --git a/net/9p/client.c b/net/9p/client.c
> index f3eb280c7d9d..06d67a02d431 100644
> --- a/net/9p/client.c
> +++ b/net/9p/client.c
> @@ -928,6 +931,18 @@ static void p9_fid_destroy(struct p9_fid *fid)
>  	kfree(fid);
>  }
>  

So I've also added this here:

+/* We also need to export tracepoint symbols for tracepoint_enabled() */
+EXPORT_TRACEPOINT_SYMBOL(9p_fid_ref);
+

Which looks frequent enough to probably be the right thing to do?

(It's small enough that I won't bother repost a v3 unless something else
comes up)

> +void do_trace_9p_fid_get(struct p9_fid *fid)
> +{
> +	trace_9p_fid_ref(fid, P9_FID_REF_GET);
> +}
> +EXPORT_SYMBOL(do_trace_9p_fid_get);
> +
> +void do_trace_9p_fid_put(struct p9_fid *fid)
> +{
> +	trace_9p_fid_ref(fid, P9_FID_REF_PUT);
> +}
> +EXPORT_SYMBOL(do_trace_9p_fid_put);
> +
>  static int p9_client_version(struct p9_client *c)
>  {
>  	int err = 0;

-- 
Dominique

  reply	other threads:[~2022-06-13  7:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12  8:53 [PATCH 00/06] fid refcounting improvements and fixes Dominique Martinet
2022-06-12  8:53 ` [PATCH 01/06] 9p: fix fid refcount leak in v9fs_vfs_atomic_open_dotl Dominique Martinet
2022-06-13 16:27   ` Tyler Hicks
2022-06-14 13:17   ` Christian Schoenebeck
2022-06-12  8:53 ` [PATCH 02/06] 9p: fix fid refcount leak in v9fs_vfs_get_link Dominique Martinet
2022-06-13 16:29   ` Tyler Hicks
2022-06-14 13:19   ` Christian Schoenebeck
2022-06-12  8:53 ` [PATCH 03/06] 9p: v9fs_fid_lookup_with_uid fix's fix suggestion Dominique Martinet
2022-06-13 20:08   ` Tyler Hicks
2022-06-12  8:53 ` [PATCH 04/06] 9p fid refcount: add p9_fid_get/put wrappers Dominique Martinet
2022-06-12 23:45   ` [PATCH v2 " Dominique Martinet
2022-06-13 17:31     ` Tyler Hicks
2022-06-14 13:55     ` Christian Schoenebeck
2022-06-14 14:27       ` Dominique Martinet
2022-06-15  3:16       ` [PATCH v3 " Dominique Martinet
2022-06-15 13:00         ` Christian Schoenebeck
2022-06-15 13:47           ` Dominique Martinet
2022-06-12  8:53 ` [PATCH 05/06] 9p fid refcount: add a 9p_fid_ref tracepoint Dominique Martinet
2022-06-12 22:46   ` Steven Rostedt
2022-06-12 23:46     ` [PATCH v2 " Dominique Martinet
2022-06-13  7:00       ` Dominique Martinet [this message]
2022-06-12  8:53 ` [PATCH 06/06] 9p fid refcount: cleanup p9_fid_put calls Dominique Martinet
2022-06-13 17:55   ` Tyler Hicks
2022-06-13 19:50     ` Dominique Martinet
2022-06-13 20:12       ` Tyler Hicks
2022-06-13 20:20 ` [PATCH 00/06] fid refcounting improvements and fixes Tyler Hicks
2022-06-13 21:00   ` Dominique Martinet
2022-06-14  1:14     ` Tyler Hicks

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=YqbgpMJCVk44Q0zP@codewreck.org \
    --to=asmadeus@codewreck.org \
    --cc=davem@davemloft.net \
    --cc=ericvh@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tyhicks@linux.microsoft.com \
    --cc=v9fs-developer@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.