public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Preliminary: Add error names & descrptions to printks
@ 2013-09-17 23:08 danielfsantos
  2013-09-17 23:08 ` [PATCH 1/5] scripts: Add mkstrerror.sh danielfsantos
                   ` (5 more replies)
  0 siblings, 6 replies; 24+ messages in thread
From: danielfsantos @ 2013-09-17 23:08 UTC (permalink / raw)
  To: linux-kbuild, LKML, Michal Marek, Andrew Morton, Paul E. McKenney,
	David Howells, Thomas Gleixner, Michael Kerrisk, Dave Hansen,
	George Spelvin


This is a preliminary patch set as the root Makefile changes are not yet
correct.

Summary

Typically, we don't care about error messages or names in the kernel because
userspace will manage that.  But sometimes we need to output an error number
to printks and that creates a situation where a user, system admistrator or
developer must find an error number reference to figure out what went wrong
with a particular driver or whatever.  This patch adds two alternatives at
increasing memory costs:

1. print the number in addition to the name for 2k extra or
2. print the number, name and description for 6k extra.

This is fairly low cost for the person who wants to make life just a little
bit easier. The format of each is respectively the same as the following:

  printk("%d (%s)", err, err_name);
  printk("%d (%s: %s)", err, err_name, err_desc);

Theory

Error messages aren't printed often, so this data and code is designed to be
compact at the expense of speed.  Rather than using an array of strings that
would require both the text and a pointer to that text, we just cram a range
of error names or descriptions into a single string with null character
delimiters.  When we want to retrieve a string, we just iterate through that
string and count nulls.  This is slow, but it keeps it compact. (If this
becomes a bottleneck then something else is seriously wrong! :)


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-09-23 20:17 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 23:08 [PATCH 0/5] Preliminary: Add error names & descrptions to printks danielfsantos
2013-09-17 23:08 ` [PATCH 1/5] scripts: Add mkstrerror.sh danielfsantos
2013-09-18 11:38   ` David Howells
2013-09-18 11:55     ` David Howells
2013-09-18 22:27       ` Daniel Santos
2013-09-18 22:43     ` Daniel Santos
2013-09-19 22:35     ` Daniel Santos
2013-09-19 22:53       ` Daniel Santos
2013-09-17 23:08 ` [PATCH 2/5] lib: Add .config options for error strings in printks danielfsantos
2013-09-17 23:18   ` Daniel Santos
2013-09-17 23:08 ` [PATCH 3/5] Makefile: Generate error_strings.h danielfsantos
2013-09-17 23:08 ` [PATCH 4/5] lib: Add strerror and strerror_name functions danielfsantos
2013-09-17 23:08 ` [PATCH 5/5] lib: Add error string support to printks danielfsantos
2013-09-18  5:36   ` Joe Perches
2013-09-18 11:04     ` David Howells
2013-09-19  1:27       ` Daniel Santos
2013-09-20  1:07         ` Joe Perches
2013-09-20  5:21           ` Daniel Santos
2013-09-20 11:45             ` Joe Perches
2013-09-20 13:07               ` David Howells
2013-09-23 20:17                 ` Daniel Santos
2013-09-23 19:40               ` Daniel Santos
2013-09-18 11:08 ` [PATCH 0/5] Preliminary: Add error names & descrptions " David Howells
2013-09-18 22:47   ` Daniel Santos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox