Sai Pavan Boddu <sai.pavan.bo...@xilinx.com> writes: > Hi Markus, > >> -----Original Message----- >> From: Markus Armbruster [mailto:arm...@redhat.com] >> Sent: Monday, September 07, 2015 2:35 PM >> To: Sai Pavan Boddu >> Cc: peter.mayd...@linaro.org; Alistair Francis; crosthwaitepe...@gmail.com; >> qemu-devel@nongnu.org; Edgar Iglesias >> Subject: Re: [Qemu-devel] [PATCH V3 2/2] sdhci: Change debug prints to >> compile unconditionally >> >> Sai Pavan Boddu <sai.pavan.bo...@xilinx.com> writes: >> >> >> -----Original Message----- >> >> From: Markus Armbruster [mailto:arm...@redhat.com] >> >> Sent: Monday, September 07, 2015 1:05 PM >> >> To: Sai Pavan Boddu >> >> Cc: qemu-devel@nongnu.org; crosthwaitepe...@gmail.com; >> >> ebl...@redhat.com; peter.mayd...@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 <sai.pavan.bo...@xilinx.com> writes: >> >> >> >> > Conditionaly compilation hides few type mismatch warnings, fix it to >> >> > compile unconditioinal. >> >> > >> >> > Signed-off-by: Sai Pavan Boddu <saip...@xilinx.com> >> >> > Suggested-by: Eric Blake <ebl...@redhat.com> >> >> >> >> No objection to this patch, but have you considered tracepoints? >> >> See docs/tracing.txt. >> > >> > [Sai Pavan ] No, I didn’t do that. Actually no knowledge on that. Let >> > me figure it out what it does. Even better if you can just explain in >> > few lines, for what trace tool is used? >> >> For a simple example of how to convert from debug prints to tracepoints, >> check out commit f6e3534. >> >> Perhaps the simplest way to get the debugging output then is the >> "stderr" backend you get with "configure --enable-trace-backend=stderr". >> Run QEMU with "-trace events=foo", 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: >> >> fw_cfg_* >> >> 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.