Increase default console ring allocation size and reduce default verbosity

In order to have better chance that relevant messages fit into the
ring buffer, allocate a dynamic (larger) one in more cases, and make
the default allocation size depend on both the number of CPUs and the
log level. Also free the static buffer if a dynamic one was obtained.

In order for "xm dmesg" to retrieve larger buffers, eliminate
pyxc_readconsolering()'s 32k limitation resulting from the use of a
statically allocated buffer.

Finally, suppress on x86 most per-CPU boot time messages (by default,
most of them can be re-enabled with a new command line option
"cpuinfo", some others are now only printed more than once when there
are inconsistencies between CPUs). This reduces both boot time (namely
when a graphical console is in use) and pressure on the console ring
and serial transmit buffers.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
This commit is contained in:
Keir Fraser committed 2010-03-17 08:34:16 +00:00
1 parent a7e7bb6199
commit 35d60c59af
16 files changed
+168 -76

No files matched your search

+29 -4
View File
@@ -1062,14 +1062,16 @@ static PyObject *pyxc_readconsolering(XcObject *self,
PyObject *kwds)
{
unsigned int clear = 0, index = 0, incremental = 0;
char _str[32768], *str = _str;
unsigned int count = 32768;
unsigned int count = 16384 + 1, size = count;
char *str = malloc(size), *ptr;
PyObject *obj;
int ret;
static char *kwd_list[] = { "clear", "index", "incremental", NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iii", kwd_list,
&clear, &index, &incremental) )
&clear, &index, &incremental) ||
!str )
return NULL;
ret = xc_readconsolering(self->xc_handle, &str, &count, clear,
@@ -1077,7 +1079,30 @@ static PyObject *pyxc_readconsolering(XcObject *self,
if ( ret < 0 )
return pyxc_error_to_exception();
return PyString_FromStringAndSize(str, count);
while ( !incremental && count == size )
{
size += count - 1;
if ( size < count )
break;
ptr = realloc(str, size);
if ( !ptr )
break;
str = ptr + count;
count = size - count;
ret = xc_readconsolering(self->xc_handle, &str, &count, clear,
1, &index);
if ( ret < 0 )
break;
count += str - ptr;
str = ptr;
}
obj = PyString_FromStringAndSize(str, count);
free(str);
return obj;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.