Use file offset in msync instead of vma address

Current code erroneously uses vma address to lookup write cache pages instead
of file offsets. This patch fixes it.

Fixes #452.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: fix 'trace.py download'

Broken by 3730c3953ca0cbae940f41134f73764ec1abb9d1.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: make 'trace.py download' convert the buffers to tracefile by default

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tst-seek: convert to boost UTF

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tst-seek: add test case which checks that seek actually works

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Move tracepoint_count functions into the kernel

Before this patch, trace-count.hh was purly a header file, and when
we used it in a shared object (such as httpserver.so), the code of
the tracepoint hit() function ended up part of the shared object.

Because the hit() function often runs in preemption-disabled context,
this caused a bunch of problems. One problem we already worked around
was that on the first call, it might call a function for the first
time and cause a (possibly sleeping) symbol resolution. But another
bug we never solved was that pages from the shared object might be
evicted, in which case suddenly hit() will cause a page fault.

So this patch moves the hit() implementation out of line, from
trace-count.hh to a new trace-count.cc, i.e., into the kernel's code.
While we're at it, I moved the other inline functions out of line too.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
pvclock: assert TSC monotonicity
mutex_unlock_wake
scripts: hacky fault-contention by vma grouping