diff mbox series

tools/power turbostat: Do not display an error on systems without a cpufreq driver

Message ID 20180808184829.3632-1-prarit@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Len Brown
Headers show
Series tools/power turbostat: Do not display an error on systems without a cpufreq driver | expand

Commit Message

Prarit Bhargava Aug. 8, 2018, 6:48 p.m. UTC
Do not display a warning if there is no cpufreq driver loaded.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Len Brown <lenb@kernel.org>
---
 tools/power/x86/turbostat/turbostat.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Len Brown Aug. 8, 2018, 8:31 p.m. UTC | #1
On Wed, Aug 8, 2018 at 2:48 PM Prarit Bhargava <prarit@redhat.com> wrote:
>
> Do not display a warning if there is no cpufreq driver loaded.

Your patch makes me think what we should really do is change "stderr"
to "outf" here.
Because when I use --debug and the output is saved, I really do want
to know that
there is no cpufreq driver.

And that begs the question -- how did you run into this -- is there a
"normal" config that you use with no cpufreq driver and turbostat
--debug?

thanks,
-Len
Prarit Bhargava Aug. 9, 2018, 12:11 p.m. UTC | #2
On 08/08/2018 04:31 PM, Len Brown wrote:
> On Wed, Aug 8, 2018 at 2:48 PM Prarit Bhargava <prarit@redhat.com> wrote:
>>
>> Do not display a warning if there is no cpufreq driver loaded.
> 
> Your patch makes me think what we should really do is change "stderr"
> to "outf" here.
> Because when I use --debug and the output is saved, I really do want
> to know that
> there is no cpufreq driver.

Ok.

> 
> And that begs the question -- how did you run into this -- is there a
> "normal" config that you use with no cpufreq driver and turbostat
> --debug?

I'm using a .config I grabbed from a "known good" boot on other systems.  I can
send it to you if you're interested.

P.

> 
> thanks,
> -Len
>
Prarit Bhargava Aug. 9, 2018, 12:23 p.m. UTC | #3
On 08/08/2018 04:31 PM, Len Brown wrote:
> On Wed, Aug 8, 2018 at 2:48 PM Prarit Bhargava <prarit@redhat.com> wrote:
>>
>> Do not display a warning if there is no cpufreq driver loaded.
> 
> Your patch makes me think what we should really do is change "stderr"
> to "outf" here.
> Because when I use --debug and the output is saved, I really do want
> to know that
> there is no cpufreq driver.
> 
> And that begs the question -- how did you run into this -- is there a
> "normal" config that you use with no cpufreq driver and turbostat
> --debug?
> 

I went back and reviewed the system and discovered that this Dell AMD system has
BIOS configured to "Maximum Performance".  That disables the ACPI cpufreq
entries and then the acpi_cpufreq driver doesn't load.

It is a valid mode to run in AFAICT.

P.

> thanks,
> -Len
>
Len Brown Aug. 9, 2018, 4:30 p.m. UTC | #4
> It is a valid mode to run in AFAICT.

Agreed -- totally valid.
go ahead and send patch keeping these lines, but putting them in
"outf" instead of stderr.

thx,
-Len
diff mbox series

Patch

diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 980bd9d20646..25966e13307d 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -3440,10 +3440,9 @@  dump_sysfs_pstate_config(void)
 	sprintf(path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_driver",
 			base_cpu);
 	input = fopen(path, "r");
-	if (input == NULL) {
-		fprintf(stderr, "NSFOD %s\n", path);
+	if (input == NULL)
 		return;
-	}
+
 	fgets(driver_buf, sizeof(driver_buf), input);
 	fclose(input);