[Mesa-dev] debug_named_value description
bacn at zhasha.com
Wed Jun 2 11:43:37 PDT 2010
On Tue, 2010-06-01 at 19:46 +0200, Joakim Sindholt wrote:
> On Tue, 2010-06-01 at 17:24 +0100, José Fonseca wrote:
> > On Tue, 2010-06-01 at 09:08 -0700, Joakim Sindholt wrote:
> > > Hi.
> > > I just had a look at debug options in u_debug, specifically enumerated
> > > options in debug_get_flags_option(). It stands out that struct
> > > debug_named_value doesn't have a description field, as is used in r300g.
> > > I'm guessing that for this reason, r300g has it's own system, and I'm
> > > reluctant to use it as well.
> > > It can be quite useful to have a description available; especially when
> > > you have options named "fp", "vp", "cs", "rs", "fb", etc. that aren't
> > > exactly descriptive in their own right (at least for people unfamiliar
> > > with the driver).
> > >
> > > Would it be acceptable to add a description field to debug_named_value?
> > I think it might be useful.
> > Just make sure NULL is valid description and ensure that the existing
> > code is doesn't break or is fixed.
> > E.g., add a new DEBUG_NAMED_VALUE_WITH_DESCRIPTION macro and keep
> > DEBUG_NAMED_VALUE with the same number of args.
> > Jose
> I devised a path that will output something like this:
> debug_get_flags_option: help for NINE_DEBUG:
> | lib [0x00000001] Debugging information on library interface
> | xnine [0x00000002] Show X11 winsys information
> debug_get_flags_option: NINE_DEBUG = 0x0 (help)
> Any comments on the layout? Anything that should be aligned differently?
> Each argument is printed out with a pretty ugly format string:
> debug_printf("| %*s [0x%0*lx]%s%s\n", namealign, flags->name,
> sizeof(unsigned long)*CHAR_BIT/4, flags->value,
> flags->desc ? " " : "", flags->desc ? flags->desc : "");
Patches attached. If there are no objections I'll push these.
More information about the mesa-dev