From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by dpdk.org (Postfix) with ESMTP id 1E6EA58EC for ; Wed, 17 Oct 2018 03:04:50 +0200 (CEST) Received: by mail-qk1-f177.google.com with SMTP id 204-v6so15432836qkd.5 for ; Tue, 16 Oct 2018 18:04:50 -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=tO8aIB+Hw72z5n3ko5IxaglmkWXugqm628TkFFBTpDs=; b=Dsa0qBT4RMNS1Pu4OeF2W7qTQol5M686dFIy15DBx+Xg/3UE5QQ+WT3cC6AnqTWtab 4YiWi2uBzCu4UJfr9eGQzDa9zxxNF2/FjaD27MxbILlmkGITtPRt12hUlfyIxelVXDjs EbcfbJSvIqpdGYF6gJc9CUqvH2mNRhbGzTiqDTB5aBN5VKS2atDgu5xhMY5oGy3CQta/ lmyfl9qn3QooV+JcVFbPjljsYzoW3iZyzl2MWLwTVzlOv20p8UBxCXddKz1I2fEhYCPH HKWbwq1kcv7gzlZ9N5Ct0ku/MJKKglsig5I5QVhQvt/TpjhPSTEtSkzz+B5DAdlP2fl6 1/Dw== 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=tO8aIB+Hw72z5n3ko5IxaglmkWXugqm628TkFFBTpDs=; b=mfyBSInFWjWUsQeYxneSR3U0paLKMr1Dw2zq8n8+3O6zZyQSnt/VkyKvGMi2CTDxCm oyyi7ZyxMh2eo6joklefTASDp9xIaOXUiPRyjBdSqFOr/TaAD9z3powGa4/VwxADvrnb SKp5RquxkgIzZa3B8mGhN+y1Ke42EepEZnwfR7SM+8oG2JBgJtpdgbzIgUtvGRVJS46U PDASYNyykIB8hUGW7PNGTzfumALgRxVs2+jKQlHX/DjaT0L7LfAxZWX+OOaJMMx7wQIn PsVoK85rDXP0GB2Mkpnt9//j9UETM6ngPjRHNY/9TKGActshKBYIJyEsHxKTGoo4lf8b 1UNg== X-Gm-Message-State: ABuFfoiAMRcQdD1crwOt1vBTYkXOkma2rnIf7LVDGMyCW7l5SYTuYaw4 jzECRb6lHbEJ/nuvJWjZ8Zen+BYliPc= X-Google-Smtp-Source: ACcGV60WfrRPVjs57D6g/J9d8Wuqcft5yaNg0FysuqWG4b9faaC4bcvVNHjKpgFr/8nl1S/D3NJBiw== X-Received: by 2002:a37:72c1:: with SMTP id n184-v6mr22854092qkc.133.1539738289173; Tue, 16 Oct 2018 18:04:49 -0700 (PDT) Received: from snappy.local.lan ([187.74.142.5]) by smtp.gmail.com with ESMTPSA id v54-v6sm19547508qtc.81.2018.10.16.18.04.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Oct 2018 18:04:48 -0700 (PDT) Sender: Dan Gora From: Dan Gora To: dev@dpdk.org Cc: Igor Ryzhov , Stephen Hemminger , Ferruh Yigit , Dan Gora Date: Tue, 16 Oct 2018 22:04:12 -0300 Message-Id: <20181017010412.23141-6-dg@adax.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180911232906.18352-1-dg@adax.com> References: <20180911232906.18352-1-dg@adax.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 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: Wed, 17 Oct 2018 01:04:50 -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 634024960..314e19c68 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