}
static void
-method_enter (MonoProfiler *prof, MonoMethod *method)
+method_enter (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *ctx)
{
if (get_thread ()->call_depth++ <= log_config.max_call_depth) {
ENTER_LOG (&method_entries_ctr, logbuffer,
}
static void
-method_leave (MonoProfiler *prof, MonoMethod *method)
+method_leave (MonoProfiler *prof, MonoMethod *method, MonoProfilerCallContext *ctx)
{
if (--get_thread ()->call_depth <= log_config.max_call_depth) {
ENTER_LOG (&method_exits_ctr, logbuffer,
char c = 1;
if (write (prof->pipes [1], &c, 1) != 1) {
- mono_profiler_printf_err ("Could not write to log profiler pipe: %s", strerror (errno));
+ mono_profiler_printf_err ("Could not write to log profiler pipe: %s", g_strerror (errno));
exit (1);
}
if (errno == EINTR)
continue;
- mono_profiler_printf_err ("Could not poll in log profiler helper thread: %s", strerror (errno));
+ mono_profiler_printf_err ("Could not poll in log profiler helper thread: %s", g_strerror (errno));
exit (1);
}
start_helper_thread (void)
{
if (pipe (log_profiler.pipes) == -1) {
- mono_profiler_printf_err ("Could not create log profiler pipe: %s", strerror (errno));
+ mono_profiler_printf_err ("Could not create log profiler pipe: %s", g_strerror (errno));
exit (1);
}
log_profiler.server_socket = socket (PF_INET, SOCK_STREAM, 0);
if (log_profiler.server_socket == -1) {
- mono_profiler_printf_err ("Could not create log profiler server socket: %s", strerror (errno));
+ mono_profiler_printf_err ("Could not create log profiler server socket: %s", g_strerror (errno));
exit (1);
}
server_address.sin_port = htons (log_profiler.command_port);
if (bind (log_profiler.server_socket, (struct sockaddr *) &server_address, sizeof (server_address)) == -1) {
- mono_profiler_printf_err ("Could not bind log profiler server socket on port %d: %s", log_profiler.command_port, strerror (errno));
+ mono_profiler_printf_err ("Could not bind log profiler server socket on port %d: %s", log_profiler.command_port, g_strerror (errno));
close (log_profiler.server_socket);
exit (1);
}
if (listen (log_profiler.server_socket, 1) == -1) {
- mono_profiler_printf_err ("Could not listen on log profiler server socket: %s", strerror (errno));
+ mono_profiler_printf_err ("Could not listen on log profiler server socket: %s", g_strerror (errno));
close (log_profiler.server_socket);
exit (1);
}
socklen_t slen = sizeof (server_address);
if (getsockname (log_profiler.server_socket, (struct sockaddr *) &server_address, &slen)) {
- mono_profiler_printf_err ("Could not retrieve assigned port for log profiler server socket: %s", strerror (errno));
+ mono_profiler_printf_err ("Could not retrieve assigned port for log profiler server socket: %s", g_strerror (errno));
close (log_profiler.server_socket);
exit (1);
}
log_profiler.startup_time = current_time ();
}
-/*
- * declaration to silence the compiler: this is the entry point that
- * mono will load from the shared library and call.
- */
-extern void
-mono_profiler_init (const char *desc);
-
-extern void
+MONO_API void
mono_profiler_init_log (const char *desc);
-/*
- * this is the entry point that will be used when the profiler
- * is embedded inside the main executable.
- */
void
mono_profiler_init_log (const char *desc)
-{
- mono_profiler_init (desc);
-}
-
-void
-mono_profiler_init (const char *desc)
{
GPtrArray *filters = NULL;
mono_lls_init (&log_profiler.profiler_thread_list, NULL);
- MonoProfilerHandle handle = log_profiler.handle = mono_profiler_install (&log_profiler);
+ MonoProfilerHandle handle = log_profiler.handle = mono_profiler_create (&log_profiler);
/*
* Required callbacks. These are either necessary for the profiler itself