From owner-freebsd-scsi@FreeBSD.ORG Mon Dec 4 23:11:14 2006 Return-Path: X-Original-To: freebsd-scsi@freebsd.org Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C811716A403; Mon, 4 Dec 2006 23:11:14 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8B5443CBB; Mon, 4 Dec 2006 23:10:38 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from ns1.feral.com (localhost [127.0.0.1]) by ns1.feral.com (8.13.8/8.13.8) with ESMTP id kB4NB3cv018523; Mon, 4 Dec 2006 15:11:13 -0800 (PST) (envelope-from mjacob@freebsd.org) Received: from localhost (mjacob@localhost) by ns1.feral.com (8.13.8/8.13.8/Submit) with ESMTP id kB4NB3uk018520; Mon, 4 Dec 2006 15:11:03 -0800 (PST) (envelope-from mjacob@freebsd.org) X-Authentication-Warning: ns1.feral.com: mjacob owned process doing -bs Date: Mon, 4 Dec 2006 15:11:03 -0800 (PST) From: mjacob@freebsd.org X-X-Sender: mjacob@ns1.feral.com To: Attilio Rao In-Reply-To: <3bbf2fe10611201418m15d50703m37d9d5620e5c832d@mail.gmail.com> Message-ID: <20061204150922.F18492@ns1.feral.com> References: <20061119161631.L44297@ns1.feral.com> <3bbf2fe10611191631h6883b862uf8088533913a7bc6@mail.gmail.com> <20061120221153.GA5155@lor.one-eyed-alien.net> <3bbf2fe10611201418m15d50703m37d9d5620e5c832d@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-scsi@freebsd.org Subject: Re: a code reduction function addition to cam_xpt X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mjacob@freebsd.org List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Dec 2006 23:11:14 -0000 Was there ever a consensus about this to the point of: a) Yes, this is a nice thing to have b) Should it be a define or a function? I obviously think yes for #a. I lean toward a function. Comments? >> > >+void xpt_print(struct cam_path *path, const char >> *fmt, >> > >...); >> > > int xpt_path_string(struct cam_path *path, char >> *str, >> > > size_t str_len); >> > > path_id_t xpt_path_path_id(struct cam_path *path); >> > >> > Would not be better a preprocessing stub? >> > >> > something like: >> > >> > #define XPT_PRINT(path, fmt, ...) do { >> > \ >> > xpt_print_path(path); >> > \ >> > printf(fmt, __VA_ARGS__); >> > \ >> > } while (0) >> >> Why? What is gained? FWIW, when I added if_printif it reduced kernel >> size by several KB. If there's a similar effect here we should take >> advantage of it. > > It is simply faster (one function calling less), even if probabilly > this could be mitigated with -fomit-frame-pointer (IMHO, this is not > as over used as if_printf...). > > Attilio > > > -- > Peace can only be achieved by understanding - A. Einstein >