Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
#include <tevent.h>
#include "lib/util/debug.h"
+#include "lib/util/time.h"
#include "ctdb_private.h"
#include "ctdb_client.h"
pid_t ctdb_fork(struct ctdb_context *ctdb)
{
pid_t pid;
+ struct timeval before;
+ double delta_t;
+
+ before = timeval_current();
pid = fork();
if (pid == -1) {
return 0;
}
+ delta_t = timeval_elapsed(&before);
+ if (delta_t > 3.0) {
+ DEBUG(DEBUG_WARNING, ("fork() took %lf seconds\n", delta_t));
+ }
+
ctdb_track_child(ctdb, pid);
return pid;
}