summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/powertop/powertop.c11
-rw-r--r--usr/src/cmd/powertop/powertop.h5
-rw-r--r--usr/src/cmd/powertop/util.c8
3 files changed, 15 insertions, 9 deletions
diff --git a/usr/src/cmd/powertop/powertop.c b/usr/src/cmd/powertop/powertop.c
index f406739026..6f67954de8 100644
--- a/usr/src/cmd/powertop/powertop.c
+++ b/usr/src/cmd/powertop/powertop.c
@@ -1,6 +1,6 @@
/*
- * Copyright 2008, Intel Corporation
- * Copyright 2008, Sun Microsystems, Inc
+ * Copyright 2009, Intel Corporation
+ * Copyright 2009, Sun Microsystems, Inc
*
* This file is part of PowerTOP
*
@@ -49,6 +49,7 @@
int g_ncpus;
processorid_t *cpu_table;
const int true = 1;
+boolean_t gui;
int
main(int argc, char **argv)
@@ -79,6 +80,7 @@ main(int argc, char **argv)
ticktime = ticktime_usr = INTERVAL_DEFAULT;
displaytime = 0.0;
dump = 0;
+ gui = B_FALSE;
event_mode = ' ';
max_cstate = 0;
g_turbo_supported = B_FALSE;
@@ -127,7 +129,7 @@ main(int argc, char **argv)
usage();
}
- (void) printf("%s (C) 2008 Intel Corporation\n\n", TITLE);
+ (void) printf("%s (C) 2009 Intel Corporation\n\n", TITLE);
/*
* Enumerate the system's CPUs
@@ -168,6 +170,9 @@ main(int argc, char **argv)
(void) printf(_("Collecting data for %.2f second(s) \n"),
(float)ticktime);
+ if (!dump)
+ gui = B_TRUE;
+
last = gethrtime();
while (true) {
diff --git a/usr/src/cmd/powertop/powertop.h b/usr/src/cmd/powertop/powertop.h
index f02f8246a7..464e114fc5 100644
--- a/usr/src/cmd/powertop/powertop.h
+++ b/usr/src/cmd/powertop/powertop.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2008, Intel Corporation
- * Copyright 2008, Sun Microsystems, Inc
+ * Copyright 2009, Intel Corporation
+ * Copyright 2009, Sun Microsystems, Inc
*
* This file is part of PowerTOP
*
@@ -168,6 +168,7 @@ double g_interval;
*/
int dump;
char event_mode;
+extern boolean_t gui;
/*
* Event info array
diff --git a/usr/src/cmd/powertop/util.c b/usr/src/cmd/powertop/util.c
index 02186affea..ec8dbc0d48 100644
--- a/usr/src/cmd/powertop/util.c
+++ b/usr/src/cmd/powertop/util.c
@@ -1,6 +1,6 @@
/*
- * Copyright 2008, Intel Corporation
- * Copyright 2008, Sun Microsystems, Inc
+ * Copyright 2009, Intel Corporation
+ * Copyright 2009, Sun Microsystems, Inc
*
* This file is part of PowerTOP
*
@@ -67,7 +67,7 @@ pt_error(char *format, ...)
int err = errno;
va_list alist;
- if (!dump)
+ if (gui)
return;
if (progname != NULL)
@@ -104,7 +104,7 @@ enumerate_cpus(void)
void
usage(void)
{
- (void) fprintf(stderr, "%s (C) 2008 Intel Corporation\n\n", TITLE);
+ (void) fprintf(stderr, "%s (C) 2009 Intel Corporation\n\n", TITLE);
(void) fprintf(stderr, "Usage: powertop [option]\n");
(void) fprintf(stderr, " -d, --dump [count] Read wakeups count "
"times and print list of top offenders\n");