net: rpl: Fix the statistics collection

The Kconfig.rpl file was missing option to actually collect
RPL statistics. Unified the config option name to be
CONFIG_NET_STATISTICS_RPL as there was two conflicting settings
in the code and both of them were missing from Kconfig file.

Change-Id: I4ce4fcbaa317b36cac315ea3b3f710fa7a344b25
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2017-04-10 17:55:48 +03:00
commit 31d3406efa
6 changed files with 17 additions and 10 deletions

View file

@ -240,6 +240,13 @@ config NET_RPL_DIS_INTERVAL
This value decides how often DIS messages are sent. The
value is in seconds.
config NET_STATISTICS_RPL
bool "Collect RPL statistics"
depends on NET_STATISTICS
default n
help
Keep track of RPL related statistics
config NET_DEBUG_RPL
bool "Debug RPL"
default n

View file

@ -371,7 +371,7 @@ static inline void net_shell_print_statistics(void)
GET_STAT(udp.chkerr));
#endif
#if defined(CONFIG_NET_RPL_STATS)
#if defined(CONFIG_NET_STATISTICS_RPL)
printk("RPL DIS recv %d\tsent\t%d\tdrop\t%d\n",
GET_STAT(rpl.dis.recv),
GET_STAT(rpl.dis.sent),

View file

@ -80,7 +80,7 @@ void net_print_statistics(void)
GET_STAT(udp.chkerr));
#endif
#if defined(CONFIG_NET_STATISTICS_RPL_STATS)
#if defined(CONFIG_NET_STATISTICS_RPL)
NET_INFO("RPL DIS recv %d\tsent\t%d\tdrop\t%d",
GET_STAT(rpl.dis.recv),
GET_STAT(rpl.dis.sent),
@ -112,7 +112,7 @@ void net_print_statistics(void)
GET_STAT(rpl.loop_warnings));
NET_INFO("RPL r-repairs %d",
GET_STAT(rpl.root_repairs));
#endif
#endif /* CONFIG_NET_STATISTICS_RPL */
NET_INFO("Bytes received %u", GET_STAT(bytes.received));
NET_INFO("Bytes sent %u", GET_STAT(bytes.sent));

View file

@ -604,7 +604,7 @@ static void dio_timer(struct k_work *work)
net_rpl_dio_send(iface, instance, addr, NULL);
#if defined(CONFIG_NET_RPL_STATS)
#if defined(CONFIG_NET_STATISTICS_RPL)
instance->dio_send_pkt++;
#endif
} else {
@ -651,7 +651,7 @@ static void new_dio_interval(struct net_rpl_instance *instance)
*/
instance->dio_next_delay -= time;
#if defined(CONFIG_NET_RPL_STATS)
#if defined(CONFIG_NET_STATISTICS_RPL)
instance->dio_intervals++;
instance->dio_recv_pkt += instance->dio_counter;
@ -667,7 +667,7 @@ static void new_dio_interval(struct net_rpl_instance *instance)
instance->dio_interval_current,
instance->current_dag->rank == NET_RPL_ROOT_RANK(instance) ?
"ROOT" : "");
#endif /* CONFIG_NET_RPL_STATS */
#endif /* CONFIG_NET_STATISTICS_RPL */
instance->dio_counter = 0;
instance->dio_send = true;
@ -4123,7 +4123,7 @@ void net_rpl_init(void)
CONFIG_NET_IPV6_MAX_NEIGHBORS,
sizeof(net_rpl_neighbor_pool));
#if defined(CONFIG_NET_RPL_STATS)
#if defined(CONFIG_NET_STATISTICS_RPL)
memset(&net_stats.rpl, 0, sizeof(net_stats.rpl));
#endif

View file

@ -463,7 +463,7 @@ struct net_rpl_instance {
*/
uint16_t lifetime_unit;
#if defined(CONFIG_NET_RPL_STATS)
#if defined(CONFIG_NET_STATISTICS_RPL)
/** Number of DIO intervals for this RPL instance. */
uint16_t dio_intervals;
@ -472,7 +472,7 @@ struct net_rpl_instance {
/** Number of DIOs received for this RPL instance. */
uint16_t dio_recv_pkt;
#endif /* CONFIG_NET_RPL_STATS */
#endif /* CONFIG_NET_STATISTICS_RPL */
/**
* This is the lifetime that is used as default for all RPL routes.

View file

@ -21,7 +21,7 @@ CONFIG_NET_RPL=y
CONFIG_NET_RPL_MAX_DAG_PER_INSTANCE=2
CONFIG_NET_RPL_MAX_INSTANCES=3
CONFIG_NET_RPL_PROBING=y
CONFIG_NET_RPL_STATS=y
CONFIG_NET_STATISTICS_RPL=y
CONFIG_SYS_LOG_NET_LEVEL=4
#CONFIG_NET_DEBUG_CONTEXT=y
#CONFIG_NET_DEBUG_CORE=y