DPDK patches and discussions
 help / color / mirror / Atom feed
From: Harry van Haaren <harry.van.haaren@intel.com>
To: remy.horton@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v4 2/3] eal: add keepalive core register timestamp
Date: Tue,  8 Mar 2016 10:50:39 +0000	[thread overview]
Message-ID: <1457434240-13707-3-git-send-email-harry.van.haaren@intel.com> (raw)
In-Reply-To: <1457434240-13707-1-git-send-email-harry.van.haaren@intel.com>

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>
---
 lib/librte_eal/common/rte_keepalive.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/rte_keepalive.c b/lib/librte_eal/common/rte_keepalive.c
index bd1f16b..56df0b1 100644
--- a/lib/librte_eal/common/rte_keepalive.c
+++ b/lib/librte_eal/common/rte_keepalive.c
@@ -1,7 +1,7 @@
 /*-
  *   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
@@ -38,6 +38,7 @@
 #include <rte_log.h>
 #include <rte_keepalive.h>
 #include <rte_malloc.h>
+#include <rte_cycles.h>
 
 struct rte_keepalive {
 	/** Core Liveness. */
@@ -139,8 +140,10 @@ rte_keepalive_create(rte_keepalive_failure_callback_t callback,
 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();
+	}
 }
 
 
-- 
2.5.0

  parent reply	other threads:[~2016-03-08 10:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20 15:53 [dpdk-dev] [PATCH 0/3] Keep-alive stats and doc fixes Harry van Haaren
2016-01-20 15:53 ` [dpdk-dev] [PATCH 1/3] doc: fix keepalive sample app guide Harry van Haaren
2016-01-20 15:53 ` [dpdk-dev] [PATCH 2/3] eal: add keepalive core register timestamp Harry van Haaren
2016-01-20 15:53 ` [dpdk-dev] [PATCH 3/3] keepalive: add rte_keepalive_xstats() and example Harry van Haaren
2016-01-21  9:57   ` Remy Horton
2016-01-21 11:05 ` [dpdk-dev] [PATCH v2 0/3] Keep-alive stats and doc fixes Harry van Haaren
2016-01-21 11:05   ` [dpdk-dev] [PATCH v2 1/3] doc: fix keepalive sample app guide Harry van Haaren
2016-02-19 17:28     ` Mcnamara, John
2016-01-21 11:05   ` [dpdk-dev] [PATCH v2 2/3] eal: add keepalive core register timestamp Harry van Haaren
2016-01-21 11:05   ` [dpdk-dev] [PATCH v2 3/3] keepalive: add rte_keepalive_xstats_get() and example Harry van Haaren
2016-01-21 12:12   ` [dpdk-dev] [PATCH v2 0/3] Keep-alive stats and doc fixes Remy Horton
2016-02-22 11:25   ` [dpdk-dev] [PATCH v3 0/3] Keepalive stats function " Harry van Haaren
2016-02-22 11:26     ` [dpdk-dev] [PATCH v3 1/3] doc: fix keepalive sample app guide Harry van Haaren
2016-02-22 16:54       ` Mcnamara, John
2016-02-22 11:26     ` [dpdk-dev] [PATCH v3 2/3] eal: add keepalive core register timestamp Harry van Haaren
2016-02-22 11:26     ` [dpdk-dev] [PATCH v3 3/3] keepalive: add rte_keepalive_xstats_get() Harry van Haaren
2016-02-29  9:19       ` Thomas Monjalon
2016-02-22 13:12     ` [dpdk-dev] [PATCH v3 0/3] Keepalive stats function and doc fixes Remy Horton
2016-03-08 10:50     ` [dpdk-dev] [PATCH v4 0/3] Keepalive register timestamp and doc update Harry van Haaren
2016-03-08 10:50       ` [dpdk-dev] [PATCH v4 1/3] doc: fix keepalive sample app guide Harry van Haaren
2016-03-08 10:50       ` Harry van Haaren [this message]
2016-03-08 10:50       ` [dpdk-dev] [PATCH v4 3/3] keepalive: fix whitespace, removes double newlines Harry van Haaren
2016-03-08 10:58       ` [dpdk-dev] [PATCH v4 0/3] Keepalive register timestamp and doc update Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457434240-13707-3-git-send-email-harry.van.haaren@intel.com \
    --to=harry.van.haaren@intel.com \
    --cc=dev@dpdk.org \
    --cc=remy.horton@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).