From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by dpdk.org (Postfix) with ESMTP id E28281B277 for ; Thu, 27 Sep 2018 02:34:15 +0200 (CEST) Received: by mail-qt1-f194.google.com with SMTP id c25-v6so959080qtp.6 for ; Wed, 26 Sep 2018 17:34:15 -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=W69kTPPQZsG3Xfc6I/641TiWiA+zDnC2Z/KCUco6T/E=; b=bJ17VFUeURhw3R3L2uEkJQ2YBJGSeQh/9/vpXHYURy522YPXHrnA9dIuHi2PcLKf1K izSSyUSThJ5Yh73O58243mp4yjjgYUnrVq9+QaL5zcD3KMT2w/+K4nP6wzDHu7PKo/vr 6JPxacbNx4jkxpTqYHcT10f/XQ/w/y442+O+ivX3O4K065xYFSbc2rdkUj9FUXQKR4nM +phYjwpe61WQJU1YHW9zdBuxPPQ3VY0U5YE1MAxjCMSfmgd2AoqPmOafhz6HQJolkpWJ DLLjou3i1YUm2YAtAPAamVp5u9J4EtPutAhOkjvpy/jXBEZ671qzd7M0T48ApUPARHPo /moA== 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=W69kTPPQZsG3Xfc6I/641TiWiA+zDnC2Z/KCUco6T/E=; b=if7MuTT2Uu0rJqHepIWz9ynCOrb3akyFAc9WvN4wX4GsS8NcsFmcSg4uZqIX4TcYnp 9I8zjt6TqvE+SLMOiOIWg7CNAbRnolHYn84S6BpKDsxsC14jWO+t9cvBlxgpXpmmJBKe QMgDuAugnlrkprM8gUArKxgpSGAesTAIBtvWOcIlQ5oEYK/p+WzUNugJJqYvRnRXIwmq jkqwOqizUfNSrF53FwOTZZwcG+SbXzpycSVMyQ33Frb6752WvAyuoAD/S0ieT24xpykd ZFSA/wjVoWyg11iFNwUOrQwtpuZYs0Lwb8sR24CU6WmvymriJ3jMlhRCir3W6nAUzQr/ rByg== X-Gm-Message-State: ABuFfojSn4WMH19OA+SRCyWQqdRx9PVadbIWXQ4HlT8478pPwZe31JUN dNN6nvYVDvhGoL4bb0bFbZMyW/3q X-Google-Smtp-Source: ACcGV627LDqVtBZbLTNvmkBSYnMdPw0Q+j4qgibFE5Hlh/OkPZsb5eOE163vUP95ETbidcHuRH/8aQ== X-Received: by 2002:a0c:bf49:: with SMTP id b9-v6mr6253808qvj.65.1538008454969; Wed, 26 Sep 2018 17:34:14 -0700 (PDT) Received: from snappy.local.lan (189-46-124-178.dsl.telesp.net.br. [189.46.124.178]) by smtp.gmail.com with ESMTPSA id x26-v6sm463053qth.15.2018.09.26.17.34.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Sep 2018 17:34:14 -0700 (PDT) Sender: Dan Gora From: Dan Gora To: dev@dpdk.org Cc: Igor Ryzhov , Stephen Hemminger , Ferruh Yigit , Dan Gora Date: Wed, 26 Sep 2018 21:32:55 -0300 Message-Id: <20180927003256.6901-6-dg@adax.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927003256.6901-1-dg@adax.com> References: <20180911232906.18352-1-dg@adax.com> <20180927003256.6901-1-dg@adax.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 5/6] 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: Thu, 27 Sep 2018 00:34:16 -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 be721b9cc..357cfd6fc 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; } @@ -869,6 +868,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); @@ -924,6 +924,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