From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f52.google.com (mail-pg0-f52.google.com [74.125.83.52]) by dpdk.org (Postfix) with ESMTP id 0D4312C54 for ; Wed, 12 Jul 2017 23:59:34 +0200 (CEST) Received: by mail-pg0-f52.google.com with SMTP id k14so19367509pgr.0 for ; Wed, 12 Jul 2017 14:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=20vkSObFrdkwVWo0e8TM8hxVGsZ33sn0KneiwXZobVc=; b=pHxvqsae8D7ztB5pJgZR6AlyZefNRfEha3cS/p/n0+c1Aw+Tzr+pfImTl4zRNZHhW1 LcFHEbedSTMWwyjZyxnDnPyfxKMK1cm5IxVP6nZm9sFs6OqZpLJneP/Efesjn+tfHoVF jNrojv2Dmc9IIWFOP3boj8tw/3BpI7K4CKCkbEMdYFMWbU5lcmPceuBZKfcp6bie70Ql OF96EYtMphtA8zkUmVgFdbmMnIx90580oUcOLufGhEeP2A6b3hqW5b18S/C0f+11jno+ R72zvKxi2f+qJfuwV/eYYk5Jr+2sLbtUUPIQPF+Wfj2rfBIWOWjsBzsKDkZktzBaz9iy FcFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=20vkSObFrdkwVWo0e8TM8hxVGsZ33sn0KneiwXZobVc=; b=cvip3Y49uYOsbI6SS40OHwUOT5SCKHi2F900lL+WBPtdUvnfvHLpOkKTkeWGNs7t47 sEsqlIYfPorRIwluy9wiU5UcnziEfsYT6y/0kvLAsdwlIFxRJpdQDa6UV0bA/NiEQKdP EEWe4N1jMbbNRMJkdRJDwwuF3kkn/9i7zIYctbbi2OO1RRpVXvtfUzD/GE69VWQTUAF8 IOeeab/uXCVH2CxmsgiQlMeOv6vnHZa3l40hdKOIdmLJEliUm4ROM/88iuNC90Ly+dUo 1bLYxrEqLo1cHSk+JdClWHL5vwV7bY5SOQLk/lcNreUHt8bwTdhXKRVm3GRJZG8m/d0e s/OQ== X-Gm-Message-State: AIVw112iGBvs4v3kzxOBTHbjRKdanSW9s7s18/KXBJcj0KS1w5rJShsT 7oNeDVpaacfRo9dK/WAlAg== X-Received: by 10.84.141.3 with SMTP id 3mr92868plu.221.1499896773318; Wed, 12 Jul 2017 14:59:33 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id t67sm7292140pfj.98.2017.07.12.14.59.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Jul 2017 14:59:33 -0700 (PDT) Date: Wed, 12 Jul 2017 14:59:25 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org Message-ID: <20170712145925.2dfe5be1@xeon-e3> In-Reply-To: <2203089.SAOtEojdoZ@xps> References: <20170711185546.26138-1-stephen@networkplumber.org> <20170711185546.26138-2-stephen@networkplumber.org> <2203089.SAOtEojdoZ@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 01/19] devtools: add simple script to find duplicate includes 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, 12 Jul 2017 21:59:34 -0000 On Tue, 11 Jul 2017 22:33:55 +0200 Thomas Monjalon wrote: > Thank you for this script, but... it is written in Perl! > I don't think it is a good idea to add yet another language to DPDK. > We already have shell and python scripts. > And I am not sure a lot of (young) people are able to parse it ;) > > I would like to propose this shell script: > > dirs='app buildtools drivers examples lib test' > pattern='^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*' > > for file in $(git ls $dirs) ; do > dups=$(sed -rn "s,$pattern,\1,p" $file | sort | uniq -d) > [ -n "$dups" ] || continue > echo "$file" > echo "$dups" | sed 's,^,\t,' > done There is no "git ls" command in current version, Using find instead works. plus shell is 7x slower. $ time bash -c "find . -name '*.c' | xargs /tmp/dupinc.sh" real 0m0.765s user 0m1.220s sys 0m0.155s $time bash -c "find . -name '*.c' | xargs ~/bin/dup_inc.pl" real 0m0.131s user 0m0.118s sys 0m0.014s How about some python code.