[Top][All Lists]

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

Re: [PATCH] dprintf implementation

From: Vincent Pelletier
Subject: Re: [PATCH] dprintf implementation
Date: Thu, 24 Feb 2005 09:02:07 +0100
User-agent: Debian Thunderbird 1.0 (X11/20050116)

Hollis Blanchard wrote:
Your mailer did some bad stuff to this patch again...

Argh. I wonder if it is because I sign my mails...

Weren't we going to have various flags to selectively enable debug messages from particular components at runtime?

Iirc there were differences of point of view on that matter.
Okuji, what do you think about that idea ?

What about something like :
GRUB> command_to_be_watched
file.c,line (D_PARTMAP): Partmap of type 'foo' found.
file2.c,line (D_FS): Superblock valid, fs 'bar'.

I see those points to be done :
- define | operator
- name-to-value conversion for constants (case-sensitive ?)
- value-to-name conversion for constants

What about modules ? It should be good to make them able to add new
error constants (maybe only one per module ?) that would match their own

Here are some prototypes as I think of them:
char *grub_debug_constants[sizeof(grub_debug_mask)*8];
int grub_debug_constant_request (const char *name);
  return value : -1 = no more available bit, -2 = duplicate name,
  otherwise 1<<value would give the position of the bit in the mask.
  That binary shift would be done by grub_dprintf. Checks for duplicate
  name (again, case sensitive ?).
void grub_dprintf (int value, char *format, ...);
  "value" would be the one returned by grub_debug_constant_request.
void grub_debug_constant_release (int value);

Vincent Pelletier

reply via email to

[Prev in Thread] Current Thread [Next in Thread]