trace: get rid of extra new-line in 'list-timed' output

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
gdb: fix 'osv info thread' thread address printout

Print the thread pointer, not the address of the thread pointer.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
debug: create circular buffer for silent mode

Create a circular buffer that stored all debug messages accordingly.
If the debug buffer is full, reuse it. A method called flush_debug_buffer
is added to enable printing all messages to console if verbose mode is
configured.

The global variable debug_buffer_full is used to track if, when
flushing debug buffer to console, we need to flush both buffer sides.

If verbose boolean variable is set, all messages are printed to the
console after beeing stored in the buffer.

The size of the buffer is 50Kb, defined in debug.hh.

A function debugf that received a variable list of arguments
is defined so we can change some printf from boot sequence
to debugf call. A different name is used to prevent C overload.

Signed-off-by: Eduardo Piva <efpiva@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
loader: Add --verbose option to OSv

Add --verbose options to OSv, so it will flush buffer after
handling the kernel option and set verbose boolean flag in
debug code.

Signed-off-by: Eduardo Piva <efpiva@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
debug: Change calls to printf on boot messages

Change some printf calls on boot messages, so it will call
the apropriate debug function. This will enable OSv
to operate on silent mode.

Added debug.h header so we can link debug functions to C files.

Fixes #118

Signed-off-by: Eduardo Piva <efpiva@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
java: Use debugf() for autotuning message

Make the JVM heap autotuning message silent by default.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
net: fix socket send/receive timeout

Microsecond values were passed as is instead of being scaled by hz.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tst-kill: fix timeout test

The timeout test sets a 2 second timeout and a 1 second alarm, and expects
the timeout to happen first.

Change the timeout to 0.5 seconds.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Silence the qemu-ifup script

Drop echoing: "SCRIPT, tap0"

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc: Make RLIMIT_STACK 1 MB in size

Currently, RLIMIT_STACK is 64 KB.  This is too small for the JVM which
limits stack size to RLIMIT_STACK if a VMA range that covers address
found in '__libc_stack_end' in /proc/self/maps.

So in preparation for procfs support, bump up RLIMIT_STACK to 1 MB.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs: 'struct file' to VOP_READ

Add 'struct file' to VOP_READ API. This is needed for procfs which
generates file contents at open() time and read() must operate on it,
not the vnode.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
mmu: procfs support

Add procfs_maps() function to core/mmu.cc that returns all the VMAs
formatted for Linux compatible "/proc/<pid>/maps" file.

This will be called by the procfs filesystem.

Limitations:

  * Shared mappings are not identified as such.
  * File-backed mmap offset, device, inode, and pathname are not
    reported.
  * Special region names such as [heap] and [stack] are not reported.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
proc filesystem

This patch adds a simple Linux compatible procfs filesystem.  It
currently implements a "/proc/self/maps" file which is looked up by
OpenJDK during startup.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs: mount procfs at boot

Add a '/proc' directory to OSv image and mount procfs on it.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: miscs-procfs.so

Add a simple manual test case for checking "/proc/self/maps" output.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>