X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Ftools%2Fspeed.c;h=ccb5ae349d894f43d57ce0349b280d6539713e7d;hb=926996e88c32445c874ff9c4f47f159db6b45995;hp=881d101300ead9a102f9a787aa2d74b083da9d6a;hpb=838db0d7ea37fc2a21d03d159b55b042f8144cb3;p=ccan diff --git a/ccan/tdb2/tools/speed.c b/ccan/tdb2/tools/speed.c index 881d1013..ccb5ae34 100644 --- a/ccan/tdb2/tools/speed.c +++ b/ccan/tdb2/tools/speed.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include "tdb2.h" /* Nanoseconds per operation */ static size_t normalize(const struct timeval *start, @@ -126,11 +126,14 @@ static void dump_and_clear_stats(struct tdb_context **tdb, *tdb = tdb_open("/tmp/speed.tdb", flags, O_RDWR, 0, attr); } -static void tdb_log(struct tdb_context *tdb, enum tdb_log_level level, - const char *message, void *data) +static void tdb_log(struct tdb_context *tdb, + enum tdb_log_level level, + enum TDB_ERROR ecode, + const char *message, + void *data) { - fputs(message, stderr); - putc('\n', stderr); + fprintf(stderr, "tdb:%s:%s:%s\n", + tdb_name(tdb), tdb_errorstr(ecode), message); } int main(int argc, char *argv[])