Re: [RFCv2] cld: replace "if (verbose) { act_log }" with CLD_DEBUG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/06/2009 07:23 PM, Pete Zaitcev wrote:
On Sun,  6 Dec 2009 07:41:05 -0800
Colin McCabe<cmccabe@xxxxxxxxxxxxxx>  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




--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux