/* simple tool to test persistent databases Copyright (C) Andrew Tridgell 2006-2007 Copyright (c) Ronnie sahlberg 2007 Copyright (C) Michael Adam 2009 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #include "includes.h" #include "system/filesys.h" #include "popt.h" #include "cmdline.h" #include #include static struct timeval tp1,tp2; static void start_timer(void) { gettimeofday(&tp1,NULL); } static double end_timer(void) { gettimeofday(&tp2,NULL); return (tp2.tv_sec + (tp2.tv_usec*1.0e-6)) - (tp1.tv_sec + (tp1.tv_usec*1.0e-6)); } static int timelimit = 10; static int delay = 0; static int verbose = 0; static unsigned int pnn; static TDB_DATA old_data; static bool success = false; static void print_counters(void) { int i; uint32_t *old_counters; printf("[%4u] Counters: ", getpid()); old_counters = (uint32_t *)old_data.dptr; for (i=0;i