[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Tracing and profiling blog post

> On 27 Oct 2014, at 11:31, Thomas Leonard <talex5@xxxxxxxxx> wrote:
> On 27 October 2014 11:22, Anil Madhavapeddy <anil@xxxxxxxxxx> wrote:
>> On 27 Oct 2014, at 11:17, Thomas Leonard <talex5@xxxxxxxxx> wrote:
>>> Note that everything should (in future) compile with an unmodified
>>> Lwt. Pinning the tracing version of Lwt is what will trigger
>>> everything to recompile with profiling support. So, getting this
>>> upstream shouldn't block anything (and might indeed be difficult),
>>> although if upstream wants to add a flag for it that would be great
>>> too.
>>> This is a change to my previous plan of having Lwt depend on
>>> mirage-profiling. Now, mirage-profiling depends on Lwt. If you want to
>>> use any extended feature of Lwt you should go via profiling. e.g. in
>>> mirage-platform we have:
>>> let ports = Array.init nr_events (fun port -> {
>>> counter = program_start;
>>> c = Profile.named_condition ("after-chn-" ^ string_of_int port)
>>> })
>>> If Lwt.tracing is installed then Profile.named_condition is:
>>> let named_condition label =
>>> Lwt_condition.create ~label ()
>>> Without, it will be:
>>> let named_condition _label = Lwt_condition.create ()
>> This also sounds like the right order, and permits other tracing
>> strategies in the future for Lwt.  Are you doing the mirage-platform
>> conditional compilation via optcomp?
> My plan is that only mirage-profile will use conditional compilation
> and everything else will always depend on mirage-profile, but get the
> calls optimised out by the compiler when tracing isn't being used.
> Currently though I haven't implemented anything. I was thinking of
> having two versions of profile.ml and only compiling the appropriate
> one.
> mirage-profile is currently using assemblage, so any suggestions on
> the best way to do that are welcome. My current thought is to have a
> flag saying whether you want profiling, and have OPAM set the flag
> depending on the availablilty of the lwt.tracing ocamlfind package
> (which the modified Lwt installs). Or should the build detect this
> somehow?
> If assemblage is too experimental for mirage-dev, I could also convert to 
> oasis.

Assemblage is still undergoing 'rapid iteration', so I'd suggest
switching to OASIS until we have a more stable version.  ThomasG or
Daniel Buenzli can correct me if that's not accurate.

MirageOS-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.