From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by dpdk.org (Postfix) with ESMTP id 0C92456A3 for ; Wed, 24 Oct 2018 22:27:48 +0200 (CEST) Received: by mail-qk1-f193.google.com with SMTP id a193-v6so4271189qkc.13 for ; Wed, 24 Oct 2018 13:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1W+gCUuhLSwf9fXApqIyFdqnIzxHZWjNFsIVtIx0sc8=; b=TsR6jFau71k4wMBclQOh8AjcJMww+KZH9COD2zwHD+2ETlTC/2OkMZUW8ypOj10sXu L0AolcRnDgjZZSTg+knBwwceq11oVb4lCkCpLEu0ZT5jhdl80FUgvKoqxf9+9v0Bokt/ XAHM13SWSBuC+2HdRvriaoj/cM4GQcfxQW7QowjQSA9vaxMuZrvzUx7k3VjJPcnodUQi rxhehGHXK1WP/q2NyXTf5lC6bhqjRJnMEehnTwLcaFmRpHtCGswKOwXjtVkNMhi6GzzT PE5LY9Xm88I5ft2g6YQktpmKKJAR6NsjdVmBlenms7/vFZND8wA4BaRpChtnTf0rpHK/ f7YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=1W+gCUuhLSwf9fXApqIyFdqnIzxHZWjNFsIVtIx0sc8=; b=Ag6QwGikRjqWBvsp5dNQck7Ks6i78lfIrZ+1u2HJ42dfrO/4NAEkFXBwbIby6zdAXD 0DVxr2wrQoWe5bFUTtiGHzHSELlKhKAszzh8tQ+FnNLKP364XLPp+N5/H9IHfI6aqlu5 aC3M5uLQInwRTtdbSIrWdT29KAi/k7rjB/jeTl2dyd9Tx6XqoyL1khqgo7SDbjTu1+oI RUqlDp7Xu3M7pseA2v8M1iEx6ywsemEv4De0+4uZeNGKCRQS9sIGqMuf0nxuyifJODL0 hmnWmH8ybIqRrXJPxe3HeUQPEtQI8aUON+hE7i2iFUY7Tlmmptprz6CUJc+EO+RVCABc vBiQ== X-Gm-Message-State: AGRZ1gLWHSIMXccXfXcP/jmz9GbLTL+/sHyJMCdm0kd79ENuWYtPecyO pEnZrx0PosbL8jSe5/ROY+16WoGo X-Google-Smtp-Source: AJdET5c5AV9lnMqc2Jx9y1KpddCx/pR+k47wlLcGU7+IgdSpU44ooDJroR3+mwHW/u5NRBY1yRKuvg== X-Received: by 2002:a37:4787:: with SMTP id u129-v6mr3946791qka.301.1540412867053; Wed, 24 Oct 2018 13:27:47 -0700 (PDT) Received: from snappy.local.lan ([179.228.213.114]) by smtp.gmail.com with ESMTPSA id p64-v6sm3509117qkc.96.2018.10.24.13.27.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Oct 2018 13:27:45 -0700 (PDT) Sender: Dan Gora From: Dan Gora To: dev@dpdk.org Cc: Igor Ryzhov , Stephen Hemminger , Ferruh Yigit , Dan Gora Date: Wed, 24 Oct 2018 17:27:18 -0300 Message-Id: <20181024202719.24902-5-dg@adax.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181024202719.24902-1-dg@adax.com> References: <20180911232906.18352-1-dg@adax.com> <20181024202719.24902-1-dg@adax.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 4/5] examples/kni: add log msgs to show and clear stats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 20:27:48 -0000 Add logging messages showing the commands necessary for the user to have the application display and zero the statistics. Signed-off-by: Dan Gora --- examples/kni/main.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/kni/main.c b/examples/kni/main.c index 4fda51713..0e3b2a2f7 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -171,14 +171,13 @@ signal_handler(int signum) /* When we receive a USR2 signal, reset stats */ if (signum == SIGUSR2) { memset(&kni_stats, 0, sizeof(kni_stats)); - printf("\n**Statistics have been reset**\n"); + printf("\n** Statistics have been reset **\n"); return; } /* When we receive a RTMIN or SIGINT signal, stop kni processing */ if (signum == SIGRTMIN || signum == SIGINT){ - printf("SIGRTMIN is received, and the KNI processing is " - "going to stop\n"); + printf("\nSIGRTMIN/SIGINT received. KNI processing stopping.\n"); rte_atomic32_inc(&kni_stop); return; } @@ -950,6 +949,7 @@ main(int argc, char** argv) unsigned i; void *retval; pthread_t kni_link_tid; + int pid; /* Associate signal_hanlder function with USR signals */ signal(SIGUSR1, signal_handler); @@ -1006,6 +1006,16 @@ main(int argc, char** argv) } check_all_ports_link_status(ports_mask); + pid = getpid(); + RTE_LOG(INFO, APP, "========================\n"); + RTE_LOG(INFO, APP, "KNI Running\n"); + RTE_LOG(INFO, APP, "kill -SIGUSR1 %d\n", pid); + RTE_LOG(INFO, APP, " Show KNI Statistics.\n"); + RTE_LOG(INFO, APP, "kill -SIGUSR2 %d\n", pid); + RTE_LOG(INFO, APP, " Zero KNI Statistics.\n"); + RTE_LOG(INFO, APP, "========================\n"); + fflush(stdout); + ret = rte_ctrl_thread_create(&kni_link_tid, "KNI link status check", NULL, monitor_all_ports_link_status, NULL); -- 2.19.0