gdb: fix padding for short bits str

bits2str() uses the length of bits chars to add paddings when printing
fields. This patch fixes the situation when length of bits chars is
less than len('none').

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
gdb: show offset/path for file mapped vma in 'osv mmap'

Before:
(gdb) osv mmap
0x0000000000000000 0x0000000000000000 [0 kB]           flags=none     perm=none
0x0000100000000000 0x00001000000a4000 [656 kB]         flags=fmF      perm=rx
0x00001000002a3000 0x00001000002a9000 [24 kB]          flags=fmF      perm=rw
0x0000100000400000 0x0000100000415000 [84 kB]          flags=fmF      perm=rx
0x0000100000614000 0x0000100000615000 [4 kB]           flags=fmF      perm=r
0x0000100000615000 0x0000100000616000 [4 kB]           flags=fmF      perm=rw
0x0000200000000000 0x0000200000001000 [4 kB]           flags=p        perm=none
0x0000200000001000 0x0000200000100000 [1020 kB]        flags=p        perm=rw
...

After:
(gdb) osv mmap
0x0000000000000000 0x0000000000000000 [0 kB]           flags=none     perm=none
0x0000100000000000 0x00001000000a4000 [656 kB]         flags=fmF      perm=rx   offset=0x00000000 path=/libhttpserver.so
0x00001000002a3000 0x00001000002a9000 [24 kB]          flags=fmF      perm=rw   offset=0x000a3000 path=/libhttpserver.so
0x0000100000400000 0x0000100000415000 [84 kB]          flags=fmF      perm=rx   offset=0x00000000 path=/usr/lib/libgcc_s.so.1
0x0000100000614000 0x0000100000615000 [4 kB]           flags=fmF      perm=r    offset=0x00014000 path=/usr/lib/libgcc_s.so.1
0x0000100000615000 0x0000100000616000 [4 kB]           flags=fmF      perm=rw   offset=0x00015000 path=/usr/lib/libgcc_s.so.1
0x0000200000000000 0x0000200000001000 [4 kB]           flags=p        perm=none
0x0000200000001000 0x0000200000100000 [1020 kB]        flags=p        perm=rw
...

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Clean up tests/misc-mutex.cc

tests/misc-mutex.cc includes some mutex benchmarks and tests, but was
a big mess and this patch cleans some of the dead code, useless stuff,
and over-verbose output.

The test now includes 4 main parts:

* Measure the size in bytes of the mutual exclusion primitives, spinlock
  and mutex (this comes out to 1 byte and 40 bytes, respectively).

* Measure the single-CPU uncontended lock/unlock cycle, for both mutex
  and spinlock. On my machine this shows about 25ns, and 12ns, respectively.

* Measure the lock/unlock cycle when several threads in a tight loop
  requesting the same lock. We try 2 threads, 4 threads (on 4 cpus),
  and 20 threads on 4 cpus.
  Here the mutex is significantly slower than the spinlock, because the
  spinlock only context-switches when the thread's time slice is over,
  while the mutex context-switches on most lock/unlock cycles, as we
  sleep while waiting for another thread to release the lock.

* Additional correctness tests, less useful as benchmarks.

Reviewed-by: Dor Laor <dor@cloudius-systems.com>
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>