Added profiling/tracing support
Merge pull request #14 from talex5/tracing2

Added profiling/tracing support
Start refactoring module types

- move module types to lib/s.ml (avoiding silly .ml .mli duplication)
- make PIPE-related types fully abstract: we will specialise with
  concrete types elsewhere

Signed-off-by: David Scott <dave.scott@citrix.com>
Update the Xenstore and Console ring to the new API

Signed-off-by: David Scott <dave.scott@citrix.com>
Functorise PIPE over EVENTS

We now have
- available: immediately returns data available now
- wait: blocks until n units of data are available

Signed-off-by: David Scott <dave.scott@citrix.com>
Implement the PIPE.wait function

This blocks on the EVENT (channel, or other source of events) until
n units of data are available for reading or writing.

Signed-off-by: David Scott <dave.scott@citrix.com>
Import In_memory_events from ocaml-vchan

The implementation of a buffered ring will be functorised over
the EVENTS signature and will need an in-process implementation.
We should move this code into xen-evtchn and remove it from both
ocaml-vchan and here.

Signed-off-by: David Scott <dave.scott@citrix.com>
Remove the 'type channel' from the 'WINDOW' signature

Instead the adopt the convention that the 'create' function passes
in the correct event channel to use, so we don't have to keep
resupplying it on every call to 'wait'

Signed-off-by: David Scott <dave.scott@citrix.com>
Pipe: signal on the event channel when data is formally consumed

Although we can read from and write to available space, it's only
when we bump the pointers that we need to signal the associated
channel.

Signed-off-by: David Scott <dave.scott@citrix.com>
BufferedPipe: proxy data in both directions

This isn't quite right as we have only one event channel connected
and clearly we need two channels connected to each other.

Signed-off-by: David Scott <dave.scott@citrix.com>
Expose both frontend and backend versions of the rings

Signed-off-by: David Scott <dave.scott@citrix.com>
BufferedPipe: split into backend and frontend

The user will read and write from the frontend, while a hidden
backend proxies data in both directions to and from the real
device.

Signed-off-by: David Scott <dave.scott@citrix.com>
test: add a simple unit test for the xenstore ring

Signed-off-by: David Scott <dave.scott@citrix.com>
Incremental: add a write function

Signed-off-by: David Scott <dave.scott@citrix.com>
Incremental: change type data = Cstruct.t list

We need this so we can guarantee to write payloads atomically, even
over a ring wrap.

Signed-off-by: David Scott <dave.scott@citrix.com>