From patchwork Sun Jul 19 09:34: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: 51264 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9F23322A28 for ; Sun, 19 Jul 2015 09:34:56 +0000 (UTC) Received: by widic2 with SMTP id ic2sf20329782wid.1 for ; Sun, 19 Jul 2015 02:34:55 -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=fwKzDsXb7/KXhpVPWLs30b9BAu+g7PdUjEpoEihn3oE=; b=iMxSDt5yWXL5e5HLMoIcuxjH+ZqmtJt6ORp432jGvMU6zefraFXu3bYW1WgutPprMj xW9clUy97UZoOBhsdAs3TJlhShiWc/TwNEmG1o71u1n6DfmHv6JIYCjAsQ/dqEHab+Uk EpsM/9TYv1bHQ6tV2VzZrr7V/Roi1Aocyhm918TwLM1CTpDnKRUBcFU5VKLdpRLqOWG8 1UEXgBAcQx00hoKo/sAT9Wk1fRownGdz0RTjHWGB241VrfaLTgjuvf7rA7IW0n2zeLyW Ye33ibvcDVSy/OHTkvMNbJ68zFeXLrQh5+8bLQ71rbPHDY0jzz4QHiyEhBd4bJe4t6qk N8Vw== X-Gm-Message-State: ALoCoQk9gVKVC6xGy+wkpVjT6QW8scBj/oFKSMzVzelsMqwQWYQ/EaVHJXEP3we/dHcUjaPFFoPT X-Received: by 10.152.43.131 with SMTP id w3mr9230966lal.0.1437298495820; Sun, 19 Jul 2015 02:34:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.36 with SMTP id g4ls693516lah.33.gmail; Sun, 19 Jul 2015 02:34:55 -0700 (PDT) X-Received: by 10.112.83.135 with SMTP id q7mr22616591lby.13.1437298495673; Sun, 19 Jul 2015 02:34:55 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id g10si14672230lam.152.2015.07.19.02.34.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jul 2015 02:34:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by lahh5 with SMTP id h5so81916081lah.2 for ; Sun, 19 Jul 2015 02:34:55 -0700 (PDT) X-Received: by 10.112.133.72 with SMTP id pa8mr22316100lbb.117.1437298495564; Sun, 19 Jul 2015 02:34:55 -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 l6csp178746lba; Sun, 19 Jul 2015 02:34:54 -0700 (PDT) X-Received: by 10.140.238.8 with SMTP id j8mr32863160qhc.78.1437298494304; Sun, 19 Jul 2015 02:34:54 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b4si20212292qkb.125.2015.07.19.02.34.53; Sun, 19 Jul 2015 02:34:54 -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 1D47561D2C; Sun, 19 Jul 2015 09:34:53 +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_H2, 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 192EE61C94; Sun, 19 Jul 2015 09:34:49 +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 EF35061C9C; Sun, 19 Jul 2015 09:34:41 +0000 (UTC) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by lists.linaro.org (Postfix) with ESMTPS id 090CE61C8C for ; Sun, 19 Jul 2015 09:34:41 +0000 (UTC) Received: by lbbyj8 with SMTP id yj8so80467396lbb.0 for ; Sun, 19 Jul 2015 02:34:39 -0700 (PDT) X-Received: by 10.153.7.137 with SMTP id dc9mr14394075lad.16.1437298479274; Sun, 19 Jul 2015 02:34:39 -0700 (PDT) Received: from elxahtkds32.100mbit.bredband2.se (c-94-255-179-167.cust.bredband2.com. [94.255.179.167]) by smtp.gmail.com with ESMTPSA id ph4sm812162lbb.3.2015.07.19.02.34.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Jul 2015 02:34:38 -0700 (PDT) From: "Balakrishna.Garapati" To: stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Sun, 19 Jul 2015 11:34:23 +0200 Message-Id: <1437298463-18343-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:enabling option to limit workers 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.54 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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index d35f4aa..5c6c276 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -633,9 +633,13 @@ int main(int argc, char *argv[]) if (args->appl.cpu_count) num_workers = args->appl.cpu_count; - /* ping mode need two worker */ - if (args->appl.mode == APPL_MODE_PING) - num_workers = 2; + /* ping mode need two workers */ + if (args->appl.mode == APPL_MODE_PING) { + if (num_workers < 2) { + EXAMPLE_ERR("Need at least two worker threads\n"); + exit(EXIT_FAILURE); + } + } /* * By default CPU #0 runs Linux kernel background tasks. @@ -1032,6 +1036,8 @@ static void usage(char *progname) " -t, --timeout only for ping mode, wait ICMP reply timeout seconds\n" " -i, --interval wait interval ms between sending each packet\n" " default is 1000ms. 0 for flood mode\n" + " -w, --workers specify number of workers need to be assigned to application\n" + " default is to assign all\n" "\n" "Optional OPTIONS\n" " -h, --help Display help and exit.\n"