updated active % of GPU to Powered On
configure: rework libnl detection and fix libnl-2 case (v2)

Rework libnl detection.

PKG_CHECK_MODULES macro appends FOO_CFLAGS and FOO_LIBS flags

Example:
LIBNL_CFLAGS = -I/usr/include/libnl3
LIBNL_LIBS = -lnl-genl-3 -lnl-3

while AC_SEARCH_LIBS only prepends -llibrary to LIBS, so AC_SEARCH_LIBS
is not helpful.

Use pkg-config PC file names to search for minimum package versions:
libnl 3.+ -- libnl-3.0.pc
libnl 2.+ -- libnl-2.0.pc
libnl 1.+ -- libnl-1.0.pc

Patch also changes $has_libnl_ver == 0 error message and suppresses
failed PKG_CHECK_MODULES output.

Austin pointed out that libnl-2.0 provide only libnl-2.0.pc pkg-config
file, while libnl-3 has at least 5 of them (for every `so').
This is why we check libnl-3.0.pc and libnl-genl-3.0.pc in libnl-3 case.

Many thanks to Austin Zhang for help.
v2: Namhyung Kim reported that libnl-1.0.pc on Ubuntu is named libnl-1.pc.

Reported-and-tested-by: Austin Zhang <zhang.austin@gmail.com>
Tested-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Ignore non-P-state-enabled CPUs when calculating frequency.

This fixes bogus reported CPU frequencies (actually, uninitialized
values from i965_core) when i965 monitoring is used.

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
transifex update
fixed issues with p-state reported CPU frequencies (actually, uninitialized
values ) extended from fix for i965 monitoring. Also found UI titles missing, so repleaced them.
cpu: Fix leftovers from the P state cpu frequency calculation

The commit 15b8bfb ("Ignore non-P-state-enabled CPUs when calculating
frequency") and 29f42b5 ("fixed issues with p-state reported CPU
frequencies") fixed frequency calculation for cpu packages but missed
it for cpu cores.  Add it.

This fixes wrong frequency report on my quad-core box: 2072.5% -> 100.0%

Cc: Ivan Shapovalov <intelfx100@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
up version for v2.2 release
report: fixed crash when writing report to RO filesystem

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Use PACKAGE_VERSION for POWERTOP_VERSION

It was missed to update POWERTOP_VERSION macro so that the
new v2.2 release still shows v2.1 string on the header of
ncurses window.  Convert to use PACKAGE_VERSION macro which
set by autotools to the AC_INIT version so that it cannot
be missed anymore.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Allow frequency stats when cpuidle is not enabled

Powertop fails to display frequency stats when cpuidle subsystem
is not enabled. Fix it.

Signed-off-by: Rajagopal Venkat <rajagopal.venkat@linaro.org>
Correct script for tuning wifi power_save with iw

The logic for the script to run to fix the power_save state of a
wireless device was inverted.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
cpufreq: only try to open files under cpuX

There are called many useless 'open' syscalls that always fail, like:
  open("/sys/devices/system/cpu/uevent/cpufreq/scaling_governor", O_RDONLY) = -1 ENOTDIR (Not a directory)
This patch filters them to 'likely' patterns, like e.g.:
/sys/devices/system/cpu/cpuX/cpufreq/scaling_governor, where X is string
starting with digit. For match cases it will add only small overhead.

Originally reported as:
https://bugzilla.redhat.com/show_bug.cgi?id=886185

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Merge branch 'upstream'