Received: from eggs.gnu.org ([2001:4830:134:3::10]:55401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxv6-0006IA-4x for qemu-devel@nongnu.org; Mon, 07 Sep 2015 11:01:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYxv2-0000E0-St for qemu-devel@nongnu.org; Mon, 07 Sep 2015 11:01:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxv2-0000Du-MP for qemu-devel@nongnu.org; Mon, 07 Sep 2015 11:01:16 -0400 From: Markus Armbruster References: <1441608340-26983-1-git-send-email-saipava@xilinx.com> <1441608340-26983-2-git-send-email-saipava@xilinx.com> <87h9n6smvc.fsf@blackfin.pond.sub.org> <4025671C58A6E340B47F5CA342BC783A42AAA1D5@XAP-PVEXMBX02.xlnx.xilinx.com> <87zj0yob0o.fsf@blackfin.pond.sub.org> <4025671C58A6E340B47F5CA342BC783A42AAA2F6@XAP-PVEXMBX02.xlnx.xilinx.com> Date: Mon, 07 Sep 2015 17:01:13 +0200 In-Reply-To: <4025671C58A6E340B47F5CA342BC783A42AAA2F6@XAP-PVEXMBX02.xlnx.xilinx.com> (Sai Pavan Boddu's message of "Mon, 7 Sep 2015 13:05:03 +0000") Message-ID: <87bnde8e9y.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V3 2/2] sdhci: Change debug prints to compile unconditionally List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sai Pavan Boddu Cc: "peter.maydell@linaro.org" , Edgar Iglesias , Alistair Francis , "crosthwaitepeter@gmail.com" , "qemu-devel@nongnu.org" Sai Pavan Boddu writes: > Hi Markus, > >> -----Original Message----- >> From: Markus Armbruster [mailto:armbru@redhat.com] >> Sent: Monday, September 07, 2015 2:35 PM >> To: Sai Pavan Boddu >> Cc: peter.maydell@linaro.org; Alistair Francis; crosthwaitepeter@gmail.c= om; >> qemu-devel@nongnu.org; Edgar Iglesias >> Subject: Re: [Qemu-devel] [PATCH V3 2/2] sdhci: Change debug prints to >> compile unconditionally >>=20 >> Sai Pavan Boddu writes: >>=20 >> >> -----Original Message----- >> >> From: Markus Armbruster [mailto:armbru@redhat.com] >> >> Sent: Monday, September 07, 2015 1:05 PM >> >> To: Sai Pavan Boddu >> >> Cc: qemu-devel@nongnu.org; crosthwaitepeter@gmail.com; >> >> eblake@redhat.com; peter.maydell@linaro.org; Sai Pavan Boddu; Edgar >> >> Iglesias; Alistair Francis >> >> Subject: Re: [Qemu-devel] [PATCH V3 2/2] sdhci: Change debug prints to >> >> compile unconditionally >> >> >> >> Sai Pavan Boddu writes: >> >> >> >> > Conditionaly compilation hides few type mismatch warnings, fix it to >> >> > compile unconditioinal. >> >> > >> >> > Signed-off-by: Sai Pavan Boddu >> >> > Suggested-by: Eric Blake >> >> >> >> No objection to this patch, but have you considered tracepoints? >> >> See docs/tracing.txt. >> > >> > [Sai Pavan ] No, I didn=E2=80=99t do that. Actually no knowledge on th= at. Let >> > me figure it out what it does. Even better if you can just explain in >> > few lines, for what trace tool is used? >>=20 >> For a simple example of how to convert from debug prints to tracepoints, >> check out commit f6e3534. >>=20 >> Perhaps the simplest way to get the debugging output then is the >> "stderr" backend you get with "configure --enable-trace-backend=3Dstderr= ". >> Run QEMU with "-trace events=3Dfoo", where file foo contains a list of >> events to enable. To get all the tracepoints added by the commit above, >> try this one-element list: >>=20 >> fw_cfg_* >>=20 >> Hope this suffices to get you started. > > [Sai Pavan ] Thanks, this was useful. And I even tried to apply the > same to sdhci. And the problems I faced in using this are as below. > > -> Present sdhci debug prints are not event oriented. i.e they are > generic, so the number of arguments are changing for most of the > DPRINT markers. Is there a way trace-events can manage variable > arguments rather that fixed debug string and fixed number of > arguments. > > i.e consider two prints like below, and convert them to use trace_debug > > DPRINT("Read From %lx",READ_REG); > DPRINT("Write to %lx with mask %lx",WRITE_REG, WRITE_MASK); > > We need to use two trace_debug* fuctions, as these are two different > events. We cannot generically use the same for both. Yes. As in commit f6e3534, every DPRINT() becomes a distinct tracepoint. > -> And even the format specifiers cannot be changed as everything here > is happening at run time. > > Yes, that was a very good idea to use trace tool. But much changes are > needed in present code to get the same implementation. Will create the > patches implementing the same later. > > Anyways that was a good intro to the tracer. Thanks! You're welcome.