By default show all data in dump mode
diff --git a/clocks.c b/clocks.c
index b6f1162..17d4f6a 100644
--- a/clocks.c
+++ b/clocks.c
@@ -267,15 +267,17 @@
printf("\nParents for \"%s\" Clock :\n\n", clk);
read_clock_info(clk_dir_path);
dump_all_parents(clk);
+ printf("\n\n");
}
void read_and_dump_clock_info(int verbose)
{
(void)verbose;
- printf("Clock Tree :\n");
+ printf("\nClock Tree :\n");
printf("**********\n");
read_clock_info(clk_dir_path);
dump_clock_info(clocks_info, 1, 1);
+ printf("\n\n");
}
void read_clock_info(char *clkpath)
diff --git a/powerdebug.c b/powerdebug.c
index 3be47e1..0b405c0 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -28,16 +28,22 @@
"Clocks",
"Sensors" };
-void usage(char **argv)
+void usage(void)
{
- printf("Usage: %s [OPTIONS]\n", argv[0]);
+ printf("Usage: powerdebug [OPTIONS]\n");
+ printf("\n");
+ printf("powerdebug -d [ -r ] [ -s ] [ -c [ -p <clock-name> ] ] "
+ "[ -v ]\n");
+ printf("powerdebug [ -r | -s | -c ]\n");
printf(" -r, --regulator Show regulator information\n");
printf(" -s, --sensor Show sensor information\n");
printf(" -c, --clock Show clock information\n");
- printf(" -p, --findparents Show all parents for a particular clock\n");
+ printf(" -p, --findparents Show all parents for a particular"
+ " clock\n");
printf(" -t, --time Set ticktime in seconds (eg. 10.0)\n");
printf(" -d, --dump Dump information once (no refresh)\n");
- printf(" -v, --verbose Verbose mode (use with -r and/or -s)\n");
+ printf(" -v, --verbose Verbose mode (use with -r and/or"
+ " -s)\n");
printf(" -V, --version Show Version\n");
printf(" -h, --help Help\n");
@@ -124,34 +130,30 @@
version();
break;
case 'h':
- usage(argv);
+ usage();
break;
case '?':
fprintf (stderr, "%s: Unknown option %c'.\n",
argv[0], optopt);
exit(1);
default:
- usage(argv);
+ usage();
break;
}
}
-/*
- if (!dump && (regulators || clocks || sensors)) {
- fprintf(stderr, "Option supported only in dump mode (-d)\n");
- usage(argv);
- }
-*/
if (dump && !(regulators || clocks || sensors)) {
- fprintf(stderr, "Dump mode (-d) supported only with -c, -r "
- "or -s ..\n");
- usage(argv);
+ //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 (findparent && (!clocks || !dump)) {
fprintf(stderr, "-p option passed without -c and -d."
" Exiting...\n");
- usage(argv);
+ usage();
}
if (!dump && selectedwindow == -1)
@@ -172,7 +174,7 @@
}
- if (selectedwindow == REGULATOR) {
+ if (regulators || selectedwindow == REGULATOR) {
read_regulator_info();
if (!dump) {
create_selectedwindow();
@@ -182,7 +184,7 @@
print_regulator_info(verbose);
}
- if (selectedwindow == CLOCK) {
+ if (clocks || selectedwindow == CLOCK) {
int ret = 0;
if (firsttime[CLOCK]) {
ret = init_clock_details();
@@ -219,7 +221,7 @@
}
}
- if (selectedwindow == SENSOR) {
+ if (sensors || selectedwindow == SENSOR) {
if (!dump) {
create_selectedwindow();
print_sensor_header();
diff --git a/powerdebug.h b/powerdebug.h
index bbd90fd..f351ff2 100644
--- a/powerdebug.h
+++ b/powerdebug.h
@@ -38,7 +38,6 @@
extern int dump;
extern double ticktime;
-extern void usage(char **argv);
extern void version(void);
extern void print_regulator_info(int verbose);
diff --git a/regulator.c b/regulator.c
index 56b0b06..5936e21 100644
--- a/regulator.c
+++ b/regulator.c
@@ -54,6 +54,9 @@
{
int i;
+ printf("\nRegulator Information:\n");
+ printf("*********************\n\n");
+
for (i=0; i<numregulators; i++) {
printf("Regulator %d:\n", i+1);
print_string_val("name", regulators_info[i].name);
@@ -103,6 +106,8 @@
printf("Could not find regulator information!");
printf(" Looks like /sys/class/regulator is empty.\n\n");
}
+
+ printf("\n\n");
}
void read_info_from_dirent(struct dirent *ritem, char *str, int idx)
diff --git a/regulator.h b/regulator.h
index 8e32b6d..c8aac5e 100644
--- a/regulator.h
+++ b/regulator.h
@@ -41,15 +41,3 @@
extern int numregulators;
extern int dump;
-
-/*extern void usage(char **argv);
-extern void print_regulator_info(int verbose);
-
-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_regulator_info(int verbose);
-*/
diff --git a/sensor.c b/sensor.c
index 050a2d1..0fb5759 100644
--- a/sensor.c
+++ b/sensor.c
@@ -108,6 +108,9 @@
char device[PATH_MAX];
struct dirent *item, *subitem;
+ printf("\nSensor Information:\n");
+ printf("******************\n");
+
sprintf(filename, "%s", "/sys/class/hwmon");
dir = opendir(filename);
if (!dir)
@@ -162,5 +165,7 @@
printf(" Looks like /sys/class/hwmon is empty.\n");
}
+ printf("\n");
+
return 0;
}