Re: [RFC/PATCH] printk: detect incomplete lines

From: Joe Perches
Date: Mon May 12 2008 - 12:00:20 EST


On Mon, 2008-05-12 at 13:49 +0200, Vegard Nossum wrote:
> So we are now using __builtin_frame_address(). This should work everywhere
> and should not cause any harmful side effects.

Perhaps print an identifier using __builtin_frame_address(0)
to allow an external tool to reassemble complete messages?

> + if (prev_caller != __builtin_frame_address(0) && !log_level_unknown) {
> + emit_log_char('.');
> + emit_log_char('.');
> + emit_log_char('.');
> + emit_log_char('\n');
> + log_level_unknown = 1;
> + }
> +
> + prev_caller = __builtin_frame_address(0);
> +

maybe something like:

static void emit_log_id(void *addr)
{
unsigned int i = 0;
char id[sizeof(void *) * 2 + 6];
sprintf(id, "{@%p}", addr);
while (*id[i])
emit_log_char(id[i++]);
}
...
caller = __builtin_frame_address(0);
if (prev_caller != caller && !log_level_unknown) {
emit_log_id(caller);
log_level_unknown = 1;
prev_caller = caller;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/