Re: [PATCH] Use helpers to obtain task pid in printks (arch code)

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

 



On Mon, 2007-08-27 at 11:30 +0400, Pavel Emelyanov wrote:
> From: Alexey Dobriyan <[email protected]>
> 
> One of the easiest things to isolate is the pid printed in kernel
> log. There was a patch, that made this for arch-independent code,
> this one makes so for arch/xxx files.

Perhaps it would be worthwhile to standardize the printk
task information content? Maybe a format knob?

Maybe TASK_FMT/TASK_ARG(task)

#define TASK_FMT "%s"
#define TASK_ARG(tsk) ({char __buf[MAX_TASK_INFO]; print_task(tsk, buf, sizeof(__buf)); __buf})

char* print_task(const struct task_struct* tsk, char* buf, size_t size)
{
	char* p = buf;
	int task_knob = get_task_knob();
	*p++ = '[';
	if (task_knob & feature)
		p += snprintf(p, size - (p - buf), fmt, feature);
	[...]
	*p++ = ']';
	return buf;
}
EXPORT_SYMBOL(print_task)


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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux