From: "Terje Bergström" <tbergstrom@nvidia.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Arto Merilainen <amerilainen@nvidia.com>,
Thierry Reding <thierry.reding@avionic-design.de>,
Erik Faye-Lund <kusmabite@gmail.com>
Subject: Re: Why have another variable deciding a tracepoint?
Date: Mon, 18 Nov 2013 08:48:53 +0200 [thread overview]
Message-ID: <5289B855.4080800@nvidia.com> (raw)
In-Reply-To: <20131115095240.334c9f6b@gandalf.local.home>
On 15.11.2013 16:52, Steven Rostedt wrote:
> So let me get this straight. The recording of the cdma_push() data is
> slow, correct? What mapping are you talking about?
>
> trace_host1x_cdma_push(dev_name(cdma_to_channel(cdma)->dev),
> op1, op2);
>
> #define cdma_to_channel(cdma) container_of(cdma, struct host1x_channel, cdma)
>
> That just references the cdma field of struct host1x_channel, to get
> the dev field, which does dev_name() that just gets the dev->init_name
> (if defined, or kobject_name() if not). And the two u32 fields that are
> passed in.
>
> The tracepoint assigns with:
>
> TP_fast_assign(
> __entry->name = name;
> __entry->op1 = op1;
> __entry->op2 = op2;
> ),
>
> So I still have to ask; what do you have to set up and take down here?
Oops, there's a piece missing that I didn't mention. What we want is a
full trace of what we're sending to the push buffer. See
hw/channel_hw.c/trace_write_gather(). It maps the buffer handed from
user space, dumps it to ftrace and unmaps it. That costs a lot of time
that we don't want to spend in normal operation and hence the special
condition.
trace_host1x_cdma_push() in the code you refer to just makes the dump
complete by adding some overhead opcodes that kernel needs to add. It
doesn't make sense to output that if we don't get the bulk from
trace_write_gather() and that's why it's also checking the same
conditional. It'd just make the trace look corrupted.
> It's documented in the code ;-) (kidding)
>
> Yeah, I need to get that out a bit more. That's actually how I found
> this code, I'm doing searches for all the locations that can benefit
> from TRACE_EVENT_CONDITION(), and I'm trying to fix them up. I'm still
> not convinced that this extra variable checking is required for this
> tracepoint.
>
> As you state though, I'll have to get time to document CONDITION() and
> how and when to use it.
Sounds good. :-)
Terje
prev parent reply other threads:[~2013-11-18 6:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 4:48 Why have another variable deciding a tracepoint? Steven Rostedt
2013-11-15 8:17 ` Terje Bergström
2013-11-15 14:52 ` Steven Rostedt
2013-11-18 6:48 ` Terje Bergström [this message]
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=5289B855.4080800@nvidia.com \
--to=tbergstrom@nvidia.com \
--cc=amerilainen@nvidia.com \
--cc=kusmabite@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--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;
as well as URLs for NNTP newsgroup(s).