}
static void
-counters_sample (MonoProfiler *profiler, uint64_t timestamp)
+counters_sample (MonoProfiler *profiler)
{
+ static uint64_t start = -1, timestamp;
+
MonoCounterAgent *agent;
MonoCounter *counter;
LogBuffer *logbuffer;
void *buffer;
int size;
+ if (start == -1)
+ start = current_time ();
+
if (!counters_initialized)
return;
+ timestamp = (current_time () - start) / 1000/ 1000;
+
buffer_size = 8;
buffer = calloc (1, buffer_size);
{
in_shutdown = 1;
#ifndef DISABLE_HELPER_THREAD
+ counters_sample (prof);
+
if (prof->command_port) {
char c = 1;
void *res;
int len;
char buf [64];
MonoThread *thread = NULL;
- uint64_t start, now;
//fprintf (stderr, "Server listening\n");
- start = current_time ();
command_socket = -1;
while (1) {
fd_set rfds;
}
}
#endif
- now = current_time ();
- counters_sample (prof, (now - start) / 1000/ 1000);
+
+ counters_sample (prof);
tv.tv_sec = 1;
tv.tv_usec = 0;