aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-21 23:24:02 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-21 23:55:27 +0200
commit714ccb9992307112689d63493fada72cf1a6224b (patch)
tree2237664e8b2fe31fb927d16f7e09e3a611a5501f
parentb0674e9636a5010b1d9a17496afa1f6ffc1fc79b (diff)
sysmobts: Provide information about the state transitions
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c
index 217928a3..7407f74b 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_temp.c
@@ -26,10 +26,19 @@
#include <osmo-bts/logging.h>
#include <osmocom/core/timer.h>
+#include <osmocom/core/utils.h>
static struct sysmobts_mgr_instance *s_mgr;
static struct osmo_timer_list temp_ctrl_timer;
+static const struct value_string state_names[] = {
+ { STATE_NORMAL, "NORMAL" },
+ { STATE_WARNING_HYST, "WARNING (HYST)" },
+ { STATE_WARNING, "WARNING" },
+ { STATE_CRITICAL, "CRITICAL" },
+ { 0, NULL }
+};
+
static int next_state(enum sysmobts_temp_state current_state, int critical, int warning)
{
int next_state = -1;
@@ -93,6 +102,9 @@ static void sysmobts_mgr_temp_handle(struct sysmobts_mgr_instance *manager,
if (new_state < 0)
return;
+ LOGP(DTEMP, LOGL_NOTICE, "Moving from state %s to %s.\n",
+ get_value_string(state_names, manager->state),
+ get_value_string(state_names, new_state));
manager->state = new_state;
switch (manager->state) {
case STATE_NORMAL: