Received: by 10.192.165.156 with SMTP id m28csp575526imm; Wed, 11 Apr 2018 04:05:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx487Zy6pvepFzp23XcdeQ8uqXvCDj4ofvc3Ue9rgpzf1JaTsJkqAz0BHJUFMzqbWy4M9zPQz X-Received: by 10.167.130.2 with SMTP id k2mr3659203pfi.14.1523444759069; Wed, 11 Apr 2018 04:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523444759; cv=none; d=google.com; s=arc-20160816; b=jMhvWTx+XrznSqpeJZLG1FARGu3dPHz/gQPcjvlItwY4eZiVUQz6nvhUm8vQJx5VFa IPNs0vprEUvqU4j7ReKucGRzTM8vRrwZVJgCbQYwf1wPRZYbJJMJK9OeIQPp28Y/6MCw owbd6yYD1vIblWiX/2k4E41dlLHtLtR8CH/g9fbPxGpJK9E1E9Ag4BhRoVcaJXCxVKG1 f0RXWcU0T3LPJh8xEkw7afcCfr1UV8HTb6j9HiXPlsFQ+a70YzHM5TWhvKLNDtiwam0E yw3G57dCkJ0BVVSwQRjfHMLnSMmZdz3d4G3LHqq6J7NPASukyhKyfFAXZ25aYKNlUKpa WeWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:reply-to:from:subject:message-id :arc-authentication-results; bh=28ac1Q3IjpeLGMYDjc442PUy4ClHxybjWteF+OZRjNM=; b=BeYyM0sCvizyt252eJwtncDEyj2G/mTgf+jrWpHsiubXiwXpjIbfZj+cspwDjQKVs1 WMir3Idj02+/mHweNpav/m+88ITkim0A7ASq3ftlhWBLb4bsrplbT3F8G2HtqXguKDq0 +zxb5tfM9IOvWqeyMaucMmAM/k5G/bDccujAvXeYJcMiZ7214q1KQpXBOF/tdEVOH0Zs /GxWkERYeGKQGBwO5d0r0jXflxZeuX80g9/DfKu1buXPu169azfVwaIUP9ooBk1vSf7A tagRvRI2Gj3vrHIv7ivEaVSnt1YTpGkAEebyEburOmwNNtjs5p/2LAh/1Q9wHT2J7p4j 3REA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si593994pgf.259.2018.04.11.04.05.22; Wed, 11 Apr 2018 04:05:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752956AbeDKLCI (ORCPT + 99 others); Wed, 11 Apr 2018 07:02:08 -0400 Received: from mga02.intel.com ([134.134.136.20]:23934 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752929AbeDKLCG (ORCPT ); Wed, 11 Apr 2018 07:02:06 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2018 04:02:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,435,1517904000"; d="scan'208";a="49894780" Received: from linux.intel.com ([10.54.29.200]) by orsmga002.jf.intel.com with ESMTP; 11 Apr 2018 04:02:05 -0700 Received: from abityuts-desk.fi.intel.com (abityuts-desk.fi.intel.com [10.237.68.39]) by linux.intel.com (Postfix) with ESMTP id E876D5803A2; Wed, 11 Apr 2018 04:02:03 -0700 (PDT) Message-ID: <1523444522.2753.218.camel@gmail.com> Subject: Re: [PATCH][v3] tools/power turbostat: if --max_loop, print for specific time of loops From: Artem Bityutskiy Reply-To: dedekind1@gmail.com To: Yu Chen , Len Brown Cc: Rafael J Wysocki , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 11 Apr 2018 14:02:02 +0300 In-Reply-To: <20180411103038.12735-1-yu.c.chen@intel.com> References: <20180411103038.12735-1-yu.c.chen@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 (3.26.6-1.fc27) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A couple of nitpicks. On Wed, 2018-04-11 at 18:30 +0800, Yu Chen wrote: > @@ -48,6 +48,7 @@ char *proc_stat = "/proc/stat"; > FILE *outf; > int *fd_percpu; > struct timespec interval_ts = {5, 0}; > +int iterations; OK, out of several choices, you selected "iterations". > unsigned int debug; > unsigned int quiet; > unsigned int sums_need_wide_columns; > @@ -470,6 +471,7 @@ void help(void) > " {core | package | j,k,l..m,n-p }\n" > "--quiet skip decoding system configuration header\n" > "--interval sec Override default 5-second measurement interval\n" > + "--iterations loops The number of loops if interval is specified\n" Since "iterations" is the term, be consistent and do not mix it with "loops". Who knows may be the "loops" term will be used for something else in the future. Use something like this: "--iterations count Number of measurement iterations (requires ' --interval')" > print this help mkk > "--list list column headers only\n" > "--out file create or truncate \"file\" for all output\n" > @@ -2565,6 +2567,7 @@ void turbostat_loop() > { > int retval; > int restarted = 0; > + int loops = 0; Please, name variables in a consistent manner, this should really be something like 'int iters = 0'. Or may be 'done_iters', or something. But not "loops". > @@ -4999,6 +5010,7 @@ void cmdline(int argc, char **argv) > {"Dump", no_argument, 0, 'D'}, > {"debug", no_argument, 0, 'd'}, /* internal, not documented */ > {"interval", required_argument, 0, 'i'}, > + {"iterations", required_argument, 0, 't'}, If you used term "count", you could have consistent long and short option names, like '--count / -c'. I find '--iterations / -t' to be inconsistent, and harder to remember the short option, because I think about time, not "iterations" when I see -t.