From patchwork Wed Jul 29 11:12:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 51653 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 D6ED2214B7 for ; Wed, 29 Jul 2015 11:17:30 +0000 (UTC) Received: by laah7 with SMTP id h7sf2623284laa.2 for ; Wed, 29 Jul 2015 04:17:29 -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=R2mNggyMcOn1d1O42ujbuCNbH6Wmom7iB3H+MZ0C66E=; b=e/LFhIf1UmyXxvlL8QADssbV8rzjuxAJj3zUJNu+Y4fKSHs5tT/2z1ABdxhJyiH5Hs RYRVnMDkuTp/jrWL52cT1kZ5ZR9K2nk987eK8ebShcNnC9NwYul2HW0v229nDiSUmWhL mmgJ/P2WI0us1cCceH3IbrcT4u7d5g9L5GTwQQ9R5V++rQbm91PAnugAU4u4APeE+6ZP ZAT6LacZTikslejhG5kuauGOVnd/tsE83anacJ8tqcfuOpKg3eR/VGEB7Q4BfPD+X6Za E1KBJWgHPKYkz4v9kauER7Pj3SAKooHE8QZze/Y8gMzY8czMUrm31NPK44m76VFUbli4 ypEg== X-Gm-Message-State: ALoCoQn8X9lNDRZ+TVvg3PS7XkI3sSiIb3BUhrCkDC6D8cmDD9MT0A6VZEK1Aorqv0KuDUp2xl93 X-Received: by 10.152.28.100 with SMTP id a4mr15740570lah.4.1438168649824; Wed, 29 Jul 2015 04:17:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.231 with SMTP id e7ls28131laa.34.gmail; Wed, 29 Jul 2015 04:17:29 -0700 (PDT) X-Received: by 10.152.116.13 with SMTP id js13mr1776668lab.62.1438168649552; Wed, 29 Jul 2015 04:17:29 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id rc5si21217038lac.166.2015.07.29.04.17.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2015 04:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lagw2 with SMTP id w2so4124271lag.3 for ; Wed, 29 Jul 2015 04:17:29 -0700 (PDT) X-Received: by 10.152.36.102 with SMTP id p6mr38225374laj.19.1438168649290; Wed, 29 Jul 2015 04:17:29 -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 l6csp2688737lba; Wed, 29 Jul 2015 04:17:28 -0700 (PDT) X-Received: by 10.140.97.72 with SMTP id l66mr51663562qge.11.1438168647833; Wed, 29 Jul 2015 04:17:27 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 95si182440qkx.38.2015.07.29.04.17.27; Wed, 29 Jul 2015 04:17:27 -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 1F95961E8A; Wed, 29 Jul 2015 11:17:27 +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 94BCD61838; Wed, 29 Jul 2015 11:14: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 7B38361DC6; Wed, 29 Jul 2015 11:14:46 +0000 (UTC) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by lists.linaro.org (Postfix) with ESMTPS id ADF5561820 for ; Wed, 29 Jul 2015 11:13:09 +0000 (UTC) Received: by lblf12 with SMTP id f12so4539347lbl.2 for ; Wed, 29 Jul 2015 04:13:08 -0700 (PDT) X-Received: by 10.112.163.129 with SMTP id yi1mr38906308lbb.77.1438168388595; Wed, 29 Jul 2015 04:13:08 -0700 (PDT) Received: from elxahtkds32.localdomain (host-95-192-121-40.mobileonline.telia.com. [95.192.121.40]) by smtp.gmail.com with ESMTPSA id s2sm941772lae.28.2015.07.29.04.12.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jul 2015 04:13:07 -0700 (PDT) From: "Balakrishna.Garapati" To: stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Wed, 29 Jul 2015 13:12:23 +0200 Message-Id: <1438168343-7648-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] [PATCHv2] 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.43 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 corrected alignment issues 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..5cf7e92 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,