From patchwork Tue Jul 28 11:53:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 51585 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 3D453214B7 for ; Tue, 28 Jul 2015 11:54:00 +0000 (UTC) Received: by laah7 with SMTP id h7sf37232125laa.2 for ; Tue, 28 Jul 2015 04:53:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=fLV1oe5EgEYIMBEbABfXZqRlAtKBQoVqyS9Oxsc8k9c=; b=djlXmjfJzc3eNnSyFI5rlkk+ptZNSmyJjmUACcTRPSQYvzz15Z5PcM/uqNllbr/Qfk eJGvZcAfpi/cx8YGQbXRqiuDwnicSDSDJ8vZX6PT7CNje3nyumuCdOkjBnSF98P75EVj SJVCbcT3Qv67a0gcZ0FPI4sVx3UhssLWRdgg+S51IrspBllt/vfw4PIm0Yorji/OzJY4 kuKNiuhhJbOUnKQ2Lc+wD2G7kPvbCDMyaT4FzzZBQ3GKW/7+e66jM3EDqNQD4KQpXZTj 587f36pPU+i2BzTk8mvUs5/6jsdos95Rbqw/ozLNj9wUNlbk/Y/l0cOEcuk/CMA82i4c V3/w== X-Gm-Message-State: ALoCoQnblCEN0K+/0utI8m2ei25XWSGAVkKVXRAUZmBHFvWDALaeSX0Ug/tOpJt8QKqEzVKUqSpE X-Received: by 10.112.122.42 with SMTP id lp10mr7959386lbb.5.1438084439204; Tue, 28 Jul 2015 04:53:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.196 with SMTP id a4ls660988lak.27.gmail; Tue, 28 Jul 2015 04:53:59 -0700 (PDT) X-Received: by 10.112.217.2 with SMTP id ou2mr32280386lbc.15.1438084439023; Tue, 28 Jul 2015 04:53:59 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id c4si18106881laf.113.2015.07.28.04.53.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2015 04:53:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by lagw2 with SMTP id w2so66919211lag.3 for ; Tue, 28 Jul 2015 04:53:58 -0700 (PDT) X-Received: by 10.152.1.66 with SMTP id 2mr32939888lak.56.1438084438798; Tue, 28 Jul 2015 04:53:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp2091476lba; Tue, 28 Jul 2015 04:53:57 -0700 (PDT) X-Received: by 10.140.83.84 with SMTP id i78mr49246742qgd.14.1438084437443; Tue, 28 Jul 2015 04:53:57 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w10si25007100qkw.84.2015.07.28.04.53.56; Tue, 28 Jul 2015 04:53:57 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id B0DCA61CBA; Tue, 28 Jul 2015 11:53:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id E013C61841; Tue, 28 Jul 2015 11:53:51 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 09EC161B7D; Tue, 28 Jul 2015 11:53:50 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by lists.linaro.org (Postfix) with ESMTPS id 20AD86183A for ; Tue, 28 Jul 2015 11:53:49 +0000 (UTC) Received: by lbbyj8 with SMTP id yj8so72878790lbb.0 for ; Tue, 28 Jul 2015 04:53:47 -0700 (PDT) X-Received: by 10.112.210.6 with SMTP id mq6mr14804467lbc.83.1438084427560; Tue, 28 Jul 2015 04:53:47 -0700 (PDT) Received: from elxahtkds32.localdomain (host-95-192-134-180.mobileonline.telia.com. [95.192.134.180]) by smtp.gmail.com with ESMTPSA id ks11sm4559071lac.0.2015.07.28.04.53.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jul 2015 04:53:46 -0700 (PDT) From: "Balakrishna.Garapati" To: stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Tue, 28 Jul 2015 13:53:08 +0200 Message-Id: <1438084388-29456-1-git-send-email-balakrishna.garapati@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH] example:generator:printing verbose output X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balakrishna.garapati@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Balakrishna.Garapati --- example/generator/odp_generator.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index d6ec758..a33d530 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -26,6 +26,7 @@ #define MAX_WORKERS 32 /**< max number of works */ #define SHM_PKT_POOL_SIZE (512*2048) /**< pkt pool size */ #define SHM_PKT_POOL_BUF_SIZE 1856 /**< pkt pool buf size */ +#define DEFAULT_PKT_INTERVAL 1000 /**< interval btw each pkt */ #define APPL_MODE_UDP 0 /**< UDP mode */ #define APPL_MODE_PING 1 /**< ping mode */ @@ -370,6 +371,7 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool) static void *gen_send_thread(void *arg) { int thr; + uint64_t start, now, diff; odp_pktio_t pktio; thread_args_t *thr_args; odp_queue_t outq_def; @@ -391,6 +393,7 @@ static void *gen_send_thread(void *arg) return NULL; } + start = odp_time_cycles(); printf(" [%02i] created mode: SEND\n", thr); for (;;) { int err; @@ -431,6 +434,14 @@ static void *gen_send_thread(void *arg) >= (unsigned int)args->appl.number) { break; } + + now = odp_time_cycles(); + diff = odp_time_diff_cycles(start, now); + if(odp_time_cycles_to_ns(diff) > 20*ODP_TIME_SEC) { + start = odp_time_cycles(); + printf(" [%02i] total send: %ju\n", + thr, odp_atomic_load_u64(&counters.seq)); + } } /* receive number of reply pks until timeout */ @@ -439,7 +450,7 @@ static void *gen_send_thread(void *arg) if (odp_atomic_load_u64(&counters.icmp) >= (unsigned int)args->appl.number) break; - millisleep(1000, + millisleep(DEFAULT_PKT_INTERVAL, thr_args->tp, thr_args->tim, thr_args->tq,