mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Terje Bergstrom <tbergstrom@nvidia.com>,
	Arto Merilainen <amerilainen@nvidia.com>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	Erik Faye-Lund <kusmabite@gmail.com>
Subject: Why have another variable deciding a tracepoint?
Date: Thu, 14 Nov 2013 23:48:12 -0500	[thread overview]
Message-ID: <20131114234812.3bf7bce9@gandalf.local.home> (raw)

I've been reviewing different users of tracepoints and I stumbled
across this:

drivers/gpu/host1x/cdma.c: host1x_cdma_push()

	if (host1x_debug_trace_cmdbuf)
		trace_host1x_cdma_push(dev_name(cdma_to_channel(cdma)->dev),
				       op1, op2);

That host1x_debug_trace_cmdbuf is a variable that gets set by another
debugfs file "trace_cmdbuf" that is custom to this driver.

Why?

The tracepoint host1x_cdma_push is already controlled by either ftrace
or perf. If it gets enabled by perf or ftrace, it still wont be traced
unless we also enable this trace_cmdbuf. Is there some reason for this?
I can't figure it out from the change log: 6236451d83a720 ("gpu:
host1x: Add debug support").

As tracepoints uses jump labels, there is no branch cost associated
with them. That is, they are either a direct jump, or a nop (in most
cases a nop). But here you added the overhead of a conditional branch
depending on this variable.

If this is truly needed, then use TRACE_EVENT_CONDITION() for that
tracepoint.


/me is baffled

-- Steve



             reply	other threads:[~2013-11-15  4:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15  4:48 Steven Rostedt [this message]
2013-11-15  8:17 ` Terje Bergström
2013-11-15 14:52   ` Steven Rostedt
2013-11-18  6:48     ` Terje Bergström

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=20131114234812.3bf7bce9@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=amerilainen@nvidia.com \
    --cc=kusmabite@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tbergstrom@nvidia.com \
    --cc=thierry.reding@avionic-design.de \
    /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

all inboxes | Powered by JetHome®