From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by dpdk.org (Postfix) with ESMTP id 045881B13A for ; Wed, 19 Sep 2018 21:56:28 +0200 (CEST) Received: by mail-qk1-f180.google.com with SMTP id p84-v6so3488460qke.1 for ; Wed, 19 Sep 2018 12:56:28 -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=o4LEoCMqpS+UIuv/HnSs3xUK1rsvdh8y7P5SRBN1XTs=; b=oKUF3QjsJslNXXlT4UeR2+lVA7AsF95x+B2EtnCC2kaTcq59OiN5PUgB/KCBP12Jbk 71K6a74IGPUWICFsr/yxQcQhk2IfnnAJ4etwtdxsfQeGfymP8W4Vs101kMoKEvhLNKJP i91sG6As/PAXYJ7y7JiL17JWPLOYWlTMySgVBUVLHCP0Eb+Lx79sIKv/yh1wiNfOvn1t XOiMR3MwbmhHM9CseLsGzMn5EQEyCpDSEFI5N9WFwmGqViw5+VkEycTYPjcudzkDHs3c Sy0f0loy3YoOH1G9DhC+GtV77PkX45u1E9nhR3SjFGtp+1qNk7lewVdkTKR/t4Kc9vTM qotw== 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=o4LEoCMqpS+UIuv/HnSs3xUK1rsvdh8y7P5SRBN1XTs=; b=Z4hsZTFJ8xMYVMYaLZoYw/+VadRaeBKfM2OJFBQqgKyfAV4RsyIIMbdK0pqtNvgHV5 VSLNZO+c4uUbTEkoQl3FwdNLKHJkX549X5DSRAf5KEc+8k6L86kJb3MIAnm/1tVqvnJy 073QjLxU75Zm1NocioxsI0QhnL5ZAr0CUKQSfFU/9Y7hZ6JjdQIHqOiTbV3DijgXFdYM zcrSGQ66G7ulhlGkcYetLhm+NOttKxejQDYMci3bhT3Q4XBjg25Z93Dp/wtQCRCgoq/U pUXYi1Rb/iBhPM1N3cQjFqwfG01EHPUbtIiadZ/6RyTzFtCDI03M27MmAvEUEqWIYvas mZuA== X-Gm-Message-State: APzg51B33EcBVCKsRstC/uH5x7CJ2YyMulFd7+p6wCud4F0O+HwKSkdR YjuUzcuU4gIEsDpt2fdLxP0VBDQR X-Google-Smtp-Source: ANB0VdaNyHCim4prfmt/ovmOwTAUzZzSmnI24E7zJh7PZhsccd3MZVT5bef70zTfoPgifLT957TZ/w== X-Received: by 2002:a37:72c4:: with SMTP id n187-v6mr18309242qkc.103.1537386987872; Wed, 19 Sep 2018 12:56:27 -0700 (PDT) Received: from snappy.local.lan ([187.10.145.241]) by smtp.gmail.com with ESMTPSA id g184-v6sm12431369qkb.15.2018.09.19.12.56.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Sep 2018 12:56:27 -0700 (PDT) Sender: Dan Gora From: Dan Gora To: dev@dpdk.org Cc: Igor Ryzhov , Stephen Hemminger , Dan Gora , Ferruh Yigit Date: Wed, 19 Sep 2018 16:55:48 -0300 Message-Id: <20180919195549.5585-5-dg@adax.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180919195549.5585-1-dg@adax.com> References: <20180911232906.18352-1-dg@adax.com> <20180919195549.5585-1-dg@adax.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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, 19 Sep 2018 19:56:29 -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 8c3d3839e..ca45347d8 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; } @@ -884,6 +883,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); @@ -939,6 +939,16 @@ main(int argc, char** argv) kni_alloc(port); } + 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); + kni_running = 1; ret = rte_ctrl_thread_create(&kni_link_tid, "KNI link status check", NULL, -- 2.19.0