All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Rasmussen <axelrasmussen@google.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Yafang Shao <laoar.shao@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Michel Lespinasse <walken@google.com>,
	Daniel Jordan <daniel.m.jordan@oracle.com>,
	Davidlohr Bueso <dbueso@suse.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>
Subject: Re: [PATCH] mmap_lock: add tracepoints around lock acquisition
Date: Wed, 23 Sep 2020 09:40:23 -0700	[thread overview]
Message-ID: <CAJHvVcgmJYZS=+g2_V7Bkx3fVGVZEytdpQDQgxu2nEe3qJh2OQ@mail.gmail.com> (raw)
In-Reply-To: <20200923120924.49638d90@oasis.local.home>

On Wed, Sep 23, 2020 at 9:09 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Wed, 23 Sep 2020 18:04:17 +0800
> Yafang Shao <laoar.shao@gmail.com> wrote:
>
> > > What you can do, and what we have done is the following:
> > >
> > > (see include/linux/page_ref.h)
> > >
> > >
> > > #ifdef CONFIG_TRACING
> > > extern struct tracepoint __tracepoint_mmap_lock_start_locking;
> > > extern struct tracepoint __tracepoint_mmap_lock_acquire_returned;
> > >
> > > #define mmap_lock_tracepoint_active(t) static_key_false(&(__tracepoint_mmap_lock_##t).key)
> > >
> > > #else
> > > #define mmap_lock_tracepoint_active(t) false
> > > #endif
> > >
> > > static inline void mmap_write_lock(struct mm_struct *mm)
> > > {
> > >         if (mmap_lock_tracepoint_active(start_locking))
> > >                 mmap_lock_start_trace_wrapper();
> > >         down_write(&mm->mmap_lock);
> > >         if (mmap_lock_tracepoint_active(acquire_returned))
> > >                 mmap_lock_acquire_trace_wrapper();
> > > }
> > >
> > >
> > > -- Steve
> >
> >
> > Great!
> >
> > Thanks Steve.
>
> If the above becomes useful, I may just add helper functions into a
> header file that you can include. Perhaps call it: tracepoint_active()
> and you need to pass in as an argument the name of the tracepoint.

Thanks for this suggestion Steven, it's working quite well.

I also have a very short patch to the tracing which allows plumbing
the string values through to "just work".

I plan to send out a v2 before the end of the week.

>
> -- Steve

  reply	other threads:[~2020-09-23 16:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 18:13 [PATCH] mmap_lock: add tracepoints around lock acquisition Axel Rasmussen
2020-09-17 18:13 ` Axel Rasmussen
2020-09-17 19:42 ` Steven Rostedt
2020-09-18 20:26   ` Axel Rasmussen
2020-09-18 20:26     ` Axel Rasmussen
2020-09-18 20:41     ` Steven Rostedt
2020-09-23 22:07       ` Tom Zanussi
2020-09-23 22:07         ` Tom Zanussi
2020-09-21  4:57 ` Yafang Shao
2020-09-21  4:57   ` Yafang Shao
2020-09-21 16:53   ` Axel Rasmussen
2020-09-21 16:53     ` Axel Rasmussen
2020-09-22  4:09     ` Yafang Shao
2020-09-22  4:09       ` Yafang Shao
2020-09-22 16:39       ` Axel Rasmussen
2020-09-22 16:39         ` Axel Rasmussen
2020-09-22 16:51       ` Steven Rostedt
2020-09-23 10:04         ` Yafang Shao
2020-09-23 10:04           ` Yafang Shao
2020-09-23 16:09           ` Steven Rostedt
2020-09-23 16:40             ` Axel Rasmussen [this message]
2020-09-23 16:40               ` Axel Rasmussen
2020-09-24  4:28             ` Yafang Shao
2020-09-24  4:28               ` Yafang Shao

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='CAJHvVcgmJYZS=+g2_V7Bkx3fVGVZEytdpQDQgxu2nEe3qJh2OQ@mail.gmail.com' \
    --to=axelrasmussen@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.m.jordan@oracle.com \
    --cc=dbueso@suse.de \
    --cc=laoar.shao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=vbabka@suse.cz \
    --cc=walken@google.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 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.