Confusion Regarding Powerdebug Sensors Info on i386
Hello, I ran powerdebug on i386 (ubuntu 13.04) and it seems its outputting wrong information in Sensors info page. Suspects are colored blue below - # sudo ./powerdebug PowerDebug 0.7.2 Clocks Regulators Sensors Gpio NameValue coretemp temp1_crit_alarm 0.0 temp3_input34.0 temp3_label34.0 This seems incorrect temp2_crit_alarm 0.0 temp1_crit 99.0 temp2_crit 99.0 temp3_crit 99.0 temp4_crit 99.0 temp5_crit 99.0 temp4_input23.0 temp4_label23.0 This seems incorrect temp3_crit_alarm 0.0 temp4_crit_alarm 0.0 temp5_input34.0 temp5_label34.0 This seems incorrect temp5_crit_alarm 0.0 temp1_input34.0 temp1_label34.0 This seems incorrect temp1_max 80.0 temp2_max 80.0 temp3_max 80.0 temp4_max 80.0 temp5_max 80.0 temp2_input28.0 temp2_label28.0 This seems incorrect The contents of these files are not any legal integer value as expected - # cat temp*_label Physical id 0 Core 0 Core 1 Core 2 Core 3 The problem I think is in the below code in utils.c/file_read_value()- ret = fscanf(file, format, value) == EOF ? -1 : 0; We are comparing with EOF. In this case fscanf is returning zero. So this check passes and returns success. So old value is retained in value from previous read. A simple fix would be to change the line to - ret = fscanf(file, format, value) = 0 ? -1 : 0; Would you care to check? diff --git a/utils.c b/utils.c index 4d4b780..bfe2ba3 100644 --- a/utils.c +++ b/utils.c @@ -46,7 +46,7 @@ int file_read_value(const char *path, const char *name, goto out_free; } -ret = fscanf(file, format, value) == EOF ? -1 : 0; +ret = fscanf(file, format, value) = 0 ? -1 : 0; fclose(file); out_free: -- Thanks, -Meraj ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [PATCH 2/9] Sort options in alphabetic order of the single-char options
On 05/29/2014 12:17 AM, Amit Kucheria wrote: Signed-off-by: Amit Kucheria amit.kuche...@linaro.org Acked-by: Daniel Lezcano daniel.lezc...@linaro.org -- http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro Facebook | http://twitter.com/#!/linaroorg Twitter | http://www.linaro.org/linaro-blog/ Blog ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [PATCH 3/9] Adding missing 'duration' option in long_options
On 05/29/2014 12:17 AM, Amit Kucheria wrote: commit 1e80e5eaf71b606405cbdf6751aa7446533d8b3a (idlestat: get ride of trace-cmd) seems to have missed adding this Signed-off-by: Amit Kucheria amit.kuche...@linaro.org Good catch. Acked-by: Daniel Lezcano daniel.lezc...@linaro.org -- http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro Facebook | http://twitter.com/#!/linaroorg Twitter | http://www.linaro.org/linaro-blog/ Blog ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [PATCH 4/9] Specify which options need arguments and which don't to help getopt_long()
On 05/29/2014 12:17 AM, Amit Kucheria wrote: Signed-off-by: Amit Kucheria amit.kuche...@linaro.org Acked-by: Daniel Lezcano daniel.lezc...@linaro.org -- http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro Facebook | http://twitter.com/#!/linaroorg Twitter | http://www.linaro.org/linaro-blog/ Blog ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [PATCH 5/9] Stick to -d for debug according to widely used convention
On 05/29/2014 12:17 AM, Amit Kucheria wrote: Switch the dump option (which might be used infrequently) to use -m Signed-off-by: Amit Kucheria amit.kuche...@linaro.org Acked-by: Daniel Lezcano daniel.lezc...@linaro.org --- idlestat.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/idlestat.c b/idlestat.c index 48e4166..a3b9363 100644 --- a/idlestat.c +++ b/idlestat.c @@ -946,7 +946,7 @@ struct cpuidle_cstates *physical_cluster_data(struct cpu_physical *s_phy) static void help(const char *cmd) { fprintf(stderr, - %s [-d|--dump] [-t seconds] -o|--output-file file\n, + %s [-m|--dump] [-t seconds] -o|--output-file file\n, basename(cmd)); } @@ -956,10 +956,10 @@ static void version(const char *cmd) } static struct option long_options[] = { - { dump,no_argument, 0, 'd' }, - { debug, no_argument, 0, 'g' }, + { debug, no_argument, 0, 'd' }, { help,no_argument, 0, 'h' }, { iterations, required_argument, 0, 'i' }, + { dump,no_argument, 0, 'm' }, { output-file, required_argument, 0, 'o' }, { duration,required_argument, 0, 't' }, { version, no_argument, 0, 'V' }, @@ -985,16 +985,13 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) int optindex = 0; - c = getopt_long(argc, argv, dghi:o:t:V, + c = getopt_long(argc, argv, dhi:mo:t:V, long_options, optindex); if (c == -1) break; switch (c) { case 'd': - options-dump = true; - break; - case 'g': options-debug = true; break; case 'h': @@ -1004,6 +1001,9 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) case 'i': options-iterations = atoi(optarg); break; + case 'm': + options-dump = true; + break; case 'o': options-filename = optarg; break; -- http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro Facebook | http://twitter.com/#!/linaroorg Twitter | http://www.linaro.org/linaro-blog/ Blog ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [PATCH 6/9] Make getopt_long handling more robust
On 05/29/2014 12:17 AM, Amit Kucheria wrote: Adding ':' as first character of optstring to getopt_long allows separating error message for invalid option and invalid option arguments Signed-off-by: Amit Kucheria amit.kuche...@linaro.org Acked-by: Daniel Lezcano daniel.lezc...@linaro.org --- idlestat.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/idlestat.c b/idlestat.c index a3b9363..96fc1f2 100644 --- a/idlestat.c +++ b/idlestat.c @@ -985,7 +985,7 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) int optindex = 0; - c = getopt_long(argc, argv, dhi:mo:t:V, + c = getopt_long(argc, argv, :dhi:mo:t:V, long_options, optindex); if (c == -1) break; @@ -1014,11 +1014,16 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) version(argv[0]); exit(0); break; - case '?': - fprintf(stderr, %s: Unknown option %c'.\n, + case 0: /* getopt_long() set a variable, just keep going */ + break; + case ':': /* missing option argument */ + fprintf(stderr, %s: option `-%c' requires an argument\n, argv[0], optopt); - /* fall through */ + return -1; + case '?': /* invalid option */ default: + fprintf(stderr, %s: Unknown option `-%c'.\n, + argv[0], optopt); return -1; } } @@ -1027,7 +1032,7 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) fprintf(stderr, dump values must be a positive value\n); if (NULL == options-filename) { - fprintf(stderr, expected filename\n); + fprintf(stderr, expected -o filename\n); return -1; } -- http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro Facebook | http://twitter.com/#!/linaroorg Twitter | http://www.linaro.org/linaro-blog/ Blog ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [PATCH 7/9] struct option long_options doesn't need to be global
On 05/29/2014 12:17 AM, Amit Kucheria wrote: Change the flag field to NULL while we're at it Signed-off-by: Amit Kucheria amit.kuche...@linaro.org --- idlestat.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/idlestat.c b/idlestat.c index 96fc1f2..c4a405a 100644 --- a/idlestat.c +++ b/idlestat.c @@ -955,17 +955,6 @@ static void version(const char *cmd) printf(%s version %s\n, basename(cmd), IDLESTAT_VERSION); } -static struct option long_options[] = { - { debug, no_argument, 0, 'd' }, - { help,no_argument, 0, 'h' }, - { iterations, required_argument, 0, 'i' }, - { dump,no_argument, 0, 'm' }, - { output-file, required_argument, 0, 'o' }, - { duration,required_argument, 0, 't' }, - { version, no_argument, 0, 'V' }, - { 0, 0, 0, 0 } -}; - struct idledebug_options { bool debug; bool dump; @@ -983,6 +972,16 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) while (1) { + static struct option long_options[] = { + { debug, no_argument, NULL, 'd' }, + { help,no_argument, NULL, 'h' }, + { iterations, required_argument, NULL, 'i' }, + { dump,no_argument, NULL, 'm' }, + { output-file, required_argument, NULL, 'o' }, + { duration,required_argument, NULL, 't' }, + { version, no_argument, NULL, 'V' }, + { 0, 0, 0, 0 } + }; Why not move this declaration at the beginning of the function and remove the 'static' ? int optindex = 0; c = getopt_long(argc, argv, :dhi:mo:t:V, -- http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro Facebook | http://twitter.com/#!/linaroorg Twitter | http://www.linaro.org/linaro-blog/ Blog ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [PATCH 9/9] idledebug? When did we ever call it that?
On 05/29/2014 12:17 AM, Amit Kucheria wrote: Signed-off-by: Amit Kucheria amit.kuche...@linaro.org Yep, powerdebug = idledebug = idlestat :) Legacy copy/paste from powerdebug. Acked-by: Daniel Lezcano daniel.lezc...@linaro.org --- idlestat.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/idlestat.c b/idlestat.c index 849b6dd..00b2032 100644 --- a/idlestat.c +++ b/idlestat.c @@ -959,7 +959,7 @@ static void version(const char *cmd) printf(%s version %s\n, basename(cmd), IDLESTAT_VERSION); } -struct idledebug_options { +struct program_options { bool debug; bool dump; int iterations; @@ -967,7 +967,7 @@ struct idledebug_options { char *filename; }; -int getoptions(int argc, char *argv[], struct idledebug_options *options) +int getoptions(int argc, char *argv[], struct program_options *options) { int c; @@ -1135,7 +1135,7 @@ static void sighandler(int sig) } static int execute(int argc, char *argv[], char *const envp[], - struct idledebug_options *options) + struct program_options *options) { pid_t pid; int status; @@ -1192,7 +1192,7 @@ int main(int argc, char *argv[], char *const envp[]) { struct cpuidle_datas *datas; struct cpuidle_datas *cluster; - struct idledebug_options options; + struct program_options options; struct rusage rusage; int args; -- http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro Facebook | http://twitter.com/#!/linaroorg Twitter | http://www.linaro.org/linaro-blog/ Blog ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [PATCH 8/9] improve help - show all available options
On 05/29/2014 12:17 AM, Amit Kucheria wrote: Signed-off-by: Amit Kucheria amit.kuche...@linaro.org Acked-by: Daniel Lezcano daniel.lezc...@linaro.org --- README | 7 +-- idlestat.c | 11 --- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README b/README index 3a8eb49..24485c5 100644 --- a/README +++ b/README @@ -28,14 +28,17 @@ Requirements 1. It must be run as root in order to access /sys/kernel/debug. 2. It requires tracing to be enabled in the kernel +Help + +./idlestat -h will show all the options + Example Usage - -./idlestat -d -o myoutput -t 10 +./idlestat -o /tmp/myoutput -t 10 where, --d : dump the states at the end -o : output file to store the traces -t : the duration in seconds diff --git a/idlestat.c b/idlestat.c index c4a405a..849b6dd 100644 --- a/idlestat.c +++ b/idlestat.c @@ -946,8 +946,12 @@ struct cpuidle_cstates *physical_cluster_data(struct cpu_physical *s_phy) static void help(const char *cmd) { fprintf(stderr, - %s [-m|--dump] [-t seconds] -o|--output-file file\n, + \nUsage:\n%s -o|--output-file file [-m|--dump] +[-t|--duration seconds] [-i|--iterations number] +[-d|--debug]\n, basename(cmd)); + fprintf(stderr, + \nExample:\n%s -o /tmp/myoutput -t 30\n, basename(cmd)); } static void version(const char *cmd) @@ -1017,12 +1021,13 @@ int getoptions(int argc, char *argv[], struct idledebug_options *options) break; case ':': /* missing option argument */ fprintf(stderr, %s: option `-%c' requires an argument\n, - argv[0], optopt); + basename(argv[0]), optopt); return -1; case '?': /* invalid option */ default: fprintf(stderr, %s: Unknown option `-%c'.\n, - argv[0], optopt); + basename(argv[0]), optopt); + help(argv[0]); return -1; } } -- http://www.linaro.org/ Linaro.org │ Open source software for ARM SoCs Follow Linaro: http://www.facebook.com/pages/Linaro Facebook | http://twitter.com/#!/linaroorg Twitter | http://www.linaro.org/linaro-blog/ Blog ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
[ACTIVITY] week 22
== Progress == * Toolchain binary release (DEVPLAT-101: 30%) * Started porting AArch64 Bionic optimizations to ARMv7 (DEVPLAT-104: 10%) * Clang patchset upstreaming (JUICE-340: 25%) * Bionic Aarch64 upstreaming (JUICE-298: 15%) * Investigated updates in Google's toolchain tree (not tracked, 20%) == Plans == * Finish porting AArch64 Bionic optimizations to ARMv7 (DEVPLAT-104) * Get missing features into Cbuildv2 for next cycle's toolchain binary release (DEVPLAT-101) * Locate fix for STLport crash issue on AArch64 in Google's toolchain tree == Issues == * None ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
[Activity] week 22
== Progress == * Release 14.05 166% (one holiday and one vacation day went *poof*) == Plans == * Bug triage == Issues == * Release slipped due to cbuildv2 and aarch64 problems ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
[ACTIVITY] week 22
== Progress == * Boot Android with u-boot on ARMv8 SoC (CARD-1049: 20 %) * 14.05 Android release (DEVPLAT-99: 30%) * Fix CI issues on ARMv7 LSK premerge CI - 10%. == Plans == * Boot Android with u-boot on ARMv8 SoC (CARD-1049) * Build Linaro Android on Ubuntu 14.04 (DEVPLAT-218) == Issues == Was on Leave on 26th and 27th due to an emergency. ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
[AVTIVITY] week 22
== Progress == * Chef testing on ARMv8 (REQ-366 20%) * Xen packaging fix (BUG-1317155 40%) * KVM CI fix 10% * repo.linaro.org maintenance (10%) * Xen-base ARMv8 (CARD-736 10%) * Aarch 64 porting (CARD-274 10%) == Plans == * Xen and KVM for armv8 (CARD-736, CARD-346) * Reduce moving pieces from KVM CI to make results more predictable == Issues == * None ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Re: [ACTIVITY] week 21
== Progress == Upgrading the ARM trusted firmware with fip binaries : Preparing the wiki page for booting android on juice fvp with fip binaries, as It is not encourage to change the UEFI boot args in source code (DEVPLAT-216 : 60%) == Plans == Will be on leave for 1 week. == Issues == None On 23 May 2014 22:34, Harigopal Gollamudi harigopal.gollam...@linaro.org wrote: == Progress == Upgrading the ARM trusted firmware with fip binaries : Able to boot the kernel But got stuck at not mounting the root file system to boot android (DEVPLAT-216 : 60%) == Plans == Get boot android on fastmodel with FIP binaries (DEVPLAT-216) == Issues == None -- Thanks and Regards, HariGopal G Android Engineer -- Thanks and Regards, HariGopal G Android Engineer ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
cpufreq lock
Hi, I am looking at in cpufreq.c __cpufreq_governor(policy, CPUFREQ_GOV_STOP); up_write(policy-rwsem); __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); down_write(policy-rwsem); Why do we need to unlock the lock before calling CPUFREQ_GOV_POLICY_EXIT. Wont this result in a race condition when 2 cpus are calling policy exit, one after another during governor switch? -- Regards, Sriram ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
[ACTIVITY] week 22
== Progress == * Investigated why QT4 uploads are failing (DEVPLAT-217: 8%) * Built gcc-4.9 and gdb cycle (CARD-722 20%) * Built and upload texlive-bin (CARD-722: 10%) * Failed to build python-numpy/cython loop (CARD-722: 10%) * Tested debootstrap from debian-ports repo. Uploaded images to Arm64Port wiki (DEVPLAT-219 15%) * Set up 3 accounts for DDs to work on packages on porterbox (DEVPLAT-222: 15%) * Updated wiki, wrote and sent invitation to Bootstrap Sprint (DEVPLAT-220: 10%) * GSOC bootstrap mentoring (3%) * Reviewed Chen's packages and DD applcation (2%) * Tried (and failed) to run compulsory ARM training (java+flash) (8%) * Tried to get ARM timesheeting fixed (4%) * Booked hotel for Connect LCU (2%) == Plans == * Build poppler. (DEVPLAT-221) * Build/upload QT4. (DEVPLAT-217) == Issues == * ARM admin is windows-centric PITA. * QT4 uploads getting lost due to wrong keys Wookey -- Principal hats: Linaro, Emdebian, Wookware, Balloonboard, ARM http://wookware.org/ ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
[ACTIVITY] week 22
== Progress == * Enabling UEFI Fastboot on Panda - Tested Fastboot App in UEFI Shell (CARD-198: 30 %) * Enabling U-boot Fastboot for Panda - Built the code for Panda (CARD-1103: 50%) * Flash support on u-boot fastboot - Analysis (CARD-1103: 10%) * Testing u-boot fastboot on Panda, In Progress (10%) == Plans == * CARD-198: UEFI Fastboot, work on enabling protocols and test them(CARD-198: 20 %) * U-boot Fastboot for Panda/Beaglebone - Test the commands (CARD-1103: 30%) * Flash support on u-boot fastboot (CARD-1103: 50%) == Issues == * None ___ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev