[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 02/02: gauger: removed
From: |
gnunet |
Subject: |
[gnunet] 02/02: gauger: removed |
Date: |
Mon, 09 Sep 2024 16:16:15 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 52c683592d24ef262da263b6e631d1ecec4c2638
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Mon Sep 9 16:15:53 2024 +0200
gauger: removed
---
src/include/Makefile.am | 1 -
src/include/gauger.h | 81 -----------------------------------
src/lib/util/perf_crypto_asymmetric.c | 2 -
src/lib/util/perf_crypto_cs.c | 1 -
src/lib/util/perf_crypto_ecc_dlog.c | 10 -----
src/lib/util/perf_crypto_hash.c | 10 -----
src/lib/util/perf_crypto_paillier.c | 16 -------
src/lib/util/perf_crypto_rsa.c | 28 +-----------
src/lib/util/perf_crypto_symmetric.c | 5 ---
src/lib/util/perf_malloc.c | 13 ++----
src/lib/util/perf_mq.c | 5 ---
src/lib/util/perf_scheduler.c | 8 ++--
src/lib/util/service.c | 26 -----------
src/service/fs/test_fs_download.c | 17 --------
src/service/nse/perf_kdf.c | 6 ---
15 files changed, 9 insertions(+), 220 deletions(-)
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index 4907ba8e1..c1c2d7617 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -5,7 +5,6 @@ gnunetincludedir = $(includedir)/gnunet
EXTRA_DIST = \
platform.h \
- gauger.h \
block_fs.h \
block_dns.h \
block_regex.h
diff --git a/src/include/gauger.h b/src/include/gauger.h
deleted file mode 100644
index f811b335c..000000000
--- a/src/include/gauger.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* ---------------------------------------------------------------------------
- * This software is in the public domain, furnished "as is", without technical
- * support, and with no warranty, express or implied, as to its usefulness for
- * any purpose.
- *
- * gauger.h
- * Interface for C programs to log remotely to a gauger server
- *
- * Author: Bartlomiej Polot
- * -------------------------------------------------------------------------*/
-#ifndef __GAUGER_H__
-#define __GAUGER_H__
-
-
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/wait.h>
-
-#define GAUGER(category, counter, value, unit) \
- { \
- char*__gauger_v[10]; \
- char __gauger_s[32]; \
- pid_t __gauger_p; \
- if (! (__gauger_p = fork ())) { \
- close (1); \
- close (2); \
- if (! fork ()) { \
- sprintf (__gauger_s, "%Lf", (long double) (value)); \
- __gauger_v[0] = "gauger"; \
- __gauger_v[1] = "-n"; \
- __gauger_v[2] = (char *) (counter); \
- __gauger_v[3] = "-d"; \
- __gauger_v[4] = __gauger_s; \
- __gauger_v[5] = "-u"; \
- __gauger_v[6] = (char *) (unit); \
- __gauger_v[7] = "-c"; \
- __gauger_v[8] = (char *) (category); \
- __gauger_v[9] = (char *) NULL; \
- execvp ("gauger", __gauger_v); \
- _exit (1); \
- }else{ \
- _exit (0); \
- } \
- }else{ \
- waitpid (__gauger_p, NULL, 0); \
- } \
- }
-
-#define GAUGER_ID(category, counter, value, unit, id) \
- { \
- char*__gauger_v[12]; \
- char __gauger_s[32]; \
- pid_t __gauger_p; \
- if (! (__gauger_p = fork ())) { \
- close (1); \
- close (2); \
- if (! fork ()) { \
- sprintf (__gauger_s, "%Lf", (long double) (value)); \
- __gauger_v[0] = "gauger"; \
- __gauger_v[1] = "-n"; \
- __gauger_v[2] = (char *) (counter); \
- __gauger_v[3] = "-d"; \
- __gauger_v[4] = __gauger_s; \
- __gauger_v[5] = "-u"; \
- __gauger_v[6] = (char *) (unit); \
- __gauger_v[7] = "-i"; \
- __gauger_v[8] = id; \
- __gauger_v[9] = "-c"; \
- __gauger_v[10] = (char *) (category); \
- __gauger_v[11] = (char *) NULL; \
- execvp ("gauger", __gauger_v); \
- _exit (1); \
- }else{ \
- _exit (0); \
- } \
- }else{ \
- waitpid (__gauger_p, NULL, 0); \
- } \
- }
-
-#endif
diff --git a/src/lib/util/perf_crypto_asymmetric.c
b/src/lib/util/perf_crypto_asymmetric.c
index c033a02ca..31b2f2a88 100644
--- a/src/lib/util/perf_crypto_asymmetric.c
+++ b/src/lib/util/perf_crypto_asymmetric.c
@@ -26,7 +26,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#include <gauger.h>
static struct GNUNET_TIME_Absolute start;
@@ -55,7 +54,6 @@ log_duration (const char *cryptosystem,
s,
GNUNET_STRINGS_relative_time_to_string (t,
GNUNET_NO));
- GAUGER ("UTIL", s, t.rel_value_us, "us");
}
diff --git a/src/lib/util/perf_crypto_cs.c b/src/lib/util/perf_crypto_cs.c
index 43f32aae0..cd4600214 100644
--- a/src/lib/util/perf_crypto_cs.c
+++ b/src/lib/util/perf_crypto_cs.c
@@ -28,7 +28,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#include <gauger.h>
#define ITER 10
diff --git a/src/lib/util/perf_crypto_ecc_dlog.c
b/src/lib/util/perf_crypto_ecc_dlog.c
index 698a3aafa..678010067 100644
--- a/src/lib/util/perf_crypto_ecc_dlog.c
+++ b/src/lib/util/perf_crypto_ecc_dlog.c
@@ -27,8 +27,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
#include <gcrypt.h>
-#include <gauger.h>
-
/**
* Name of the curve we are using. Note that we have hard-coded
@@ -155,9 +153,6 @@ main (int argc, char *argv[])
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
GNUNET_YES));
- GAUGER ("UTIL", "ECC DLOG initialization",
- GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL, "ms/op");
start = GNUNET_TIME_absolute_get ();
/* first do a baseline run without the DLOG */
test_dlog (edc, false);
@@ -171,11 +166,6 @@ main (int argc, char *argv[])
TEST_ITER,
GNUNET_STRINGS_relative_time_to_string (delta,
GNUNET_YES));
- GAUGER ("UTIL",
- "ECC DLOG operations",
- delta.rel_value_us / 1000LL / TEST_ITER,
- "ms/op");
-
GNUNET_CRYPTO_ecc_dlog_release (edc);
return 0;
}
diff --git a/src/lib/util/perf_crypto_hash.c b/src/lib/util/perf_crypto_hash.c
index 6e8671fc8..48cf40b26 100644
--- a/src/lib/util/perf_crypto_hash.c
+++ b/src/lib/util/perf_crypto_hash.c
@@ -26,8 +26,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#include <gauger.h>
-#include <gcrypt.h>
static void
@@ -93,20 +91,12 @@ main (int argc, char *argv[])
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
GNUNET_YES));
- GAUGER ("UTIL", "Cryptographic hashing",
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "kb/ms");
start = GNUNET_TIME_absolute_get ();
perfHKDF ();
printf ("HKDF perf took %s\n",
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
GNUNET_YES));
- GAUGER ("UTIL", "Cryptographic HKDF",
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "kb/ms");
return 0;
}
diff --git a/src/lib/util/perf_crypto_paillier.c
b/src/lib/util/perf_crypto_paillier.c
index 53c717a66..274b0bae7 100644
--- a/src/lib/util/perf_crypto_paillier.c
+++ b/src/lib/util/perf_crypto_paillier.c
@@ -26,8 +26,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#include <gauger.h>
-
int
main (int argc, char *argv[])
@@ -47,11 +45,6 @@ main (int argc, char *argv[])
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
GNUNET_YES));
- GAUGER ("UTIL", "Paillier key generation",
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "keys/ms");
-
m1 = gcry_mpi_new (0);
m1 = gcry_mpi_set_ui (m1, 1);
/* m1 = m1 * 2 ^ (GCPB - 3) */
@@ -68,10 +61,6 @@ main (int argc, char *argv[])
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
GNUNET_YES));
- GAUGER ("UTIL", "Paillier encryption",
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "ops/ms");
start = GNUNET_TIME_absolute_get ();
for (i = 0; i < 10; i++)
@@ -83,11 +72,6 @@ main (int argc, char *argv[])
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
GNUNET_YES));
- GAUGER ("UTIL", "Paillier decryption",
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "ops/ms");
-
return 0;
}
diff --git a/src/lib/util/perf_crypto_rsa.c b/src/lib/util/perf_crypto_rsa.c
index 721973b1a..474e9b270 100644
--- a/src/lib/util/perf_crypto_rsa.c
+++ b/src/lib/util/perf_crypto_rsa.c
@@ -26,8 +26,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#include <gauger.h>
-
/**
* Evaluate RSA performance.
@@ -63,10 +61,6 @@ eval (unsigned int len)
sizeof(sbuf),
"RSA %u-key generation",
len);
- GAUGER ("UTIL", sbuf,
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "keys/ms");
private_key = GNUNET_CRYPTO_rsa_private_key_create (len);
public_key = GNUNET_CRYPTO_rsa_private_key_get_public (private_key);
for (i = 0; i < 10; i++)
@@ -109,11 +103,6 @@ eval (unsigned int len)
sizeof(sbuf),
"RSA %u-blinding",
len);
- GAUGER ("UTIL",
- sbuf,
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "ops/ms");
GNUNET_CRYPTO_rsa_blind (&hc,
sizeof (hc),
&bsec[0],
@@ -135,11 +124,6 @@ eval (unsigned int len)
sizeof(sbuf),
"RSA %u-signing",
len);
- GAUGER ("UTIL",
- sbuf,
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "ops/ms");
sig = GNUNET_CRYPTO_rsa_sign_blinded (private_key,
&bm);
start = GNUNET_TIME_absolute_get ();
@@ -159,11 +143,6 @@ eval (unsigned int len)
sizeof(sbuf),
"RSA %u-unblinding",
len);
- GAUGER ("UTIL",
- sbuf,
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "ops/ms");
rsig = GNUNET_CRYPTO_rsa_unblind (sig,
&bsec[0],
public_key);
@@ -185,11 +164,6 @@ eval (unsigned int len)
sizeof(sbuf),
"RSA %u-verification",
len);
- GAUGER ("UTIL",
- sbuf,
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "ops/ms");
GNUNET_CRYPTO_rsa_signature_free (sig);
GNUNET_CRYPTO_rsa_public_key_free (public_key);
GNUNET_CRYPTO_rsa_private_key_free (private_key);
@@ -203,7 +177,7 @@ main (int argc, char *argv[])
eval (1024);
eval (2048);
eval (3072);
- eval (4096);
+ eval (4096);
return 0;
}
diff --git a/src/lib/util/perf_crypto_symmetric.c
b/src/lib/util/perf_crypto_symmetric.c
index 9be452015..7be163a84 100644
--- a/src/lib/util/perf_crypto_symmetric.c
+++ b/src/lib/util/perf_crypto_symmetric.c
@@ -26,7 +26,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#include <gauger.h>
static void
@@ -67,10 +66,6 @@ main (int argc, char *argv[])
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
GNUNET_YES));
- GAUGER ("UTIL", "Symmetric encryption",
- 64 * 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "kb/ms");
return 0;
}
diff --git a/src/lib/util/perf_malloc.c b/src/lib/util/perf_malloc.c
index 48a4a2ae7..d6d67200f 100644
--- a/src/lib/util/perf_malloc.c
+++ b/src/lib/util/perf_malloc.c
@@ -26,7 +26,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#include <gauger.h>
static uint64_t
perf_malloc ()
@@ -77,20 +76,16 @@ main (int argc, char *argv[])
start = GNUNET_TIME_absolute_get ();
kb = perf_malloc ();
- printf ("Malloc perf took %s\n",
+ printf ("Malloc perf took %s (%"PRIu64"kb)\n",
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
- GNUNET_YES));
- GAUGER ("UTIL", "Allocation",
- kb / 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "kb/ms");
+ GNUNET_YES), kb);
start = GNUNET_TIME_absolute_get ();
kb = perf_realloc ();
- printf ("Realloc perf took %s\n",
+ printf ("Realloc perf took %s (%"PRIu64"kb)\n",
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
- GNUNET_YES));
+ GNUNET_YES), kb);
return 0;
}
diff --git a/src/lib/util/perf_mq.c b/src/lib/util/perf_mq.c
index 5c956e4e9..32ecf8ccc 100644
--- a/src/lib/util/perf_mq.c
+++ b/src/lib/util/perf_mq.c
@@ -27,7 +27,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#include <gauger.h>
#define NUM_TRANSMISSIONS 1000000
@@ -293,9 +292,5 @@ main (int argc, char **argv)
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
GNUNET_YES));
- GAUGER ("UTIL", "Scheduler",
- received_cnt / 1024 / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "kmsg/ms");
return global_ret;
}
diff --git a/src/lib/util/perf_scheduler.c b/src/lib/util/perf_scheduler.c
index af084e04a..ad088b03b 100644
--- a/src/lib/util/perf_scheduler.c
+++ b/src/lib/util/perf_scheduler.c
@@ -25,7 +25,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
-#include <gauger.h>
#define RUNS (1024 * 1024)
@@ -85,6 +84,7 @@ int
main (int argc, char *argv[])
{
struct GNUNET_TIME_Absolute start;
+ struct GNUNET_TIME_Relative duration;
uint64_t tasks;
start = GNUNET_TIME_absolute_get ();
@@ -93,10 +93,10 @@ main (int argc, char *argv[])
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
GNUNET_YES));
- GAUGER ("UTIL", "Scheduler",
- tasks / 1024 / (1
+ duration.rel_value_us = tasks / 1024 / (1
+ GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000LL), "tasks/ms");
+ (start).rel_value_us);
+ printf ("%s tasks/us\n", GNUNET_STRINGS_relative_time_to_string(duration,
0));
return 0;
}
diff --git a/src/lib/util/service.c b/src/lib/util/service.c
index 3f050e2bd..ba678f2af 100644
--- a/src/lib/util/service.c
+++ b/src/lib/util/service.c
@@ -33,7 +33,6 @@
#if HAVE_MALLINFO2
#include <malloc.h>
-#include "gauger.h"
#endif
@@ -2150,31 +2149,6 @@ shutdown:
LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "write");
GNUNET_break (0 == close (sh.ready_confirm_fd));
}
-#if HAVE_MALLINFO2
- {
- char *counter;
-
- if ( (GNUNET_YES ==
- GNUNET_CONFIGURATION_have_value (sh.cfg,
- service_name,
- "GAUGER_HEAP")) &&
- (GNUNET_OK ==
- GNUNET_CONFIGURATION_get_value_string (sh.cfg,
- service_name,
- "GAUGER_HEAP",
- &counter)))
- {
- struct mallinfo2 mi;
-
- mi = mallinfo2 ();
- GAUGER (service_name,
- counter,
- mi.usmblks,
- "blocks");
- GNUNET_free (counter);
- }
- }
-#endif
teardown_service (&sh);
GNUNET_free (sh.handlers);
GNUNET_SPEEDUP_stop_ ();
diff --git a/src/service/fs/test_fs_download.c
b/src/service/fs/test_fs_download.c
index fc6b32c0f..5874a9e14 100644
--- a/src/service/fs/test_fs_download.c
+++ b/src/service/fs/test_fs_download.c
@@ -28,7 +28,6 @@
#include "gnunet_util_lib.h"
#include "gnunet_fs_service.h"
#include "gnunet_testing_lib.h"
-#include <gauger.h>
/**
* File-size we use for testing.
@@ -150,14 +149,6 @@ progress_cb (void *cls, const struct
GNUNET_FS_ProgressInfo *event)
/ (1
+ GNUNET_TIME_absolute_get_duration
(start).rel_value_us) / 1024LL));
- GAUGER ("FS",
- (GNUNET_YES == indexed)
- ? "Publishing speed (indexing)"
- : "Publishing speed (insertion)",
- (unsigned long long) (FILESIZE * 1000000LL
- / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us) / 1024LL),
"kb/s");
fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst");
start = GNUNET_TIME_absolute_get ();
download =
@@ -177,14 +168,6 @@ progress_cb (void *cls, const struct
GNUNET_FS_ProgressInfo *event)
/ (1
+ GNUNET_TIME_absolute_get_duration
(start).rel_value_us) / 1024LL));
- GAUGER ("FS",
- (GNUNET_YES == indexed)
- ? "Local download speed (indexed)"
- : "Local download speed (inserted)",
- (unsigned long long) (FILESIZE * 1000000LL
- / (1
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us) / 1024LL),
"kb/s");
GNUNET_SCHEDULER_add_now (&abort_download_task, NULL);
break;
diff --git a/src/service/nse/perf_kdf.c b/src/service/nse/perf_kdf.c
index 10207675f..c9739d987 100644
--- a/src/service/nse/perf_kdf.c
+++ b/src/service/nse/perf_kdf.c
@@ -26,8 +26,6 @@
#include "platform.h"
#include "gnunet_util_lib.h"
#include <gcrypt.h>
-#include <gauger.h>
-
static void
perfHash ()
@@ -56,10 +54,6 @@ main (int argc, char *argv[])
GNUNET_STRINGS_relative_time_to_string (
GNUNET_TIME_absolute_get_duration (start),
GNUNET_YES));
- GAUGER ("NSE", "Proof-of-work hashing",
- 1024.0 / (1.0
- + GNUNET_TIME_absolute_get_duration
- (start).rel_value_us / 1000.0), "hashes/ms");
return 0;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.