From: Jeff Garzik <jeff@garzik.org>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: Colin McCabe <cmccabe@alumni.cmu.edu>,
Project Hail List <hail-devel@vger.kernel.org>
Subject: Re: [RFCv2] cld: replace "if (verbose) { act_log }" with CLD_DEBUG
Date: Sun, 06 Dec 2009 20:06:54 -0500 [thread overview]
Message-ID: <4B1C552E.4030904@garzik.org> (raw)
In-Reply-To: <20091206172304.30cb0361@redhat.com>
On 12/06/2009 07:23 PM, Pete Zaitcev wrote:
> On Sun, 6 Dec 2009 07:41:05 -0800
> Colin McCabe<cmccabe@alumni.cmu.edu> wrote:
>
>> Move prototypes for common.c functions out of cld_msg.h and into a new header
>> file, common.h. Create a structure that represents the current log level and
>> also the function to use for logging.
>
>> static int sess_send_pkt(struct cldc_session *sess,
>> const struct cld_packet *pkt, size_t pkt_len)
>> {
>> - if (sess->verbose) {
>> + if (sess->log.verbose) {
>> uint32_t flags = le32_to_cpu(pkt->flags);
>> bool first = (flags& CPF_FIRST);
>> bool last = (flags& CPF_LAST);
>
> I'm wondering if we can drop these ifs now, at the cost of some
> small inefficiency.
I would rather keep the if's. The verbose logging is unlikely to be
used in production. Therefore, the common case would be to execute
unnecessary code for each packet.
Jeff
next prev parent reply other threads:[~2009-12-07 1:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-06 15:41 [RFCv2] cld: replace "if (verbose) { act_log }" with CLD_DEBUG Colin McCabe
2009-12-07 0:23 ` Pete Zaitcev
2009-12-07 1:06 ` Jeff Garzik [this message]
2009-12-07 22:03 ` Jeff Garzik
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=4B1C552E.4030904@garzik.org \
--to=jeff@garzik.org \
--cc=cmccabe@alumni.cmu.edu \
--cc=hail-devel@vger.kernel.org \
--cc=zaitcev@redhat.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.