[Mono-dev] include the logging profiler in a plugin lib

Adam ffa adam.ffa at gmail.com
Tue Jul 8 03:48:05 UTC 2014


I am trying to access the logging profiler
(mono/profiler/mono-profiler-logging.c) from a plug-able library. My plan
is to compile a C library that will call mono_profiler_startup (const char
*desc) and execute_user_command (char *command) to create heap dumps at my
whim. I spent time reading through the mono source code and am having
difficulty deciding if it's possible (errors that may occur as a result,
will the profiler methods exist, ... pitfalls) and how I should approach
accessing these methods (functions, flags, ... I need to set before and
after using the methods).

If I am unable to access the methods or they are not available, my back up
plan is to compile the logging profiler as a library and include it with my
library if possible. I found that it relies on config.h which worries me,
but I haven't done much research on my backup plan.

I'm using an older version of mono with the Boehm with typed GC. (So,
"MONO_PROFILE_GC_ROOTS"  doesn't exist which would have been way simpler
since I already rolled my own, which I learned from the Moonlight source,
using "profiler.h".)  Also, mono is embedded with no direct control
available to me, which is one of the reasons I'm working on an internal
profiler. My hope is to avoid duplicating a lot of the work already done in
mono-profile-logging.c and simply, relatively, hack into it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20140707/04863233/attachment.html>

More information about the Mono-devel-list mailing list