From: Daniel Lezcano dlezcano@fr.ibm.com
Create a single structure for powerdebug options.
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- powerdebug.c | 175 +++++++++++++++++++++++++++++++++------------------------- 1 files changed, 99 insertions(+), 76 deletions(-)
diff --git a/powerdebug.c b/powerdebug.c index 197f255..4c2400b 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -20,7 +20,6 @@ int dump; int highlighted_row; int selectedwindow = -1; -double ticktime = 10.0; /* in seconds */
char *win_names[TOTAL_FEATURE_WINS] = { "Regulators", @@ -45,119 +44,143 @@ void usage(void) " -s)\n"); printf(" -V, --version Show Version\n"); printf(" -h, --help Help\n"); - - exit(0); }
void version() { printf("powerdebug version %s\n", VERSION); - exit(0); }
-int main(int argc, char **argv) +/* + * Options: + * -r, --regulator : regulator + * -s, --sensor : sensors + * -c, --clock : clocks + * -p, --findparents : clockname whose parents have to be found + * -t, --time : ticktime + * -d, --dump : dump + * -v, --verbose : verbose + * -V, --version : version + * -h, --help : help + * no option / default : show usage! + */ + +static struct option long_options[] = { + { "regulator", 0, 0, 'r' }, + { "sensor", 0, 0, 's' }, + { "clock", 0, 0, 'c' }, + { "findparents", 1, 0, 'p' }, + { "time", 1, 0, 't' }, + { "dump", 0, 0, 'd' }, + { "verbose", 0, 0, 'v' }, + { "version", 0, 0, 'V' }, + { "help", 0, 0, 'h' }, + { 0, 0, 0, 0 } +}; + +struct powerdebug_options { + int findparent; + int verbose; + int regulators; + int sensors; + int clocks; + int ticktime; + char clkarg[64]; +}; + +int getoptions(int argc, char *argv[], struct powerdebug_options *options) { - int c, i; - int firsttime[TOTAL_FEATURE_WINS]; - int enter_hit = 0, verbose = 0, findparent_ncurses = 0, refreshwin = 0; - int regulators = 0, sensors = 0, clocks = 0, findparent = 0; - char clkarg[64], clkname_str[64]; - - for (i = 0; i < TOTAL_FEATURE_WINS; i++) - firsttime[i] = 1; + int c;
- /* - * Options: - * -r, --regulator : regulator - * -s, --sensor : sensors - * -c, --clock : clocks - * -p, --findparents : clockname whose parents have to be found - * -t, --time : ticktime - * -d, --dump : dump - * -v, --verbose : verbose - * -V, --version : version - * -h, --help : help - * no option / default : show usage! - */ + memset(options, 0, sizeof(*options)); + options->ticktime = 10;
while (1) { int optindex = 0; - static struct option long_options[] = { - {"regulator", 0, 0, 'r'}, - {"sensor", 0, 0, 's'}, - {"clock", 0, 0, 'c'}, - {"findparents", 1, 0, 'p'}, - {"time", 1, 0, 't'}, - {"dump", 0, 0, 'd'}, - {"verbose", 0, 0, 'v'}, - {"version", 0, 0, 'V'}, - {"help", 0, 0, 'h'}, - {0, 0, 0, 0} - }; - - c = getopt_long(argc, argv, "rscp:t:dvVh", long_options, &optindex); + + c = getopt_long(argc, argv, "rscp:t:dvVh", + long_options, &optindex); if (c == -1) break;
switch (c) { case 'r': - regulators = 1; + options->regulators = 1; selectedwindow = REGULATOR; break; case 's': - sensors = 1; + options->sensors = 1; selectedwindow = SENSOR; break; case 'c': - clocks = 1; + options->clocks = 1; selectedwindow = CLOCK; break; case 'p': - findparent = 1; - strcpy(clkarg, optarg); + options->findparent = 1; + strcpy(options->clkarg, optarg); break; case 't': - ticktime = strtod(optarg, NULL); + options->ticktime = strtod(optarg, NULL); break; case 'd': dump = 1; break; case 'v': - verbose = 1; + options->verbose = 1; break; case 'V': version(); break; - case 'h': - usage(); - break; case '?': - fprintf (stderr, "%s: Unknown option %c'.\n", - argv[0], optopt); - exit(1); + fprintf(stderr, "%s: Unknown option %c'.\n", + argv[0], optopt); default: - usage(); - break; + return -1; } }
- if (dump && !(regulators || clocks || sensors)) { - //fprintf(stderr, "Dump mode (-d) supported only with -c, -r " - // "or -s ..\n"); - //usage(); - // By Default lets show everything we have! - regulators = clocks = sensors = 1; + if (dump && !(options->regulators || + options->clocks || options->sensors)) { + /* By Default lets show everything we have */ + options->regulators = options->clocks = options->sensors = 1; }
- if (findparent && (!clocks || !dump)) { + if (options->findparent && (!options->clocks || !dump)) { fprintf(stderr, "-p option passed without -c and -d." " Exiting...\n"); - usage(); + return -1; }
if (!dump && selectedwindow == -1) selectedwindow = REGULATOR;
+ return 0; +} + +int main(int argc, char **argv) +{ + int i; + int findparent_ncurses = 0, refreshwin = 0; + int enter_hit = 0; + int firsttime[TOTAL_FEATURE_WINS]; + char clkname_str[64]; + struct powerdebug_options *options; + + for (i = 0; i < TOTAL_FEATURE_WINS; i++) + firsttime[i] = 1; + + options = malloc(sizeof(*options)); + if (!options) { + fprintf(stderr, "failed to allocated memory\n"); + return -1; + } + + if (getoptions(argc, argv, options)) { + usage(); + return 1; + } + init_regulator_ds();
while(1) { @@ -173,17 +196,17 @@ int main(int argc, char **argv) }
- if (regulators || selectedwindow == REGULATOR) { + if (options->regulators || selectedwindow == REGULATOR) { read_regulator_info(); if (!dump) { create_selectedwindow(); - show_regulator_info(verbose); + show_regulator_info(options->verbose); } else - print_regulator_info(verbose); + print_regulator_info(options->verbose); }
- if (clocks || selectedwindow == CLOCK) { + if (options->clocks || selectedwindow == CLOCK) { int ret = 0; if (firsttime[CLOCK]) { ret = init_clock_details(); @@ -203,7 +226,7 @@ int main(int argc, char **argv) if (refreshwin) command = REFRESH_WINDOW; hrow = read_and_print_clock_info( - verbose, + options->verbose, highlighted_row, command); highlighted_row = hrow; @@ -213,19 +236,19 @@ int main(int argc, char **argv) enter_hit); } if (!ret && dump) { - if (findparent) - read_and_dump_clock_info_one(clkarg); + if (options->findparent) + read_and_dump_clock_info_one(options->clkarg); else - read_and_dump_clock_info(verbose); + read_and_dump_clock_info(options->verbose); } }
- if (sensors || selectedwindow == SENSOR) { + if (options->sensors || selectedwindow == SENSOR) { if (!dump) { create_selectedwindow(); print_sensor_header(); } else - read_and_print_sensor_info(verbose); + read_and_print_sensor_info(options->verbose); }
if (dump) @@ -233,8 +256,8 @@ int main(int argc, char **argv)
FD_ZERO(&readfds); FD_SET(0, &readfds); - tval.tv_sec = ticktime; - tval.tv_usec = (ticktime - tval.tv_sec) * 1000000; + tval.tv_sec = options->ticktime; + tval.tv_usec = (options->ticktime - tval.tv_sec) * 1000000;
key = select(1, &readfds, NULL, NULL, &tval);
@@ -309,7 +332,7 @@ int main(int argc, char **argv) exit(0); if (keychar == 'R') { refreshwin = 1; - ticktime = 3; + options->ticktime = 3; } else refreshwin = 0; }
From: Daniel Lezcano dlezcano@fr.ibm.com
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- powerdebug.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/powerdebug.c b/powerdebug.c index 4c2400b..3529459 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -85,7 +85,7 @@ struct powerdebug_options { int sensors; int clocks; int ticktime; - char clkarg[64]; + char *clkarg; };
int getoptions(int argc, char *argv[], struct powerdebug_options *options) @@ -118,7 +118,11 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) break; case 'p': options->findparent = 1; - strcpy(options->clkarg, optarg); + options->clkarg = strdup(optarg); + if (!options->clkarg) { + fprintf(stderr, "failed to allocate memory"); + return -1; + } break; case 't': options->ticktime = strtod(optarg, NULL);
From: Daniel Lezcano dlezcano@fr.ibm.com
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- powerdebug.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/powerdebug.c b/powerdebug.c index 3529459..44f1f02 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -125,7 +125,7 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) } break; case 't': - options->ticktime = strtod(optarg, NULL); + options->ticktime = atoi(optarg); break; case 'd': dump = 1;
From: Daniel Lezcano dlezcano@fr.ibm.com
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- powerdebug.c | 3 ++- powerdebug.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/powerdebug.c b/powerdebug.c index 44f1f02..f2d02c8 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -185,7 +185,8 @@ int main(int argc, char **argv) return 1; }
- init_regulator_ds(); + if (init_regulator_ds()) + return -1;
while(1) { int key = 0; diff --git a/powerdebug.h b/powerdebug.h index f351ff2..e194025 100644 --- a/powerdebug.h +++ b/powerdebug.h @@ -40,8 +40,8 @@ extern double ticktime;
extern void version(void);
+extern int init_regulator_ds(void); extern void print_regulator_info(int verbose); -extern void init_regulator_ds(void); extern void read_regulator_info(void); extern void print_regulator_info(int verbose);
From: Daniel Lezcano dlezcano@fr.ibm.com
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- powerdebug.c | 48 +++++++++++++++++++++++++++++------------------- 1 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/powerdebug.c b/powerdebug.c index f2d02c8..12c0c56 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -162,32 +162,17 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) return 0; }
-int main(int argc, char **argv) +int mainloop(struct powerdebug_options *options) { - int i; int findparent_ncurses = 0, refreshwin = 0; int enter_hit = 0; int firsttime[TOTAL_FEATURE_WINS]; + int i; char clkname_str[64]; - struct powerdebug_options *options;
for (i = 0; i < TOTAL_FEATURE_WINS; i++) firsttime[i] = 1;
- options = malloc(sizeof(*options)); - if (!options) { - fprintf(stderr, "failed to allocated memory\n"); - return -1; - } - - if (getoptions(argc, argv, options)) { - usage(); - return 1; - } - - if (init_regulator_ds()) - return -1; - while(1) { int key = 0; struct timeval tval; @@ -334,7 +319,7 @@ int main(int argc, char **argv) enter_hit = 1;
if (keychar == 'Q' && !findparent_ncurses) - exit(0); + break; if (keychar == 'R') { refreshwin = 1; options->ticktime = 3; @@ -342,6 +327,31 @@ int main(int argc, char **argv) refreshwin = 0; } } - exit(0); + + return 0; +} + +int main(int argc, char **argv) +{ + struct powerdebug_options *options; + + options = malloc(sizeof(*options)); + if (!options) { + fprintf(stderr, "failed to allocated memory\n"); + return -1; + } + + if (getoptions(argc, argv, options)) { + usage(); + return 1; + } + + if (init_regulator_ds()) + return 1; + + if (mainloop(options)) + return 1; + + return 0; }
From: Daniel Lezcano dlezcano@fr.ibm.com
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- powerdebug.c | 161 +++++++++++++++++++++++++++++++--------------------------- 1 files changed, 86 insertions(+), 75 deletions(-)
diff --git a/powerdebug.c b/powerdebug.c index 12c0c56..b9b1ac5 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -162,6 +162,87 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) return 0; }
+int keystroke_callback(int *enter_hit, int *findparent_ncurses, + char *clkname_str, int *refreshwin, + struct powerdebug_options *options) +{ + char keychar; + int keystroke = getch(); + int oldselectedwin = selectedwindow; + + if (keystroke == EOF) + exit(0); + + if (keystroke == KEY_RIGHT || keystroke == 9) + selectedwindow++; + + if (keystroke == KEY_LEFT || keystroke == 353) + selectedwindow--; + + if (selectedwindow >= TOTAL_FEATURE_WINS) + selectedwindow = 0; + + if (selectedwindow < 0) + selectedwindow = TOTAL_FEATURE_WINS - 1; + + if (selectedwindow == CLOCK) { + if (keystroke == KEY_DOWN) + highlighted_row++; + if (keystroke == KEY_UP && highlighted_row > 0) + highlighted_row--; + if (keystroke == 47) + *findparent_ncurses = 1; + + if ((keystroke == 27 || oldselectedwin != + selectedwindow) && *findparent_ncurses) { + *findparent_ncurses = 0; + clkname_str[0] = '\0'; + } + + if (*findparent_ncurses && keystroke != 13) { + int len = strlen(clkname_str); + char str[2]; + + if (keystroke == 263) { + if (len > 0) + len--; + + clkname_str[len] = '\0'; + } else { + if (strlen(clkname_str) || + keystroke != '/') { + str[0] = keystroke; + str[1] = '\0'; + if (len < 63) + strcat(clkname_str, + str); + } + } + } + } + + keychar = toupper(keystroke); +//#define DEBUG +#ifdef DEBUG + killall_windows(1); fini_curses(); + printf("key entered %d:%c\n", keystroke, keychar); + exit(1); +#endif + + if (keystroke == 13) + *enter_hit = 1; + + if (keychar == 'Q' && !*findparent_ncurses) + return 1; + if (keychar == 'R') { + *refreshwin = 1; + options->ticktime = 3; + } else + *refreshwin = 0; + + return 0; +} + int mainloop(struct powerdebug_options *options) { int findparent_ncurses = 0, refreshwin = 0; @@ -250,82 +331,12 @@ int mainloop(struct powerdebug_options *options) tval.tv_usec = (options->ticktime - tval.tv_sec) * 1000000;
key = select(1, &readfds, NULL, NULL, &tval); + if (!key) + continue;
- if (key) { - char keychar; - int keystroke = getch(); - int oldselectedwin = selectedwindow; - - if (keystroke == EOF) - exit(0); - - if (keystroke == KEY_RIGHT || keystroke == 9) - selectedwindow++; - - if (keystroke == KEY_LEFT || keystroke == 353) - selectedwindow--; - - if (selectedwindow >= TOTAL_FEATURE_WINS) - selectedwindow = 0; - - if (selectedwindow < 0) - selectedwindow = TOTAL_FEATURE_WINS - 1; - - if (selectedwindow == CLOCK) { - if (keystroke == KEY_DOWN) - highlighted_row++; - if (keystroke == KEY_UP && highlighted_row > 0) - highlighted_row--; - if (keystroke == 47) - findparent_ncurses = 1; - - if ((keystroke == 27 || oldselectedwin != - selectedwindow) && findparent_ncurses) { - findparent_ncurses = 0; - clkname_str[0] = '\0'; - } - - if (findparent_ncurses && keystroke != 13) { - int len = strlen(clkname_str); - char str[2]; - - if (keystroke == 263) { - if (len > 0) - len--; - - clkname_str[len] = '\0'; - } else { - if (strlen(clkname_str) || - keystroke != '/') { - str[0] = keystroke; - str[1] = '\0'; - if (len < 63) - strcat(clkname_str, - str); - } - } - } - } - - keychar = toupper(keystroke); -//#define DEBUG -#ifdef DEBUG - killall_windows(1); fini_curses(); - printf("key entered %d:%c\n", keystroke, keychar); - exit(1); -#endif - - if (keystroke == 13) - enter_hit = 1; - - if (keychar == 'Q' && !findparent_ncurses) - break; - if (keychar == 'R') { - refreshwin = 1; - options->ticktime = 3; - } else - refreshwin = 0; - } + if (keystroke_callback(&enter_hit, &findparent_ncurses, + clkname_str, &refreshwin, options)) + break; }
return 0;
From: Daniel Lezcano dlezcano@fr.ibm.com
sizeof(int) : 4 sizeof(bool): 1
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- clocks.h | 1 - powerdebug.c | 50 ++++++++++++++++++++++++++------------------------ powerdebug.h | 2 +- regulator.h | 1 - 4 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/clocks.h b/clocks.h index b893efc..0fce60d 100644 --- a/clocks.h +++ b/clocks.h @@ -21,7 +21,6 @@ #include <linux/magic.h>
extern int maxy; -extern int dump;
#define MAX_LINES 120
diff --git a/powerdebug.c b/powerdebug.c index b9b1ac5..55b6bcf 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -15,9 +15,10 @@ *******************************************************************************/
#include <getopt.h> +#include <stdbool.h> #include "powerdebug.h"
-int dump; +bool dump = false; int highlighted_row; int selectedwindow = -1;
@@ -79,12 +80,12 @@ static struct option long_options[] = { };
struct powerdebug_options { - int findparent; - int verbose; - int regulators; - int sensors; - int clocks; - int ticktime; + bool verbose; + bool findparent; + bool regulators; + bool sensors; + bool clocks; + unsigned int ticktime; char *clkarg; };
@@ -105,19 +106,19 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options)
switch (c) { case 'r': - options->regulators = 1; + options->regulators = true; selectedwindow = REGULATOR; break; case 's': - options->sensors = 1; + options->sensors = true; selectedwindow = SENSOR; break; case 'c': - options->clocks = 1; + options->clocks = true; selectedwindow = CLOCK; break; case 'p': - options->findparent = 1; + options->findparent = true; options->clkarg = strdup(optarg); if (!options->clkarg) { fprintf(stderr, "failed to allocate memory"); @@ -128,10 +129,10 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) options->ticktime = atoi(optarg); break; case 'd': - dump = 1; + dump = true; break; case 'v': - options->verbose = 1; + options->verbose = true; break; case 'V': version(); @@ -147,7 +148,7 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) if (dump && !(options->regulators || options->clocks || options->sensors)) { /* By Default lets show everything we have */ - options->regulators = options->clocks = options->sensors = 1; + options->regulators = options->clocks = options->sensors = true; }
if (options->findparent && (!options->clocks || !dump)) { @@ -162,8 +163,8 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) return 0; }
-int keystroke_callback(int *enter_hit, int *findparent_ncurses, - char *clkname_str, int *refreshwin, +int keystroke_callback(bool *enter_hit, bool *findparent_ncurses, + char *clkname_str, bool *refreshwin, struct powerdebug_options *options) { char keychar; @@ -191,11 +192,11 @@ int keystroke_callback(int *enter_hit, int *findparent_ncurses, if (keystroke == KEY_UP && highlighted_row > 0) highlighted_row--; if (keystroke == 47) - *findparent_ncurses = 1; + *findparent_ncurses = true;
if ((keystroke == 27 || oldselectedwin != selectedwindow) && *findparent_ncurses) { - *findparent_ncurses = 0; + *findparent_ncurses = false; clkname_str[0] = '\0'; }
@@ -230,23 +231,24 @@ int keystroke_callback(int *enter_hit, int *findparent_ncurses, #endif
if (keystroke == 13) - *enter_hit = 1; + *enter_hit = true;
if (keychar == 'Q' && !*findparent_ncurses) return 1; if (keychar == 'R') { - *refreshwin = 1; + *refreshwin = true; options->ticktime = 3; } else - *refreshwin = 0; + *refreshwin = false;
return 0; }
int mainloop(struct powerdebug_options *options) { - int findparent_ncurses = 0, refreshwin = 0; - int enter_hit = 0; + bool findparent_ncurses = false; + bool refreshwin = false; + bool enter_hit = false; int firsttime[TOTAL_FEATURE_WINS]; int i; char clkname_str[64]; @@ -301,7 +303,7 @@ int mainloop(struct powerdebug_options *options) highlighted_row, command); highlighted_row = hrow; - enter_hit = 0; + enter_hit = false; } else find_parents_for_clock(clkname_str, enter_hit); diff --git a/powerdebug.h b/powerdebug.h index e194025..5bf7084 100644 --- a/powerdebug.h +++ b/powerdebug.h @@ -35,7 +35,7 @@ extern char *win_names[TOTAL_FEATURE_WINS]; extern int selectedwindow;
extern int numregulators; -extern int dump; +extern bool dump; extern double ticktime;
extern void version(void); diff --git a/regulator.h b/regulator.h index 91e01d8..902d05b 100644 --- a/regulator.h +++ b/regulator.h @@ -42,4 +42,3 @@ struct regulator_info { } *regulators_info;
extern int numregulators; -extern int dump;
From: Daniel Lezcano dlezcano@fr.ibm.com
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- powerdebug.h | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/powerdebug.h b/powerdebug.h index 5bf7084..f23bbba 100644 --- a/powerdebug.h +++ b/powerdebug.h @@ -36,9 +36,6 @@ extern int selectedwindow;
extern int numregulators; extern bool dump; -extern double ticktime; - -extern void version(void);
extern int init_regulator_ds(void); extern void print_regulator_info(int verbose);
From: Daniel Lezcano dlezcano@fr.ibm.com
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- display.c | 5 +++++ powerdebug.c | 5 ----- powerdebug.h | 1 - 3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/display.c b/display.c index 5cdf78a..fbdce80 100644 --- a/display.c +++ b/display.c @@ -31,6 +31,11 @@ static WINDOW *footer_win; int maxx, maxy; char footer_items[NUM_FOOTER_ITEMS][64];
+static char *win_names[TOTAL_FEATURE_WINS] = { + "Regulators", + "Clocks", + "Sensors" +};
void fini_curses(void) { endwin(); diff --git a/powerdebug.c b/powerdebug.c index 55b6bcf..37225a6 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -22,11 +22,6 @@ bool dump = false; int highlighted_row; int selectedwindow = -1;
-char *win_names[TOTAL_FEATURE_WINS] = { - "Regulators", - "Clocks", - "Sensors" }; - void usage(void) { printf("Usage: powerdebug [OPTIONS]\n"); diff --git a/powerdebug.h b/powerdebug.h index f23bbba..a8e7de2 100644 --- a/powerdebug.h +++ b/powerdebug.h @@ -31,7 +31,6 @@ enum {CLOCK_SELECTED = 1, REFRESH_WINDOW};
extern struct regulator_info *regulators_info;
-extern char *win_names[TOTAL_FEATURE_WINS]; extern int selectedwindow;
extern int numregulators;
From: Daniel Lezcano dlezcano@fr.ibm.com
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- clocks.c | 142 +++++++++++++++++++++++++++++----------------------------- clocks.h | 1 - powerdebug.c | 8 ++-- powerdebug.h | 7 +-- 4 files changed, 78 insertions(+), 80 deletions(-)
diff --git a/clocks.c b/clocks.c index 17d4f6a..4fe8093 100644 --- a/clocks.c +++ b/clocks.c @@ -21,7 +21,7 @@ static char clk_dir_path[PATH_MAX]; static char clk_name[NAME_MAX]; static int bold[MAX_LINES];
-int init_clock_details(void) +int init_clock_details(bool dump) { char *path = debugfs_locate_mpoint(); struct stat buf; @@ -81,7 +81,73 @@ int get_int_from(char *file) return atoi(result); }
-void find_parents_for_clock(char *clkname, int complete) +static void dump_parent(struct clock_info *clk, int line, bool dump) +{ + char *unit = "Hz"; + double drate; + static char spaces[64]; + char str[256]; + static int maxline; + + if (maxline < line) + maxline = line; + + if (clk && clk->parent) + dump_parent(clk->parent, ++line, dump); + + drate = (double)clk->rate; + if (drate > 1000 && drate < 1000000) { + unit = "KHz"; + drate /= 1000; + } + if (drate > 1000000) { + unit = "MHz"; + drate /= 1000000; + } + if (clk == clocks_info) { + line++; + strcpy(spaces, ""); + sprintf(str, "%s%s (flags:%d,usecount:%d,rate:%5.2f %s)\n", + spaces, clk->name, clk->flags, clk->usecount, drate, + unit); + } else { + if (!(clk->parent == clocks_info)) + strcat(spaces, " "); + sprintf(str, "%s`- %s (flags:%d,usecount:%d,rate:%5.2f %s)\n", + spaces, clk->name, clk->flags, clk->usecount, drate, + unit); + } + if (dump) + //printf("line=%d:m%d:l%d %s", maxline - line + 2, maxline, line, str); + printf("%s", str); + else + print_one_clock(maxline - line + 2, str, 1, 0); +} + +static void dump_all_parents(char *clkarg, bool dump) +{ + struct clock_info *clk; + char spaces[1024]; + + strcpy(spaces, ""); + + clk = find_clock(clocks_info, clkarg); + + if (!clk) + printf("Clock NOT found!\n"); + else { + /* while(clk && clk != clocks_info) { */ + /* printf("%s\n", clk->name); */ + /* strcat(spaces, " "); */ + /* clk = clk->parent; */ + /* printf("%s <-- ", spaces); */ + /* } */ + /* printf(" /\n"); */ + dump_parent(clk, 1, dump); + } +} + +void find_parents_for_clock(char *clkname, int complete, bool dump) { char name[256];
@@ -96,7 +162,7 @@ void find_parents_for_clock(char *clkname, int complete) } sprintf(name, "Parents for "%s" Clock : \n", clkname); print_one_clock(0, name, 1, 1); - dump_all_parents(clkname); + dump_all_parents(clkname, dump); }
int read_and_print_clock_info(int verbose, int hrow, int selected) @@ -262,11 +328,11 @@ void destroy_clocks_info_recur(struct clock_info *clock) } }
-void read_and_dump_clock_info_one(char *clk) +void read_and_dump_clock_info_one(char *clk, bool dump) { printf("\nParents for "%s" Clock :\n\n", clk); read_clock_info(clk_dir_path); - dump_all_parents(clk); + dump_all_parents(clk, dump); printf("\n\n"); }
@@ -396,72 +462,6 @@ void insert_children(struct clock_info **parent, struct clock_info *clk) (*parent)->num_children++; }
-void dump_parent(struct clock_info *clk, int line) -{ - char *unit = "Hz"; - double drate; - static char spaces[64]; - char str[256]; - static int maxline; - - if (maxline < line) - maxline = line; - - if (clk && clk->parent) - dump_parent(clk->parent, ++line); - - drate = (double)clk->rate; - if (drate > 1000 && drate < 1000000) { - unit = "KHz"; - drate /= 1000; - } - if (drate > 1000000) { - unit = "MHz"; - drate /= 1000000; - } - if (clk == clocks_info) { - line++; - strcpy(spaces, ""); - sprintf(str, "%s%s (flags:%d,usecount:%d,rate:%5.2f %s)\n", - spaces, clk->name, clk->flags, clk->usecount, drate, - unit); - } else { - if (!(clk->parent == clocks_info)) - strcat(spaces, " "); - sprintf(str, "%s`- %s (flags:%d,usecount:%d,rate:%5.2f %s)\n", - spaces, clk->name, clk->flags, clk->usecount, drate, - unit); - } - if (dump) - //printf("line=%d:m%d:l%d %s", maxline - line + 2, maxline, line, str); - printf("%s", str); - else - print_one_clock(maxline - line + 2, str, 1, 0); -} - -void dump_all_parents(char *clkarg) -{ - struct clock_info *clk; - char spaces[1024]; - - strcpy(spaces, ""); - - clk = find_clock(clocks_info, clkarg); - - if (!clk) - printf("Clock NOT found!\n"); - else { -// while(clk && clk != clocks_info) { -// printf("%s\n", clk->name); -// strcat(spaces, " "); -// clk = clk->parent; -// printf("%s <-- ", spaces); -// } -// printf(" /\n"); - dump_parent(clk, 1); - } -} - struct clock_info *find_clock(struct clock_info *clk, char *clkarg) { int i; diff --git a/clocks.h b/clocks.h index 0fce60d..b8a100b 100644 --- a/clocks.h +++ b/clocks.h @@ -52,5 +52,4 @@ void add_clock_details_recur(struct clock_info *clk, int hrow, int selected); void destroy_clocks_info(void); void destroy_clocks_info_recur(struct clock_info *clock); void collapse_all_subclocks(struct clock_info *clock); -void dump_all_parents(char *clkarg); struct clock_info *find_clock(struct clock_info *clk, char *clkarg); diff --git a/powerdebug.c b/powerdebug.c index 37225a6..2f3a77d 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -18,7 +18,7 @@ #include <stdbool.h> #include "powerdebug.h"
-bool dump = false; +static bool dump = false; int highlighted_row; int selectedwindow = -1;
@@ -277,7 +277,7 @@ int mainloop(struct powerdebug_options *options) if (options->clocks || selectedwindow == CLOCK) { int ret = 0; if (firsttime[CLOCK]) { - ret = init_clock_details(); + ret = init_clock_details(dump); if (!ret) firsttime[CLOCK] = 0; strcpy(clkname_str, ""); @@ -301,11 +301,11 @@ int mainloop(struct powerdebug_options *options) enter_hit = false; } else find_parents_for_clock(clkname_str, - enter_hit); + enter_hit, dump); } if (!ret && dump) { if (options->findparent) - read_and_dump_clock_info_one(options->clkarg); + read_and_dump_clock_info_one(options->clkarg, dump); else read_and_dump_clock_info(options->verbose); } diff --git a/powerdebug.h b/powerdebug.h index a8e7de2..f6358e0 100644 --- a/powerdebug.h +++ b/powerdebug.h @@ -34,7 +34,6 @@ extern struct regulator_info *regulators_info; extern int selectedwindow;
extern int numregulators; -extern bool dump;
extern int init_regulator_ds(void); extern void print_regulator_info(int verbose); @@ -42,17 +41,17 @@ extern void read_regulator_info(void); extern void print_regulator_info(int verbose);
extern void read_and_dump_clock_info(int verbose); -extern void read_and_dump_clock_info_one(char *clk); +extern void read_and_dump_clock_info_one(char *clk, bool dump); extern void read_clock_info(char *clkpath); extern struct clock_info *read_clock_info_recur(char *clkpath, int level, struct clock_info *parent); extern void dump_clock_info(struct clock_info *clk, int level, int bmp); extern void insert_children(struct clock_info **parent, struct clock_info *clk); -extern void find_parents_for_clock(char *clkname, int complete); +extern void find_parents_for_clock(char *clkname, int complete, bool dump); extern int read_and_print_clock_info(int verbose, int hrow, int selected); extern void print_clock_info(int verbose, int hrow, int selected); extern void print_string_val(char *name, char *val); -extern int init_clock_details(void); +extern int init_clock_details(bool dump); extern void print_clock_header(void); extern void print_one_clock(int line, char *str, int bold, int highlight); extern char *debugfs_locate_mpoint(void);
Signed-off-by: Daniel Lezcano daniel.lezcano@free.fr --- powerdebug.c | 29 +++++++++++++++-------------- 1 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/powerdebug.c b/powerdebug.c index 2f3a77d..db19e16 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -18,7 +18,6 @@ #include <stdbool.h> #include "powerdebug.h"
-static bool dump = false; int highlighted_row; int selectedwindow = -1;
@@ -80,6 +79,7 @@ struct powerdebug_options { bool regulators; bool sensors; bool clocks; + bool dump; unsigned int ticktime; char *clkarg; }; @@ -124,7 +124,7 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) options->ticktime = atoi(optarg); break; case 'd': - dump = true; + options->dump = true; break; case 'v': options->verbose = true; @@ -140,19 +140,19 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) } }
- if (dump && !(options->regulators || + if (options->dump && !(options->regulators || options->clocks || options->sensors)) { /* By Default lets show everything we have */ options->regulators = options->clocks = options->sensors = true; }
- if (options->findparent && (!options->clocks || !dump)) { + if (options->findparent && (!options->clocks || !options->dump)) { fprintf(stderr, "-p option passed without -c and -d." " Exiting...\n"); return -1; }
- if (!dump && selectedwindow == -1) + if (!options->dump && selectedwindow == -1) selectedwindow = REGULATOR;
return 0; @@ -256,7 +256,7 @@ int mainloop(struct powerdebug_options *options) struct timeval tval; fd_set readfds;
- if (!dump) { + if (!options->dump) { if(firsttime[0]) init_curses(); create_windows(); @@ -266,7 +266,7 @@ int mainloop(struct powerdebug_options *options) if (options->regulators || selectedwindow == REGULATOR) { read_regulator_info(); - if (!dump) { + if (!options->dump) { create_selectedwindow(); show_regulator_info(options->verbose); } @@ -277,12 +277,12 @@ int mainloop(struct powerdebug_options *options) if (options->clocks || selectedwindow == CLOCK) { int ret = 0; if (firsttime[CLOCK]) { - ret = init_clock_details(dump); + ret = init_clock_details(options->dump); if (!ret) firsttime[CLOCK] = 0; strcpy(clkname_str, ""); } - if (!ret && !dump) { + if (!ret && !options->dump) { int hrow;
create_selectedwindow(); @@ -301,25 +301,26 @@ int mainloop(struct powerdebug_options *options) enter_hit = false; } else find_parents_for_clock(clkname_str, - enter_hit, dump); + enter_hit, + options->dump); } - if (!ret && dump) { + if (!ret && options->dump) { if (options->findparent) - read_and_dump_clock_info_one(options->clkarg, dump); + read_and_dump_clock_info_one(options->clkarg, options->dump); else read_and_dump_clock_info(options->verbose); } }
if (options->sensors || selectedwindow == SENSOR) { - if (!dump) { + if (!options->dump) { create_selectedwindow(); print_sensor_header(); } else read_and_print_sensor_info(options->verbose); }
- if (dump) + if (options->dump) break;
FD_ZERO(&readfds);
From: Daniel Lezcano dlezcano@fr.ibm.com
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com --- clocks.c | 6 +++--- display.c | 6 +++--- powerdebug.c | 50 ++++++++++++++++++++++++++------------------------ powerdebug.h | 10 ++++------ 4 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/clocks.c b/clocks.c index 4fe8093..2f1f2e6 100644 --- a/clocks.c +++ b/clocks.c @@ -21,7 +21,7 @@ static char clk_dir_path[PATH_MAX]; static char clk_name[NAME_MAX]; static int bold[MAX_LINES];
-int init_clock_details(bool dump) +int init_clock_details(bool dump, int selectedwindow) { char *path = debugfs_locate_mpoint(); struct stat buf; @@ -30,7 +30,7 @@ int init_clock_details(bool dump) strcpy(clk_dir_path, path); else { if (!dump) { - create_selectedwindow(); + create_selectedwindow(selectedwindow); sprintf(clock_lines[0], "Unable to locate debugfs " "mount point. Mount debugfs " "and try again..\n"); @@ -48,7 +48,7 @@ int init_clock_details(bool dump) //strcpy(clk_dir_path, "/debug/clock"); // Hardcoded for testing.. if (stat(clk_dir_path, &buf)) { if (!dump) { - create_selectedwindow(); + create_selectedwindow(selectedwindow); sprintf(clock_lines[0], "Unable to find clock tree" " information at %s.\n", clk_dir_path); print_one_clock(0, clock_lines[0], 1, 0); diff --git a/display.c b/display.c index fbdce80..dfd119a 100644 --- a/display.c +++ b/display.c @@ -90,7 +90,7 @@ void init_curses(void) }
-void create_windows(void) +void create_windows(int selectedwindow) {
getmaxyx(stdscr, maxy, maxx); @@ -115,7 +115,7 @@ void create_windows(void)
}
-void create_selectedwindow(void) +void create_selectedwindow(int selectedwindow) { WINDOW *win;
@@ -141,7 +141,7 @@ void create_selectedwindow(void) refresh(); }
-void show_header(void) +void show_header(int selectedwindow) { int i, j = 0;
diff --git a/powerdebug.c b/powerdebug.c index db19e16..64c8853 100644 --- a/powerdebug.c +++ b/powerdebug.c @@ -19,7 +19,6 @@ #include "powerdebug.h"
int highlighted_row; -int selectedwindow = -1;
void usage(void) { @@ -81,6 +80,7 @@ struct powerdebug_options { bool clocks; bool dump; unsigned int ticktime; + int selectedwindow; char *clkarg; };
@@ -90,6 +90,7 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options)
memset(options, 0, sizeof(*options)); options->ticktime = 10; + options->selectedwindow = -1;
while (1) { int optindex = 0; @@ -102,15 +103,15 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) switch (c) { case 'r': options->regulators = true; - selectedwindow = REGULATOR; + options->selectedwindow = REGULATOR; break; case 's': options->sensors = true; - selectedwindow = SENSOR; + options->selectedwindow = SENSOR; break; case 'c': options->clocks = true; - selectedwindow = CLOCK; + options->selectedwindow = CLOCK; break; case 'p': options->findparent = true; @@ -152,8 +153,8 @@ int getoptions(int argc, char *argv[], struct powerdebug_options *options) return -1; }
- if (!options->dump && selectedwindow == -1) - selectedwindow = REGULATOR; + if (!options->dump && options->selectedwindow == -1) + options->selectedwindow = REGULATOR;
return 0; } @@ -164,24 +165,24 @@ int keystroke_callback(bool *enter_hit, bool *findparent_ncurses, { char keychar; int keystroke = getch(); - int oldselectedwin = selectedwindow; + int oldselectedwin = options->selectedwindow;
if (keystroke == EOF) exit(0);
if (keystroke == KEY_RIGHT || keystroke == 9) - selectedwindow++; + options->selectedwindow++;
if (keystroke == KEY_LEFT || keystroke == 353) - selectedwindow--; + options->selectedwindow--;
- if (selectedwindow >= TOTAL_FEATURE_WINS) - selectedwindow = 0; + if (options->selectedwindow >= TOTAL_FEATURE_WINS) + options->selectedwindow = 0;
- if (selectedwindow < 0) - selectedwindow = TOTAL_FEATURE_WINS - 1; + if (options->selectedwindow < 0) + options->selectedwindow = TOTAL_FEATURE_WINS - 1;
- if (selectedwindow == CLOCK) { + if (options->selectedwindow == CLOCK) { if (keystroke == KEY_DOWN) highlighted_row++; if (keystroke == KEY_UP && highlighted_row > 0) @@ -190,7 +191,7 @@ int keystroke_callback(bool *enter_hit, bool *findparent_ncurses, *findparent_ncurses = true;
if ((keystroke == 27 || oldselectedwin != - selectedwindow) && *findparent_ncurses) { + options->selectedwindow) && *findparent_ncurses) { *findparent_ncurses = false; clkname_str[0] = '\0'; } @@ -259,25 +260,26 @@ int mainloop(struct powerdebug_options *options) if (!options->dump) { if(firsttime[0]) init_curses(); - create_windows(); - show_header(); + create_windows(options->selectedwindow); + show_header(options->selectedwindow); }
- if (options->regulators || selectedwindow == REGULATOR) { + if (options->regulators || options->selectedwindow == REGULATOR) { read_regulator_info(); if (!options->dump) { - create_selectedwindow(); + create_selectedwindow(options->selectedwindow); show_regulator_info(options->verbose); } else print_regulator_info(options->verbose); }
- if (options->clocks || selectedwindow == CLOCK) { + if (options->clocks || options->selectedwindow == CLOCK) { int ret = 0; if (firsttime[CLOCK]) { - ret = init_clock_details(options->dump); + ret = init_clock_details(options->dump, + options->selectedwindow); if (!ret) firsttime[CLOCK] = 0; strcpy(clkname_str, ""); @@ -285,7 +287,7 @@ int mainloop(struct powerdebug_options *options) if (!ret && !options->dump) { int hrow;
- create_selectedwindow(); + create_selectedwindow(options->selectedwindow); if (!findparent_ncurses) { int command = 0;
@@ -312,9 +314,9 @@ int mainloop(struct powerdebug_options *options) } }
- if (options->sensors || selectedwindow == SENSOR) { + if (options->sensors || options->selectedwindow == SENSOR) { if (!options->dump) { - create_selectedwindow(); + create_selectedwindow(options->selectedwindow); print_sensor_header(); } else read_and_print_sensor_info(options->verbose); diff --git a/powerdebug.h b/powerdebug.h index f6358e0..44c1d63 100644 --- a/powerdebug.h +++ b/powerdebug.h @@ -31,8 +31,6 @@ enum {CLOCK_SELECTED = 1, REFRESH_WINDOW};
extern struct regulator_info *regulators_info;
-extern int selectedwindow; - extern int numregulators;
extern int init_regulator_ds(void); @@ -51,7 +49,7 @@ extern void find_parents_for_clock(char *clkname, int complete, bool dump); extern int read_and_print_clock_info(int verbose, int hrow, int selected); extern void print_clock_info(int verbose, int hrow, int selected); extern void print_string_val(char *name, char *val); -extern int init_clock_details(bool dump); +extern int init_clock_details(bool dump, int selectedwindow); extern void print_clock_header(void); extern void print_one_clock(int line, char *str, int bold, int highlight); extern char *debugfs_locate_mpoint(void); @@ -63,7 +61,7 @@ extern void print_sensor_header(void); extern void init_curses(void); extern void fini_curses(void); extern void killall_windows(int all); -extern void show_header(void); -extern void create_windows(void); -extern void create_selectedwindow(void); +extern void show_header(int selectedwindow); +extern void create_windows(int selectedwindow); +extern void create_selectedwindow(int selectedwindow); extern void show_regulator_info(int verbose);
Remove the Makefile to put in place the next patch where it is generated
Signed-off-by: Daniel Lezcano daniel.lezcano@free.fr --- Makefile | 29 ----------------------------- 1 files changed, 0 insertions(+), 29 deletions(-) delete mode 100644 Makefile
diff --git a/Makefile b/Makefile deleted file mode 100644 index 8b36a2f..0000000 --- a/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -BINDIR=/usr/bin -MANDIR=/usr/share/man/man8 - -WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int -CFLAGS?=-O1 -g ${WARNFLAGS} -CC?=gcc - -OBJS = powerdebug.o sensor.o clocks.o regulator.o display.o - -default: powerdebug - -powerdebug.8.gz: powerdebug.8 - gzip -c $< > $@ - -powerdebug: $(OBJS) powerdebug.h - $(CC) ${CFLAGS} $(OBJS) -lncurses -o powerdebug - -install: powerdebug powerdebug.8.gz - mkdir -p ${DESTDIR}${BINDIR} - cp powerdebug ${DESTDIR}${BINDIR} - mkdir -p ${DESTDIR}${MANDIR} - cp powerdebug.8.gz ${DESTDIR}${MANDIR} - -All: install - -all: powerdebug powerdebug.8.gz - -clean: - rm -f powerdebug *.o powerdebug.8.gz
Signed-off-by: Daniel Lezcano daniel.lezcano@free.fr --- AUTHORS | 1 + ChangeLog | 1 + Makefile.am | 13 +++++++++++++ NEWS | 1 + autogen.sh | 9 +++++++++ configure.ac | 26 ++++++++++++++++++++++++++ 6 files changed, 51 insertions(+), 0 deletions(-) create mode 100644 AUTHORS create mode 100644 ChangeLog create mode 100644 Makefile.am create mode 100644 NEWS create mode 100644 autogen.sh create mode 100644 configure.ac
diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..62deb04 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +AUTHORS diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..56631ab --- /dev/null +++ b/ChangeLog @@ -0,0 +1 @@ +ChangeLog diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..55ed40d --- /dev/null +++ b/Makefile.am @@ -0,0 +1,13 @@ +pkginclude_HEADERS = + +bin_PROGRAMS = powerdebug + +LDADD = -lncurses +AM_LDFLAGS=-static + +powerdebug_SOURCES = \ + powerdebug.c \ + clocks.c \ + display.c \ + regulator.c \ + sensor.c diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..edc0071 --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ +NEWS diff --git a/autogen.sh b/autogen.sh new file mode 100644 index 0000000..8ff08f9 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -x + +test -d autom4te.cache && rm -rf autom4te.cache +aclocal -I config || exit 1 +autoheader || exit 1 +autoconf || exit 1 +automake --add-missing --copy || exit diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..0be8887 --- /dev/null +++ b/configure.ac @@ -0,0 +1,26 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_INIT([powerdebug], [1.0.0]) + +AC_CONFIG_SRCDIR([configure.ac]) +AC_CONFIG_AUX_DIR([config]) +AM_CONFIG_HEADER([config.h]) +AM_INIT_AUTOMAKE([]) +AC_CANONICAL_HOST +AM_PROG_CC_C_O +AC_GNU_SOURCE + +AC_CHECK_HEADERS([ncurses.h], [], AC_MSG_ERROR([please install libncurses-dev.]), +[#include <ncurses.h>]) +AC_PROG_GCC_TRADITIONAL + +if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -Wall" +fi + +AC_CONFIG_FILES([ + Makefile +]) +AC_CONFIG_COMMANDS([default],[[]],[[]]) +AC_OUTPUT
On Tue, Mar 22, 2011 at 1:40 PM, Daniel Lezcano daniel.lezcano@free.fr wrote:
From: Daniel Lezcano dlezcano@fr.ibm.com
Create a single structure for powerdebug options.
Signed-off-by: Daniel Lezcano dlezcano@fr.ibm.com
Hi Daniel,
Thanks for this work. Much appreciated.
Your first patch doesn't apply cleanly. Have you generated it against the master branch of http://git.linaro.org/gitweb?p=tools/powerdebug.git%3Ba=summary ?
$ patchtry < /tmp/powerdebug/0001 patching file powerdebug.c Hunk #1 succeeded at 19 with fuzz 1 (offset -1 lines). Hunk #2 FAILED at 44. Hunk #3 FAILED at 172. Hunk #4 FAILED at 202. Hunk #5 succeeded at 211 with fuzz 1 (offset -1 lines). Hunk #6 succeeded at 231 (offset -1 lines). Hunk #7 succeeded at 307 (offset -1 lines). 3 out of 7 hunks FAILED -- saving rejects to file powerdebug.c.rej ^C
On 03/23/2011 12:37 PM, Amit Kucheria wrote:
On Tue, Mar 22, 2011 at 1:40 PM, Daniel Lezcanodaniel.lezcano@free.fr wrote:
From: Daniel Lezcanodlezcano@fr.ibm.com
Create a single structure for powerdebug options.
Signed-off-by: Daniel Lezcanodlezcano@fr.ibm.com
Hi Daniel,
Thanks for this work. Much appreciated.
Your first patch doesn't apply cleanly. Have you generated it against the master branch of http://git.linaro.org/gitweb?p=tools/powerdebug.git%3Ba=summary ?
$ patchtry< /tmp/powerdebug/0001 patching file powerdebug.c Hunk #1 succeeded at 19 with fuzz 1 (offset -1 lines). Hunk #2 FAILED at 44. Hunk #3 FAILED at 172. Hunk #4 FAILED at 202. Hunk #5 succeeded at 211 with fuzz 1 (offset -1 lines). Hunk #6 succeeded at 231 (offset -1 lines). Hunk #7 succeeded at 307 (offset -1 lines). 3 out of 7 hunks FAILED -- saving rejects to file powerdebug.c.rej ^C
Oops, no. It is against git://git.linaro.org/people/amitarora/powerdebug.git I will respin the patchset and resend.
On Wed, Mar 23, 2011 at 1:53 PM, Daniel Lezcano daniel.lezcano@free.fr wrote:
On 03/23/2011 12:37 PM, Amit Kucheria wrote:
On Tue, Mar 22, 2011 at 1:40 PM, Daniel Lezcanodaniel.lezcano@free.fr wrote:
From: Daniel Lezcanodlezcano@fr.ibm.com
Create a single structure for powerdebug options.
Signed-off-by: Daniel Lezcanodlezcano@fr.ibm.com
Hi Daniel,
Thanks for this work. Much appreciated.
Your first patch doesn't apply cleanly. Have you generated it against the master branch of http://git.linaro.org/gitweb?p=tools/powerdebug.git%3Ba=summary ?
$ patchtry< /tmp/powerdebug/0001 patching file powerdebug.c Hunk #1 succeeded at 19 with fuzz 1 (offset -1 lines). Hunk #2 FAILED at 44. Hunk #3 FAILED at 172. Hunk #4 FAILED at 202. Hunk #5 succeeded at 211 with fuzz 1 (offset -1 lines). Hunk #6 succeeded at 231 (offset -1 lines). Hunk #7 succeeded at 307 (offset -1 lines). 3 out of 7 hunks FAILED -- saving rejects to file powerdebug.c.rej ^C
Oops, no. It is against git://git.linaro.org/people/amitarora/powerdebug.git I will respin the patchset and resend.
Daniel,
My bad. I'll see if we can move the other tree from git.linaro.org to some archive and avoid confusion since Amit Arora doesn't work on powerdebug anymore.
Regards, Amit