aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/devices/ahci.cpp4
-rw-r--r--src/devices/alsa.cpp4
-rw-r--r--src/devices/network.cpp16
-rw-r--r--src/main.cpp2
4 files changed, 6 insertions, 20 deletions
diff --git a/src/devices/ahci.cpp b/src/devices/ahci.cpp
index e5b6750..e65cff9 100644
--- a/src/devices/ahci.cpp
+++ b/src/devices/ahci.cpp
@@ -192,7 +192,7 @@ void ahci::start_measurement(void)
#ifndef DISABLE_TRYCATCH
}
catch (std::ios_base::failure &c) {
- fprintf(stderr, "%s\n", c.what());
+ fprintf(stderr, "Failed to start measurement for ahci device\n");
}
#endif
}
@@ -235,7 +235,7 @@ void ahci::end_measurement(void)
#ifndef DISABLE_TRYCATCH
}
catch (std::ios_base::failure &c) {
- fprintf(stderr, "%s\n", c.what());
+ fprintf(stderr, "Failed to end measurement for ahci device\n");
}
#endif
if (end_active < start_active)
diff --git a/src/devices/alsa.cpp b/src/devices/alsa.cpp
index 3488e86..28a172f 100644
--- a/src/devices/alsa.cpp
+++ b/src/devices/alsa.cpp
@@ -105,7 +105,7 @@ void alsa::start_measurement(void)
#ifndef DISABLE_TRYCATCH
}
catch (std::ios_base::failure &c) {
- fprintf(stderr, "%s\n", c.what());
+ fprintf(stderr, "Failed to start measurement for alsa device\n");
}
#endif
}
@@ -135,7 +135,7 @@ void alsa::end_measurement(void)
#ifndef DISABLE_TRYCATCH
}
catch (std::ios_base::failure &c) {
- fprintf(stderr, "%s\n", c.what());
+ fprintf(stderr, "Failed to end measurement for alsa device\n");
}
#endif
p = (end_active - start_active) / (0.001 + end_active + end_inactive - start_active - start_inactive) * 100.0;
diff --git a/src/devices/network.cpp b/src/devices/network.cpp
index f8f4212..ffc0b28 100644
--- a/src/devices/network.cpp
+++ b/src/devices/network.cpp
@@ -55,22 +55,6 @@ extern "C" {
static map<string, class network *> nics;
-#ifdef DISABLE_TRYCATCH
-
-static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
- __u32 speed)
-{
-
- ep->speed = (__u16)speed;
- ep->speed_hi = (__u16)(speed >> 16);
-}
-
-static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
-{
- return (ep->speed_hi << 16) | ep->speed;
-}
-
-#endif
static void do_proc_net_dev(void)
{
diff --git a/src/main.cpp b/src/main.cpp
index 9334b2b..e692218 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -45,7 +45,9 @@
#include "perf/perf.h"
#include "perf/perf_bundle.h"
#include "lib.h"
+#ifdef HAVE_CONFIG_H
#include "../config.h"
+#endif
#include "devices/device.h"