[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180410130002.GB29464@yu-chen.sh.intel.com>
Date: Tue, 10 Apr 2018 21:00:02 +0800
From: Yu Chen <yu.c.chen@...el.com>
To: "Bityutskiy, Artem" <artem.bityutskiy@...el.com>
Cc: "lenb@...nel.org" <lenb@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"rjw@...ysocki.net" <rjw@...ysocki.net>
Subject: Re: [PATCH][RFC] tools/power turbostat: if --max_loop, print for
specific time of loops
Hi,
On Tue, Apr 10, 2018 at 07:02:22PM +0800, Bityutskiy, Artem wrote:
> On Tue, 2018-04-10 at 18:18 +0800, Yu Chen wrote:
> > @@ -5076,6 +5084,15 @@ void cmdline(int argc, char **argv)
> > print_version();
> > exit(0);
> > break;
> > + case 'x':
> > + {
> > + unsigned int loops = strtod(optarg, NULL);
>
> It would make sense to error out here if you get a value <= 0.
>
OK.
> > +
> > + if (loops % 2)
> > + loops++;
>
> What is this for?
>
It was intended to make the number of loops even for simplify.
But after rethink about this, it might not be necessary. I'll
change it.
> > + max_loops = loops;
>
> Is the "loops" variable really needed? Can you strtod directly to
> max_loops?
If the sanity check for user input is added then I think the local
variable is needed.
Thanks,
Yu
>
> --
> Best Regards,
> Artem Bityutskiy
Powered by blists - more mailing lists