Permalink
Browse files

Merge branch 'master' into patch

  • Loading branch information...
ceferron committed May 16, 2012
2 parents 50f2516 + ab9e20f commit 90dbb520c535af76f125f1347d54512b30e025f3
Showing with 63 additions and 55 deletions.
  1. +8 −8 .gitignore
  2. +19 −23 configure.ac
  3. +20 −20 po/nl.po
  4. +1 −1 src/Makefile.am
  5. +8 −0 src/devices/ahci.cpp
  6. +2 −2 src/lib.h
  7. +5 −1 src/tuning/tuning.cpp
View
@@ -1,10 +1,9 @@
*~
*.o
*.a
-./src/powertop
-./src/powertop.html
-./src/css.h
-./src/csstoh
+*.html
+*.csv
+*.powertop
po/powertop.pot
ChangeLog
Makefile.in
@@ -31,6 +30,9 @@ po/Makefile
po/POTFILES
po/nl.gmo
po/stamp-po
+src/powertop
+src/css.h
+src/csstoh
src/Makefile.in
src/.deps/
src/Makefile
@@ -44,10 +46,8 @@ src/process/.deps/
src/tuning/.deps/
m4
*.dirstamp
-src/css.h
-src/csstoh
-src/powertop
*.lo
*.la
autom4te.cache
-remove-potcdate.sed
+remove-potcdate.sed
+compile
View
@@ -3,19 +3,18 @@
AC_PREREQ([2.68])
AC_LANG([C++])
-AC_INIT([powertop], [1.98], [power@bughost.org])
-AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign])
+AC_INIT([powertop], [2.0], [power@bughost.org])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign ])
AC_CONFIG_FILES([Makefile src/Makefile pevent/Makefile po/Makefile.in])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
-#AC_SUBST(LIBTOOL_DEPS)
-#AC_LTDL_DLLIB
GETTEXT_PACKAGE=powertop
AC_SUBST(GETTEXT_PACKAGE)
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18])
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# Checks for programs.
AC_PROG_CPP
AC_PROG_CXX
@@ -46,33 +45,30 @@ AC_FUNC_REALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([fdatasync getpagesize gettimeofday memmove memset mkdir munmap pow realpath regcomp select setlocale socket sqrt strcasecmp strchr strdup strerror strncasecmp strstr strtoul strtoull])
-PKG_CHECK_MODULES([NCURSES], [ncurses],[],[
- AC_CHECK_LIB([ncurses], [main],[AC_SUBST(NCURSES_LIBS, "-lncurses"," ")],AC_MSG_ERROR([ncurses is required but was not found]))
-])
+AC_SEARCH_LIBS([delwin], [ncursesw ncurses], [], AC_MSG_ERROR([ncurses is required but was not found]), [])
+
PKG_CHECK_MODULES([PCIUTILS], [libpci],[],[
- AC_CHECK_LIB([libpci], [main],[AC_SUBST(PCIUTILS_LIBS, "-lpci"," ")],AC_MSG_ERROR([libpci is required but was not found]))
+ AC_SEARCH_LIBS([pci_get_dev], [pci], [], AC_MSG_ERROR([libpci is required but was not found]), [])
])
PKG_CHECK_MODULES([LIBZ], [zlib],[],[
- AC_CHECK_LIB([zlib], [main],[AC_SUBST(LIBZ_LIBS, "-lz"," ")],AC_MSG_ERROR([zlib is required but was not found]))
+ AC_SEARCH_LIBS([deflate], [z], [], AC_MSG_ERROR([zlib is required but was not found]), [])
])
-has_libnl=no
-PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl=yes],[
- AC_CHECK_LIB([libnl], [main],[has_libnl=yes AC_SUBST(LIBNL_LIBS, "-lnl"," ")],[
- PKG_CHECK_MODULES([LIBNL], [libnl-2.0 libnl-3.0 libnl-genl-3.0], [has_libnl=yes AC_DEFINE([HAVE_LIBNL20],[1],[Define if you have libnl-2.0 or higher])],[
- AC_CHECK_LIB([libnl libnl-genl], [main],[has_libnl=yes AC_SUBST(LIBNL_LIBS, "-lnl"," ") AC_DEFINE([HAVE_LIBNL20],[1],[Define if you have libnl-3.0 or higher])],[dummy=no])
- ])
- ])
+has_libnl_ver=0
+PKG_CHECK_MODULES([LIBNL], [libnl-1], [has_libnl_ver=1], [
+ AC_SEARCH_LIBS([nl_socket_alloc], [nl], [has_libnl_ver=2], [
+ PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0], [has_libnl_ver=3],
+ [AC_SEARCH_LIBS([nl_socket_alloc], [nl-3 nl-genl-3], [has_libnl_ver=3], [], [])])
+ ], [])
])
-if (test "${has_libnl}" = "no"); then
+if (test "$has_libnl_ver" -eq 0); then
AC_MSG_ERROR(libnl is required but not found)
fi
+if (test "$has_libnl_ver" -gt 1); then
+ AC_DEFINE([HAVE_LIBNL20], [1], [Define if you have libnl-2.0 or higher])
+fi
-AC_CHECK_LIB([pthread], [pthread_create],[AC_SUBST(PTHREAD_LIBS, "-lpthread"," ")] , AC_MSG_ERROR([libpthread is required but was not found]))
-
-# FIXME: Replace `main' with a function in `-lresolv':
-AC_CHECK_LIB([resolv], [main],[AC_SUBST(RESOLV_LIBS, "-lresolv"," ")], AC_MSG_ERROR([libresolv is required but was not found]))
-
-
+AC_SEARCH_LIBS([pthread_create], [pthread], [], AC_MSG_ERROR([libpthread is required but was not found]), [])
+AC_SEARCH_LIBS([inet_aton], [resolv], [], AC_MSG_ERROR([libresolv is required but was not found]), [])
AC_OUTPUT
View
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: powertop\n"
"Report-Msgid-Bugs-To: \"power@bughost.org\"\n"
-"POT-Creation-Date: 2012-04-27 13:05-0700\n"
+"POT-Creation-Date: 2012-05-10 12:53-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -67,12 +67,12 @@ msgstr ""
msgid "Turbo Mode"
msgstr ""
-#: src/cpu/cpu.cpp:89
+#: src/cpu/cpu.cpp:90
#, c-format
msgid "cpu package %i"
msgstr ""
-#: src/cpu/cpu.cpp:90
+#: src/cpu/cpu.cpp:91
msgid "cpu package"
msgstr ""
@@ -206,28 +206,28 @@ msgstr ""
msgid "Intel built in USB hub"
msgstr ""
-#: src/process/do_process.cpp:787
+#: src/process/do_process.cpp:816
#, c-format
msgid ""
"Estimated power: %5.1f Measured power: %5.1f Sum: %5.1f\n"
"\n"
msgstr ""
-#: src/process/do_process.cpp:795 src/devices/device.cpp:171
+#: src/process/do_process.cpp:824 src/devices/device.cpp:171
#, c-format
msgid "The battery reports a discharge rate of %sW\n"
msgstr ""
-#: src/process/do_process.cpp:800
+#: src/process/do_process.cpp:829
#, c-format
msgid "The estimated remaining time is %i minutes\n"
msgstr ""
-#: src/process/do_process.cpp:813
+#: src/process/do_process.cpp:842
msgid "Power est. Usage Events/s Category Description\n"
msgstr ""
-#: src/process/do_process.cpp:815
+#: src/process/do_process.cpp:844
msgid " Usage Events/s Category Description\n"
msgstr ""
@@ -482,17 +482,17 @@ msgstr ""
#: src/main.cpp:103
#, c-format
-msgid "--debug \t run in \"debug\" mode\n"
+msgid "--debug \t\t run in \"debug\" mode\n"
msgstr ""
#: src/main.cpp:104
#, c-format
-msgid "--version \t print version information\n"
+msgid "--version \t\t print version information\n"
msgstr ""
#: src/main.cpp:105
#, c-format
-msgid "--calibrate \t runs powertop in calibration mode\n"
+msgid "--calibrate \t\t runs powertop in calibration mode\n"
msgstr ""
#: src/main.cpp:106
@@ -502,27 +502,27 @@ msgstr ""
#: src/main.cpp:107
#, c-format
-msgid "--html[=FILENAME]\t\t generate a html report\n"
+msgid "--html[=FILENAME] \t generate a html report\n"
msgstr ""
#: src/main.cpp:108
#, c-format
-msgid "--csv[=FILENAME]\t\t generate a csv report\n"
+msgid "--csv[=FILENAME] \t generate a csv report\n"
msgstr ""
#: src/main.cpp:109
#, c-format
-msgid "--time[=secs]\t\t generate a report for secs\n"
+msgid "--time[=secs] \t\t generate a report for 'x' secs\n"
msgstr ""
#: src/main.cpp:110
#, c-format
-msgid "--iteration[=iterations]\t\t number of times to run tests\n"
+msgid "--iteration[=iterations] number of times to run each test\n"
msgstr ""
#: src/main.cpp:111
#, c-format
-msgid "--help \t\t print this help menu\n"
+msgid "--help \t\t\t print this help menu\n"
msgstr ""
#: src/main.cpp:113
@@ -542,22 +542,22 @@ msgstr ""
msgid "Measuring %d time(s) for %d seconds each\n"
msgstr ""
-#: src/main.cpp:293
+#: src/main.cpp:277
#, c-format
msgid "PowerTOP "
msgstr ""
-#: src/main.cpp:294 src/main.cpp:309
+#: src/main.cpp:278 src/main.cpp:367
#, c-format
msgid "exiting...\n"
msgstr ""
-#: src/main.cpp:308
+#: src/main.cpp:366
#, c-format
msgid "Failed to mount debugfs!\n"
msgstr ""
-#: src/main.cpp:424
+#: src/main.cpp:433
#, c-format
msgid "Leaving PowerTOP\n"
msgstr ""
View
@@ -17,7 +17,7 @@ powertop_CPPFLAGS = -D_FORTIFY_SOURCE=2 $(NCURSES_CFLAGS) $(PCIUTILS_CFLAGS) $(L
powertop_LDADD = ../pevent/libparseevent.la
-AM_LDFLAGS = $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS) $(NCURES_LIBS) $(PTHREAD_LIBS) $(RESOLV_LIBS)
+AM_LDFLAGS = $(LIBS) $(NCURSES_LIBS) $(PCIUTILS_LIBS) $(LIBNL_LIBS) $(LIBZ_LIBS) $(NCURES_LIBS) $(PTHREAD_LIBS) $(RESOLV_LIBS)
BUILT_SOURCES = css.h
CLEANFILES = css.h
View
@@ -258,12 +258,20 @@ void create_all_ahcis(void)
while (1) {
class ahci *bl;
ofstream file;
+ ifstream check_file;
entry = readdir(dir);
if (!entry)
break;
if (entry->d_name[0] == '.')
continue;
sprintf(filename, "/sys/class/scsi_host/%s/ahci_alpm_accounting", entry->d_name);
+
+ check_file.open(filename, ios::in);
+ check_file.get();
+ check_file.close();
+ if (check_file.bad())
+ continue;
+
file.open(filename, ios::in);
if (!file)
continue;
View
@@ -36,8 +36,8 @@
#define _(STRING) (STRING)
#endif
-#define POWERTOP_VERSION "1.98 beta 1"
-#define POWERTOP_SHORT_VERSION "1.98"
+#define POWERTOP_VERSION "v2.0"
+#define POWERTOP_SHORT_VERSION "2.0"
extern int get_max_cpu(void);
View
@@ -228,6 +228,10 @@ void report_show_tunables(void)
sort_tunables();
+
+ if (reporttype)
+ fprintf(reportout.http_report, "<div id=\"tuning\">\n");
+
line = 0;
for (i = 0; i < all_tunables.size(); i++) {
int gb;
@@ -239,7 +243,7 @@ void report_show_tunables(void)
if (line == 0) {
if(reporttype)
- fprintf(reportout.http_report,"<div id=\"tuning\"><h2>Software Settings in need of Tuning</h2>\n <table width=\"100%%\">\n");
+ fprintf(reportout.http_report,"<h2>Software Settings in need of Tuning</h2>\n <table width=\"100%%\">\n");
else
fprintf(reportout.csv_report,"**Software Settings in need of Tuning**, \n\n");

0 comments on commit 90dbb52

Please sign in to comment.