All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Rob Landley <rob@landley.net>
Subject: Re: [RFC/PATCH] printk: detect incomplete lines
Date: Mon, 12 May 2008 08:35:04 -0700	[thread overview]
Message-ID: <1210606504.5880.32.camel@localhost> (raw)
In-Reply-To: <20080512114925.GA29407@damson.getinternet.no>

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;
	}



      parent reply	other threads:[~2008-05-12 16:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-12 11:49 [RFC/PATCH] printk: detect incomplete lines Vegard Nossum
2008-05-12 11:56 ` Pekka Enberg
2008-05-12 12:00   ` Vegard Nossum
2008-05-13 10:54     ` Andi Kleen
2008-05-13 15:31       ` Vegard Nossum
2008-05-12 15:35 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1210606504.5880.32.camel@localhost \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=vegard.nossum@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.