#include "mono/metadata/mono-debug.h"
#include "mono/metadata/class-internals.h"
#include "mono/metadata/domain-internals.h"
+#include "mono/metadata/gc-internal.h"
#include "mono/io-layer/io-layer.h"
#include <string.h>
#include <sys/time.h>
void
mono_profiler_install_gc (MonoProfileGCFunc callback, MonoProfileGCResizeFunc heap_resize_callback)
{
+ mono_gc_enable_events ();
gc_event = callback;
gc_heap_resize = heap_resize_callback;
}
{
char *sig, *res;
- sig = mono_signature_get_desc (method->signature, FALSE);
+ sig = mono_signature_get_desc (mono_method_signature (method), FALSE);
res = g_strdup_printf ("%s.%s::%s(%s)", method->klass->name_space, method->klass->name,
method->name, sig);
g_free (sig);
m = method_get_name (p->method);
printf ("########################\n");
printf ("% 8.3f ", (double) (p->total * 1000));
- printf ("%7llu ", p->count);
+ printf ("%7llu ", (unsigned long long)p->count);
printf ("% 8.3f ", (double) (p->total * 1000)/(double)p->count);
printf (" %s\n", m);
/* callers */
output_callers (p);
}
- printf ("Total number of calls: %lld\n", total_calls);
+ printf ("Total number of calls: %lld\n", (long long)total_calls);
}
typedef struct {
char *mn;
gpointer ip;
GList *tmp, *sorted = NULL;
+ int pcount = ++ prof_counts;
- prof_counts ++;
+ prof_counts = MAX_PROF_SAMPLES;
for (i = 0; i < count; ++i) {
ip = prof_addresses [i];
ji = mono_jit_info_table_find (mono_domain_get (), ip);
if (c > 1)
g_free (mn);
}
- g_print ("prof counts: total/unmanaged: %d/%d\n", prof_counts, prof_ucounts);
+ g_print ("prof counts: total/unmanaged: %d/%d\n", pcount, prof_ucounts);
g_hash_table_foreach (prof_table, (GHFunc)prof_foreach, &sorted);
for (tmp = sorted; tmp; tmp = tmp->next) {
double perc;
g_list_free (profile);
g_free (prof_addresses);
+ prof_addresses = NULL;
g_hash_table_destroy (prof_table);
}
{
MonoProfiler *prof;
gchar **args, **ptr;
- MonoProfileFlags flags = MONO_PROFILE_JIT_COMPILATION;
+ MonoProfileFlags flags = 0;
MONO_TIMER_STARTUP;
if (!desc)
- desc = "alloc,time";
+ desc = "alloc,time,jit";
if (desc) {
/* Parse options */
if (strstr (desc, ":"))
desc = strstr (desc, ":") + 1;
else
- desc = "alloc,time";
+ desc = "alloc,time,jit";
args = g_strsplit (desc, ",", -1);
for (ptr = args; ptr && *ptr; ptr++) {
flags |= MONO_PROFILE_ALLOCATIONS;
else if (!strcmp (arg, "stat"))
flags |= MONO_PROFILE_STATISTICAL | MONO_PROFILE_APPDOMAIN_EVENTS;
+ else if (!strcmp (arg, "jit"))
+ flags |= MONO_PROFILE_JIT_COMPILATION;
else {
fprintf (stderr, "profiler : Unknown argument '%s'.\n", arg);
return;