From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: <linux-wireless@vger.kernel.org>, <ath6kl-devel@qca.qualcomm.com>
Subject: Re: [PATCH 2/7] ath6kl: add tracing points for sdio transfers
Date: Thu, 27 Dec 2012 17:32:47 +0200 [thread overview]
Message-ID: <87623nfr34.fsf@qca.qualcomm.com> (raw)
In-Reply-To: <1356610386.15149.6.camel@jlt4.sipsolutions.net> (Johannes Berg's message of "Thu, 27 Dec 2012 13:13:06 +0100")
Johannes Berg <johannes@sipsolutions.net> writes:
> On Thu, 2012-12-27 at 13:44 +0200, Kalle Valo wrote:
>
>> + if (request & HIF_WRITE)
>> + trace_ath6kl_sdio_wr(addr, request, buf, len);
>> + else
>> + trace_ath6kl_sdio_rd(addr, request, buf, len);
>
> It would be more efficient to use a single tracepoint and have a
> "direction" field or so -- then the if doesn't have to be executed when
> tracing is disabled.
Heh, I first had a single tracepoint with an int (1 == tx, 0 == rx) for
this but then I split it to two tracepoints just to make it easier for
filtering. But it would be good to get rid of that extra if.
One way would be to just remove if the clause and let user space parse
the request variable (btw which should be renamed to flags) but then
implementing printk for the trace point is more difficult as HIF_WRITE
is defined for the printk. Is there any easy way to "export" some of the
defines, like HIF_WRITE, for the printk part in a tracepoint?
>> + for (i = 0; i < scat_req->scat_entries; i++) {
>> + if (scat_req->req & HIF_WRITE)
>> + trace_ath6kl_sdio_wr(scat_req->addr,
>> + scat_req->req,
>> + scat_req->scat_list[i].buf,
>> + scat_req->scat_list[i].len);
>> + else
>> + trace_ath6kl_sdio_rd(scat_req->addr,
>> + scat_req->req,
>> + scat_req->scat_list[i].buf,
>> + scat_req->scat_list[i].len);
>> + }
>
> Same here, although it would be even better to move the loop into the
> tracepoint ... is there a small upper bound on "scat_entries"?
Yes, the limit should be 8.
> If yes, you could do something like here:
>
> http://git.kernel.org/?p=linux/kernel/git/iwlwifi/iwlwifi-next.git;a=blob;f=drivers/net/wireless/iwlwifi/iwl-devtrace.h;hb=HEAD#l325
>
> where I put a function call into the __entry to figure out how much
> space is needed.
That looks good, I'll take a look and try to implement the same for
ath6kl.
Thank you for the review!
Kalle
next prev parent reply other threads:[~2012-12-27 15:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-27 11:44 [PATCH 0/7] ath6kl: tracing support Kalle Valo
2012-12-27 11:44 ` [PATCH 1/7] ath6kl: add tracing support and tracing points for wmi packets Kalle Valo
2012-12-27 11:44 ` [PATCH 2/7] ath6kl: add tracing points for sdio transfers Kalle Valo
2012-12-27 12:13 ` Johannes Berg
2012-12-27 15:32 ` Kalle Valo [this message]
2012-12-27 11:44 ` [PATCH 3/7] ath6kl: add tracing point for hif irqs Kalle Valo
2012-12-27 11:44 ` [PATCH 4/7] ath6kl: adding tracing points for htc_mbox Kalle Valo
2012-12-27 11:44 ` [PATCH 5/7] ath6kl: convert ath6kl_info/err/warn macros to real functions Kalle Valo
2012-12-27 12:19 ` Johannes Berg
2012-12-27 15:47 ` Kalle Valo
2012-12-27 15:55 ` Kalle Valo
2012-12-27 11:44 ` [PATCH 6/7] ath6kl: add tracing support to log functions Kalle Valo
2012-12-27 11:44 ` [PATCH 7/7] ath6kl: add tracing support to debug message macros Kalle Valo
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=87623nfr34.fsf@qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath6kl-devel@qca.qualcomm.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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).