* change in their disk utilization.
*
* @param cls closure (NULL)
- * @param delta change in disk utilization,
+ * @param delta change in disk utilization,
* 0 for "reset to empty"
*/
static void
GNUNET_CRYPTO_random_u32
(GNUNET_CRYPTO_QUALITY_WEAK, 1000))), &msg))
{
- fprintf (stderr, "ERROR: `%s'\n", msg);
+ FPRINTF (stderr, "ERROR: `%s'\n", msg);
GNUNET_free_non_null (msg);
return;
}
stored_entries++;
}
-static void test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+static void
+test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static int
-iterate_zeros (void *cls,
- const GNUNET_HashCode * key,
- uint32_t size,
- const void *data,
- enum GNUNET_BLOCK_Type type,
- uint32_t priority,
- uint32_t anonymity,
- struct GNUNET_TIME_Absolute expiration, uint64_t uid)
+iterate_zeros (void *cls, const GNUNET_HashCode * key, uint32_t size,
+ const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority,
+ uint32_t anonymity, struct GNUNET_TIME_Absolute expiration,
+ uint64_t uid)
{
struct CpsRunContext *crc = cls;
int i;
hits[i / 8] |= (1 << (i % 8));
#if VERBOSE
- fprintf (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n",
+ FPRINTF (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n",
type, priority, size, (unsigned long long) expiration.abs_value);
#endif
crc->cnt++;
(unsigned long long) (crc->end.abs_value - crc->start.abs_value),
bc, crc->cnt);
if (crc->cnt > 0)
- GAUGER (category,
- "Select random zero-anonymity item",
+ GAUGER (category, "Select random zero-anonymity item",
(crc->end.abs_value - crc->start.abs_value) / crc->cnt,
"ms/item");
memset (hits, 0, sizeof (hits));
static int
-expiration_get (void *cls,
- const GNUNET_HashCode * key,
- uint32_t size,
- const void *data,
- enum GNUNET_BLOCK_Type type,
- uint32_t priority,
- uint32_t anonymity,
+expiration_get (void *cls, const GNUNET_HashCode * key, uint32_t size,
+ const void *data, enum GNUNET_BLOCK_Type type,
+ uint32_t priority, uint32_t anonymity,
struct GNUNET_TIME_Absolute expiration, uint64_t uid)
{
struct CpsRunContext *crc = cls;
(unsigned long long) (crc->end.abs_value - crc->start.abs_value),
bc, (unsigned int) PUT_10);
if (crc->cnt > 0)
- GAUGER (category,
- "Selecting and deleting by expiration",
+ GAUGER (category, "Selecting and deleting by expiration",
(crc->end.abs_value - crc->start.abs_value) / crc->cnt,
"ms/item");
memset (hits, 0, sizeof (hits));
static int
-replication_get (void *cls,
- const GNUNET_HashCode * key,
- uint32_t size,
- const void *data,
- enum GNUNET_BLOCK_Type type,
- uint32_t priority,
- uint32_t anonymity,
+replication_get (void *cls, const GNUNET_HashCode * key, uint32_t size,
+ const void *data, enum GNUNET_BLOCK_Type type,
+ uint32_t priority, uint32_t anonymity,
struct GNUNET_TIME_Absolute expiration, uint64_t uid)
{
struct CpsRunContext *crc = cls;
(unsigned long long) (crc->end.abs_value - crc->start.abs_value),
bc, (unsigned int) PUT_10);
if (crc->cnt > 0)
- GAUGER (category,
- "Selecting random item for replication",
+ GAUGER (category, "Selecting random item for replication",
(crc->end.abs_value - crc->start.abs_value) / crc->cnt,
"ms/item");
memset (hits, 0, sizeof (hits));
char *libname;
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "DATASTORE", "DATABASE", &name))
+ GNUNET_CONFIGURATION_get_value_string (cfg, "DATASTORE", "DATABASE",
+ &name))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("No `%s' specified for `%s' in configuration!\n"),
- "DATABASE", "DATASTORE");
+ _("No `%s' specified for `%s' in configuration!\n"), "DATABASE",
+ "DATASTORE");
return;
}
GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name);
crc->phase = RP_ERROR;
}
#if VERBOSE
- fprintf (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt);
+ FPRINTF (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt);
#endif
switch (crc->phase)
{
putValue (crc->api, j, crc->i);
crc->end = GNUNET_TIME_absolute_get ();
{
- printf ("%s took %llu ms for %llu items\n",
- "Storing an item",
+ printf ("%s took %llu ms for %llu items\n", "Storing an item",
(unsigned long long) (crc->end.abs_value - crc->start.abs_value),
PUT_10);
if (PUT_10 > 0)
- GAUGER (category,
- "Storing an item",
+ GAUGER (category, "Storing an item",
(crc->end.abs_value - crc->start.abs_value) / PUT_10,
"ms/item");
}
crc->api->get_replication (crc->api->cls, &replication_get, crc);
break;
case RP_ZA_GET:
- crc->api->get_zero_anonymity (crc->api->cls,
- crc->offset++, 1, &iterate_zeros, crc);
+ crc->api->get_zero_anonymity (crc->api->cls, crc->offset++, 1,
+ &iterate_zeros, crc);
break;
case RP_EXP_GET:
crc->api->get_expiration (crc->api->cls, &expiration_get, crc);
char *libname;
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg,
- "DATASTORE", "DATABASE", &name))
+ GNUNET_CONFIGURATION_get_value_string (cfg, "DATASTORE", "DATABASE",
+ &name))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("No `%s' specified for `%s' in configuration!\n"),
- "DATABASE", "DATASTORE");
+ _("No `%s' specified for `%s' in configuration!\n"), "DATABASE",
+ "DATASTORE");
return NULL;
}
env.cfg = cfg;
env.duc = &disk_utilization_change_cb;
env.cls = NULL;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("Loading `%s' datastore plugin\n"), name);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading `%s' datastore plugin\n"),
+ name);
GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name);
if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env)))
{
- fprintf (stderr, "Failed to load plugin `%s'!\n", name);
+ FPRINTF (stderr, "Failed to load plugin `%s'!\n", name);
return NULL;
}
GNUNET_free (libname);
static void
-run (void *cls,
- char *const *args,
- const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
+run (void *cls, char *const *args, const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *c)
{
struct GNUNET_DATASTORE_PluginFunctions *api;
struct CpsRunContext *crc;
api = load_plugin (c);
if (api == NULL)
{
- fprintf (stderr,
- "Could not initialize plugin, assuming database not configured. Test not run!\n");
+ FPRINTF (stderr,
+ "%s", "Could not initialize plugin, assuming database not configured. Test not run!\n");
return;
}
crc = GNUNET_malloc (sizeof (struct CpsRunContext));
};
GNUNET_snprintf (category, sizeof (category), "DATASTORE-%s", plugin_name);
- GNUNET_snprintf (cfg_name,
- sizeof (cfg_name),
+ GNUNET_snprintf (cfg_name, sizeof (cfg_name),
"perf_plugin_datastore_data_%s.conf", plugin_name);
- GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
- argv, "perf-plugin-datastore", "nohelp",
- options, &run, NULL);
+ GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
+ "perf-plugin-datastore", "nohelp", options, &run, NULL);
if (ok != 0)
- fprintf (stderr, "Missed some testcases: %u\n", ok);
+ FPRINTF (stderr, "Missed some testcases: %u\n", ok);
return ok;
}
else
pos = (char *) plugin_name;
- GNUNET_snprintf (dir_name,
- sizeof (dir_name),
- "/tmp/perf-gnunet-datastore-%s", plugin_name);
+ GNUNET_snprintf (dir_name, sizeof (dir_name), "/tmp/perf-gnunet-datastore-%s",
+ plugin_name);
GNUNET_DISK_directory_remove (dir_name);
GNUNET_log_setup ("perf-plugin-datastore",
#if VERBOSE