This patch sets a timestamp on each lcore when it is registered
for keepalive. This causes the first values read by the monitor
to show time since the core was registered, instead of the delta
between 0 and the timestamp counter.
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
/*-
* BSD LICENSE
*
- * Copyright 2015 Intel Shannon Ltd. All rights reserved.
+ * Copyright(c) 2015-2016 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#include <rte_log.h>
#include <rte_keepalive.h>
#include <rte_malloc.h>
+#include <rte_cycles.h>
struct rte_keepalive {
/** Core Liveness. */
void
rte_keepalive_register_core(struct rte_keepalive *keepcfg, const int id_core)
{
- if (id_core < RTE_KEEPALIVE_MAXCORES)
+ if (id_core < RTE_KEEPALIVE_MAXCORES) {
keepcfg->active_cores[id_core] = 1;
+ keepcfg->last_alive[id_core] = rte_rdtsc();
+ }
}