Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Steven Rostedt <rostedt@goodmis.org>, linux-kernel@vger.kernel.org
Cc: Yafang Shao <laoar.shao@gmail.com>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michel Lespinasse <walken@google.com>,
	Daniel Jordan <daniel.m.jordan@oracle.com>,
	Davidlohr Bueso <dbueso@suse.de>, Linux MM <linux-mm@kvack.org>,
	Ingo Molnar <mingo@kernel.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH 1/3 v2] tracepoints: Add helper to test if tracepoint is enabled in a header
Date: Tue, 20 Oct 2020 13:59:46 +0200
Message-ID: <8b122215-867a-2517-f754-fbe87118f00c@suse.cz> (raw)
In-Reply-To: <20200925211819.767526657@goodmis.org>

On 9/25/20 11:12 PM, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> 
> As tracepoints are discouraged from being added in a header because it can
> cause side effects if other tracepoints are in headers, as well as bloat the
> kernel as the trace_<tracepoint>() function is not a small inline, the common
> workaround is to add a function call that calls a wrapper function in a
> C file that then calls the tracepoint. But as function calls add overhead,
> this function should only be called when the tracepoint in question is
> enabled. To get around this overhead, a static_branch can be used to only
> have the tracepoint wrapper get called when the tracepoint is enabled.
> 
> Add a tracepoint_enabled(tp) macro that gets passed the name of the
> tracepoint, and this becomes a static_branch that is enabled when the
> tracepoint is enabled and is a nop when the tracepoint is disabled.
> 
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Nice! I'm late here, but you mentioned a v3, so FWIW:

Acked-by: Vlastimil Babka <vbabka@suse.cz>


  parent reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 21:12 [PATCH 0/3 v2] tracing/mm: Add tracepoint_enabled() helper function for headers Steven Rostedt
2020-09-25 21:12 ` [PATCH 1/3 v2] tracepoints: Add helper to test if tracepoint is enabled in a header Steven Rostedt
2020-09-25 21:36   ` Axel Rasmussen
2020-09-25 21:59     ` Steven Rostedt
2020-10-20 11:59   ` Vlastimil Babka [this message]
2020-10-20 20:43     ` Steven Rostedt
2020-09-25 21:12 ` [PATCH 2/3 v2] mm/page_ref: Convert the open coded tracepoint enabled to the new helper Steven Rostedt
2020-10-20 12:10   ` Vlastimil Babka
2020-09-25 21:12 ` [PATCH 3/3 v2] x86: Use tracepoint_enabled() for msr tracepoints instead of open coding it Steven Rostedt
2020-09-26  6:55   ` kernel test robot
2020-09-25 21:26 ` [PATCH 0/3 v2] tracing/mm: Add tracepoint_enabled() helper function for headers Steven Rostedt
2020-09-25 22:23   ` Mathieu Desnoyers

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=8b122215-867a-2517-f754-fbe87118f00c@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=daniel.m.jordan@oracle.com \
    --cc=dbueso@suse.de \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=laoar.shao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    --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

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git