From patchwork Wed Jul 29 14:25:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 51665 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id AE4FF214B7 for ; Wed, 29 Jul 2015 14:26:12 +0000 (UTC) Received: by lagw2 with SMTP id w2sf4380623lag.3 for ; Wed, 29 Jul 2015 07:26:11 -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=9+tws7N1WIWsq6X5TBcYal/S9bSe9nWoLXAak27wgwo=; b=WoK3RtUcfS/3dP0OVWopd/tIo9NGd9FcOdt5fwdPbPRaRPrqOeAc8T/EYAK24GgWeM zaUpM3cQXIKiv78TM7HIbNph78HUZcBLkexc1kOJGhfThGO/L7nfoQY4UpA5C64KUEe1 4qCcjMtl5+IfkHunzntHywQj77s4Jcve6HH206tmSMdK6YaOo5rta4E1oe8gEXHMqv5k CvD5vb6oI/wBZoyK2psEIiVausXQnyuxNtjVBkonuazHR3pECoW/slByse+NSanao580 AzGBNDEQV6sKudSF3u5fKJYl1hjpYVFe924z/tr0xVYuSAlUp2QzUf1B0Mr/v5nV9bLK N8ew== X-Gm-Message-State: ALoCoQkbEAFJY2bi4uN0LGS1ZNDrCMkGCJPaf4KbFfHV/smFq8FeChAqfkums5rcxMlqoRpKa4UE X-Received: by 10.112.148.101 with SMTP id tr5mr16201224lbb.13.1438179971662; Wed, 29 Jul 2015 07:26:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.34 with SMTP id n2ls49735laj.15.gmail; Wed, 29 Jul 2015 07:26:11 -0700 (PDT) X-Received: by 10.112.163.129 with SMTP id yi1mr39700207lbb.77.1438179971376; Wed, 29 Jul 2015 07:26:11 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id i12si21636440lbq.73.2015.07.29.07.26.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2015 07:26:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lahh5 with SMTP id h5so7323231lah.2 for ; Wed, 29 Jul 2015 07:26:11 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr38111585lbc.41.1438179971247; Wed, 29 Jul 2015 07:26:11 -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 l6csp2786716lba; Wed, 29 Jul 2015 07:26:10 -0700 (PDT) X-Received: by 10.140.90.99 with SMTP id w90mr61344370qgd.57.1438179969557; Wed, 29 Jul 2015 07:26:09 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o21si31580806qko.23.2015.07.29.07.26.08; Wed, 29 Jul 2015 07:26:09 -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 A7C1661E48; Wed, 29 Jul 2015 14:26:08 +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 6706561C9B; Wed, 29 Jul 2015 14:26:03 +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 8E56661C7A; Wed, 29 Jul 2015 14:25:57 +0000 (UTC) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by lists.linaro.org (Postfix) with ESMTPS id CB3DF61C6E for ; Wed, 29 Jul 2015 14:25:50 +0000 (UTC) Received: by lagw2 with SMTP id w2so7320277lag.3 for ; Wed, 29 Jul 2015 07:25:49 -0700 (PDT) X-Received: by 10.112.242.134 with SMTP id wq6mr33176810lbc.99.1438179949710; Wed, 29 Jul 2015 07:25:49 -0700 (PDT) Received: from elxahtkds32.localdomain (host-95-192-201-176.mobileonline.telia.com. [95.192.201.176]) by smtp.gmail.com with ESMTPSA id g5sm5303730laf.33.2015.07.29.07.25.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jul 2015 07:25:48 -0700 (PDT) From: "Balakrishna.Garapati" To: stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Wed, 29 Jul 2015 16:25:41 +0200 Message-Id: <1438179941-22229-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] [PATCHv3] 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.42 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 Reviewed-by: Stuart Haslam --- Added fflush example/generator/odp_generator.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index d6ec758..bdee222 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,15 @@ 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)); + fflush(stdout); + } } /* receive number of reply pks until timeout */ @@ -439,7 +451,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,