aboutsummaryrefslogtreecommitdiff
path: root/src/testbed
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-10 16:59:32 +0000
committerng0 <ng0@n0.is>2019-09-10 16:59:32 +0000
commit04b6df21cd281e8cd540139f8d9ae85defc1961c (patch)
tree6357199445df8d5c0c631bc8f10aef838b1f9f1e /src/testbed
parent483b0139a218a5f8a8311bda3eb23bcd88f57688 (diff)
downloadgnunet-04b6df21cd281e8cd540139f8d9ae85defc1961c.tar.gz
gnunet-04b6df21cd281e8cd540139f8d9ae85defc1961c.zip
remove CYGWIN codeblocks, drop vendored Windows openvpn, drop win32 specific files.
configures and builds okay. testsuite wasn't checked, will be checked. diff including the plibc removal is now around 14370 lines of code less.
Diffstat (limited to 'src/testbed')
-rw-r--r--src/testbed/Makefile.am4
-rw-r--r--src/testbed/gnunet-service-testbed_cpustatus.c117
-rw-r--r--src/testbed/test_testbed_api_testbed_run.c13
3 files changed, 1 insertions, 133 deletions
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am
index e858e44b4..c27a81ae9 100644
--- a/src/testbed/Makefile.am
+++ b/src/testbed/Makefile.am
@@ -1,10 +1,6 @@
1# This Makefile.am is in the public domain 1# This Makefile.am is in the public domain
2AM_CPPFLAGS = -I$(top_srcdir)/src/include 2AM_CPPFLAGS = -I$(top_srcdir)/src/include
3 3
4if MINGW
5 WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols
6endif
7
8if USE_COVERAGE 4if USE_COVERAGE
9 AM_CFLAGS = --coverage -O0 5 AM_CFLAGS = --coverage -O0
10 XLIB = -lgcov 6 XLIB = -lgcov
diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c
index b659b5dc3..f3df9a96e 100644
--- a/src/testbed/gnunet-service-testbed_cpustatus.c
+++ b/src/testbed/gnunet-service-testbed_cpustatus.c
@@ -398,114 +398,6 @@ ABORT_KSTAT:
398 } 398 }
399#endif 399#endif
400 400
401#if MINGW
402 /* Win NT? */
403 if (GNNtQuerySystemInformation)
404 {
405 static double dLastKernel;
406 static double dLastIdle;
407 static double dLastUser;
408 double dKernel;
409 double dIdle;
410 double dUser;
411 double dDiffKernel;
412 double dDiffIdle;
413 double dDiffUser;
414 SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION theInfo;
415
416 if (GNNtQuerySystemInformation(SystemProcessorPerformanceInformation,
417 &theInfo,
418 sizeof(theInfo), NULL) == NO_ERROR)
419 {
420 /* PORT-ME MINGW: Multi-processor? */
421 dKernel = Li2Double(theInfo.KernelTime);
422 dIdle = Li2Double(theInfo.IdleTime);
423 dUser = Li2Double(theInfo.UserTime);
424 dDiffKernel = dKernel - dLastKernel;
425 dDiffIdle = dIdle - dLastIdle;
426 dDiffUser = dUser - dLastUser;
427
428 if (((dDiffKernel + dDiffUser) > 0) &&
429 (dLastIdle + dLastKernel + dLastUser > 0))
430 currentCPULoad =
431 100.0 - (dDiffIdle / (dDiffKernel + dDiffUser)) * 100.0;
432 else
433 currentCPULoad = -1; /* don't know (yet) */
434
435 dLastKernel = dKernel;
436 dLastIdle = dIdle;
437 dLastUser = dUser;
438
439 currentIOLoad = -1; /* FIXME-MINGW */
440 return GNUNET_OK;
441 }
442 else
443 {
444 /* only warn once, if there is a problem with
445 NtQuery..., we're going to hit it frequently... */
446 static int once;
447 if (once == 0)
448 {
449 once = 1;
450 GNUNET_log(GNUNET_ERROR_TYPE_WARNING,
451 "Cannot query the CPU usage (Windows NT).\n");
452 }
453 return GNUNET_SYSERR;
454 }
455 }
456 else
457 { /* Win 9x */
458 HKEY hKey;
459 DWORD dwDataSize, dwType, dwDummy;
460
461 /* Start query */
462 if (RegOpenKeyEx(HKEY_DYN_DATA,
463 "PerfStats\\StartSrv",
464 0, KEY_ALL_ACCESS, &hKey) != ERROR_SUCCESS)
465 {
466 /* only warn once */
467 static int once = 0;
468 if (once == 0)
469 {
470 once = 1;
471 GNUNET_log(GNUNET_ERROR_TYPE_WARNING,
472 "Cannot query the CPU usage (Win 9x)\n");
473 }
474 }
475
476 RegOpenKeyEx(HKEY_DYN_DATA,
477 "PerfStats\\StartStat", 0, KEY_ALL_ACCESS, &hKey);
478 dwDataSize = sizeof(dwDummy);
479 RegQueryValueEx(hKey,
480 "KERNEL\\CPUUsage",
481 NULL, &dwType, (LPBYTE)&dwDummy, &dwDataSize);
482 RegCloseKey(hKey);
483
484 /* Get CPU usage */
485 RegOpenKeyEx(HKEY_DYN_DATA,
486 "PerfStats\\StatData", 0, KEY_ALL_ACCESS, &hKey);
487 dwDataSize = sizeof(currentCPULoad);
488 RegQueryValueEx(hKey,
489 "KERNEL\\CPUUsage",
490 NULL, &dwType, (LPBYTE)&currentCPULoad, &dwDataSize);
491 RegCloseKey(hKey);
492 currentIOLoad = -1; /* FIXME-MINGW! */
493
494 /* Stop query */
495 RegOpenKeyEx(HKEY_DYN_DATA,
496 "PerfStats\\StopStat", 0, KEY_ALL_ACCESS, &hKey);
497 RegOpenKeyEx(HKEY_DYN_DATA,
498 "PerfStats\\StopSrv", 0, KEY_ALL_ACCESS, &hKey);
499 dwDataSize = sizeof(dwDummy);
500 RegQueryValueEx(hKey,
501 "KERNEL\\CPUUsage",
502 NULL, &dwType, (LPBYTE)&dwDummy, &dwDataSize);
503 RegCloseKey(hKey);
504
505 return GNUNET_OK;
506 }
507#endif
508
509 /* loadaverage not defined and no platform 401 /* loadaverage not defined and no platform
510 specific alternative defined 402 specific alternative defined
511 => default: error 403 => default: error
@@ -695,12 +587,6 @@ GST_stats_init(const struct GNUNET_CONFIGURATION_Handle *cfg)
695 char *fn; 587 char *fn;
696 size_t len; 588 size_t len;
697 589
698#if MINGW
699 GNUNET_log(GNUNET_ERROR_TYPE_WARNING,
700 "Load statistics logging now available for windows\n");
701 return; /* No logging on windows for now :( */
702#endif
703
704 if (GNUNET_OK != 590 if (GNUNET_OK !=
705 GNUNET_CONFIGURATION_get_value_filename(cfg, "testbed", 591 GNUNET_CONFIGURATION_get_value_filename(cfg, "testbed",
706 "STATS_DIR", &stats_dir)) 592 "STATS_DIR", &stats_dir))
@@ -747,9 +633,6 @@ GST_stats_init(const struct GNUNET_CONFIGURATION_Handle *cfg)
747void 633void
748GST_stats_destroy() 634GST_stats_destroy()
749{ 635{
750#if MINGW
751 return;
752#endif
753 if (NULL == bw) 636 if (NULL == bw)
754 return; 637 return;
755#ifdef LINUX 638#ifdef LINUX
diff --git a/src/testbed/test_testbed_api_testbed_run.c b/src/testbed/test_testbed_api_testbed_run.c
index 39bc9bfe7..a3bd415dd 100644
--- a/src/testbed/test_testbed_api_testbed_run.c
+++ b/src/testbed/test_testbed_api_testbed_run.c
@@ -215,18 +215,7 @@ main(int argc, char **argv)
215 } 215 }
216 testname++; 216 testname++;
217 testname = GNUNET_strdup(testname); 217 testname = GNUNET_strdup(testname);
218#ifdef MINGW 218
219 {
220 char *period;
221
222 /* check and remove .exe extension */
223 period = strrchr(testname, (int)'.');
224 if (NULL != period)
225 *period = '\0';
226 else
227 GNUNET_break(0); /* Windows with no .exe? */
228 }
229#endif
230 if (0 == strcmp("waitforever", testname)) 219 if (0 == strcmp("waitforever", testname))
231 wait_forever = GNUNET_YES; 220 wait_forever = GNUNET_YES;
232 if ((GNUNET_YES != wait_forever) && (0 != strcmp("run", testname))) 221 if ((GNUNET_YES != wait_forever) && (0 != strcmp("run", testname)))