From 95e09c7668e0d41e82b069caae5310d7fa5cbd71 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 19 Aug 2018 19:01:45 +0200 Subject: [PATCH] fix benchmark for threads --- contrib/guix/gnu/packages/gnunet.scm | 2 +- src/util/benchmark.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/contrib/guix/gnu/packages/gnunet.scm b/contrib/guix/gnu/packages/gnunet.scm index 0602aec0b..6089ee2fa 100644 --- a/contrib/guix/gnu/packages/gnunet.scm +++ b/contrib/guix/gnu/packages/gnunet.scm @@ -214,7 +214,7 @@ authentication and support for SSL3 and TLS.") ("pkg-config" ,pkg-config) ("python" ,python-2))) (arguments - `(#:configure-flags (list "--disable-ntlm-wb") + `(#:configure-flags (list "--enable-benchmark") #:test-target "test" #:parallel-tests? #f #:phases diff --git a/src/util/benchmark.c b/src/util/benchmark.c index f832931ee..108e01659 100644 --- a/src/util/benchmark.c +++ b/src/util/benchmark.c @@ -64,8 +64,9 @@ write_benchmark_data (struct BenchmarkData *bd) return; } - GNUNET_asprintf (&s, "%s/gnunet-benchmark-ops-%llu-%llu.txt", + GNUNET_asprintf (&s, "%s/gnunet-benchmark-ops-%s-%llu-%llu.txt", benchmark_dir, + (pid == tid) ? "main" : "thread", (unsigned long long) pid, (unsigned long long) tid); @@ -116,8 +117,9 @@ write_benchmark_data (struct BenchmarkData *bd) GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_close (fh)); - GNUNET_asprintf (&s, "%s/gnunet-benchmark-urls-%llu-%llu.txt", + GNUNET_asprintf (&s, "%s/gnunet-benchmark-urls-%s-%llu-%llu.txt", benchmark_dir, + (pid == tid) ? "main" : "thread", (unsigned long long) pid, (unsigned long long) tid); @@ -175,6 +177,7 @@ thread_destructor (void *cls) return; GNUNET_assert (NULL != bd); + write_benchmark_data (bd); } -- 2.25.1