Skip to content

Commit f46ade7

Browse files
committed
cpufreq-scaling-detect: describe cpufreq offline CPU error
When cpufreq /sys files are accessed for an offline CPU, errors about getline() returning -1 are printed. Describe this in a comment. Change-Id: I2c6ab8638310aec185b995bcac4b99ffed7a66d1 Signed-off-by: James Yang <[email protected]>
1 parent 8c2a12c commit f46ade7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

benchmarks/lockhammer/src/cpufreq-scaling-detect.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ static char * get_proc_file_first_line (const char * filename) {
106106
return line;
107107
}
108108

109+
// An offline CPU still has the cpufreq pseudo file present with read
110+
// permissions, but "Device or resource busy" when accessed, so getline
111+
// returns -1.
112+
109113
fprintf(stderr, "unexpectedly getline() returned -1 from reading %s\n", filename);
110114

111115
free(line);

0 commit comments

Comments
 (0)