commit pm-profiler for openSUSE:Factory
Hello community, here is the log from the commit of package pm-profiler for openSUSE:Factory checked in at Thu Feb 26 18:20:37 CET 2009. -------- --- pm-profiler/pm-profiler.changes 2009-02-11 13:57:22.000000000 +0100 +++ pm-profiler/pm-profiler.changes 2009-02-26 17:56:44.424205000 +0100 @@ -1,0 +2,9 @@ +Thu Feb 26 17:27:02 CET 2009 - bgeuken@suse.de + +- Include patches into tarball -> own project + Fix sample_rate calculation + Fix smp path, must be smt + Move get_profile to /usr/bin + Add name of profile to get_profile + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- enable_profile_fix_cpu_limit.patch get_profile.diff sample_rate.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pm-profiler.spec ++++++ --- /var/tmp/diff_new_pack.Ld2575/_old 2009-02-26 18:19:21.000000000 +0100 +++ /var/tmp/diff_new_pack.Ld2575/_new 2009-02-26 18:19:21.000000000 +0100 @@ -21,14 +21,11 @@ Name: pm-profiler Summary: Managing power options on servers Version: 0.1 -Release: 26 +Release: 29 License: GPL v2 only Url: http://www.stilltobefound.org Group: System/Management Source: %{name}-%{version}.tar.bz2 -Patch0: sample_rate.patch -Patch1: enable_profile_fix_cpu_limit.patch -Patch2: get_profile.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %insserv_prereq BuildArch: noarch @@ -49,9 +46,6 @@ %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 %build @@ -72,6 +66,7 @@ %defattr(-,root,root) %_docdir/pm-profiler /usr/lib/pm-profiler +/usr/bin/get_profile %config(noreplace) %_sysconfdir/pm-profiler.conf %dir %_sysconfdir/pm-profiler %dir %_sysconfdir/pm-profiler/balanced_low_latency @@ -85,6 +80,12 @@ /usr/share/locale/*/LC_MESSAGES/pm-profiler.mo %changelog +* Thu Feb 26 2009 bgeuken@suse.de +- Include patches into tarball -> own project + Fix sample_rate calculation + Fix smp path, must be smt + Move get_profile to /usr/bin + Add name of profile to get_profile * Wed Feb 11 2009 bgeuken@suse.de - added get_profile script for readout of the current profile * Mon Feb 09 2009 trenn@suse.de ++++++ pm-profiler-0.1.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-profiler-0.1/doc/config.template new/pm-profiler-0.1/doc/config.template --- old/pm-profiler-0.1/doc/config.template 2008-11-19 13:10:54.000000000 +0100 +++ new/pm-profiler-0.1/doc/config.template 2009-02-26 17:24:45.000000000 +0100 @@ -34,6 +34,14 @@ # CPUFREQ_ONDEMAND_UP_THRESHOLD="" +# Generally the kernel sets default values for the sampling rate. For slower +# operations, set higher sampling range values. +# This option is rather for hardware optimization then for powersaving. +# +# File: /sys/devices/system/cpu/cpu*/cpufreq/ondemand/sampling_rate +# +CPUFREQ_ONDEMAND_SAMPLING_RATE="" + # This will lower the target CPU frequency by a specified percent. # powersave_bias is in units of 0.1%, so it has an effective range of 1 # through 1000, resulting in 0.1% to 100% impact. @@ -93,7 +101,7 @@ # because the readahead is applied to _all_ files that are read from disk. # Kernel default is currenty 128. Good starting point would be a value of # 3072. -# Reference: laptop-mode-tools. +# Reference: laptop-mode-tools. # # Possible values: KB # diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-profiler-0.1/Makefile new/pm-profiler-0.1/Makefile --- old/pm-profiler-0.1/Makefile 2008-12-23 15:24:01.000000000 +0100 +++ new/pm-profiler-0.1/Makefile 2009-02-26 17:47:53.000000000 +0100 @@ -18,6 +18,7 @@ mkdir -p $(DESTDIR)$(bindir) install -m 644 config/pm-profiler.conf $(DESTDIR)$(sysconfdir) install -m 744 tools/enable-profile $(DESTDIR)$(libexecdir)/pm-profiler + install -m 755 tools/get_profile $(DESTDIR)$(bindir) cd profiles; \ for I in *; do \ mkdir -p $(DESTDIR)$(sysconfdir)/pm-profiler/$$I; \ @@ -45,5 +46,6 @@ rm -rf $(DESTDIR)$(sysconfdir)/pm-profiler.conf rm -rf $(DESTDIR)$(sysconfdir)/init.d/rcpm-profiler rm -rf $(DESTDIR)$(sbindir)/rcpm-profiler + rm -r $(DESTDIR)$(bindir)/get_profile rm -rf $(DESTDIR)$(sysconfdir)/acpi/events/power-button rm -rf $(localedir)/*/LC_MESSAGES/pm-profiler.mo diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-profiler-0.1/tools/enable-profile new/pm-profiler-0.1/tools/enable-profile --- old/pm-profiler-0.1/tools/enable-profile 2009-01-08 20:17:47.000000000 +0100 +++ new/pm-profiler-0.1/tools/enable-profile 2009-02-26 17:30:45.000000000 +0100 @@ -42,32 +42,43 @@ } function cpufreq_ondemand_up_threshold { - dbus-send --system --print-reply --dest=org.freedesktop.Hal \ - $HAL_COMPUTER_PATH \ - org.freedesktop.Hal.Device.CPUFreq.SetCPUFreqPerformance \ - int32:$CPUFREQ_UP_THRESHOLD >/dev/null 2>&1 | $LOGGER + for I in /sys/devices/system/cpu/cpu*/cpufreq/ondemand/up_threshold; do + echo $CPUFREQ_ONDEMAND_UP_THRESHOLD > $I + done +} + +function cpufreq_ondemand_sampling_rate { + local SAMPLE_RATE + for I in /sys/devices/system/cpu/cpu*/cpufreq; do + if [ -e $I/cpuinfo_transition_latency ] && \ + [ -w $I/ondemand/sampling_rate ]; then + SAMPLE_RATE=$(($(cat $I/cpuinfo_transition_latency) \ + * $CPUFREQ_ONDEMAND_SAMPLING_RATE / 1000)) + echo $SAMPLE_RATE > $I/ondemand/sampling_rate + fi + done +} + +function cpufreq_ondemand_powersave_bias { + for I in /sys/devices/system/cpu/cpu*/cpufreq/ondemand/powersave_bias; do + echo $CPUFREQ_ONDEMAND_POWERSAVE_BIAS > $I + done } function cpufreq_sched_mc_power_savings { path_mc="/sys/devices/system/cpu/sched_mc_power_savings" - path_smp="/sys/devices/system/cpu/sched_smp_power_savings" + path_smt="/sys/devices/system/cpu/sched_smt_power_savings" if [ -w "$path_mc" ] ; then - echo $CPUFREQ_SCHED_MC_POWER_SAVINGS > $path_mc + echo $CPUFREQ_SCHED_MC_POWER_SAVINGS > $path_mc fi - if [ -w "$path_smp" ] ; then - echo $CPUFREQ_SCHED_MC_POWER_SAVINGS > $path_smp + if [ -w "$path_smt" ] ; then + echo $CPUFREQ_SCHED_MC_POWER_SAVINGS > $path_smt fi } -function cpufreq_ondemand_powersave_bias { - for I in /sys/devices/system/cpu/cpu?; do - echo $CPUFREQ_ONDEMAND_POWERSAVE_BIAS > $I/cpufreq/ondemand/powersave_bias - done -} - function sata_alpm { - for I in /sys/class/scsi_host/host?/link_power_management_policy; do + for I in /sys/class/scsi_host/host*/link_power_management_policy; do [ -e $I ] && echo $SATA_ALPM > $I done } @@ -77,7 +88,7 @@ } function hal_disable_polling { - for I in /dev/scd?; do + for I in /dev/scd*; do hal-disable-polling --device $I >/dev/null 2>&1 | $LOGGER done } @@ -87,13 +98,14 @@ } function read_ahead_kb { - echo $READ_AHEAD_KB > /sys/block/sd?/queue/read_ahead_kb + echo $READ_AHEAD_KB > /sys/block/sd*/queue/read_ahead_kb } [ -n "$CPUFREQ_GOVERNOR" ] && cpufreq_governor -[ -n "$CPUFREQ_SCHED_MC_POWER_SAVINGS" ] && cpufreq_sched_mc_power_savings [ -n "$CPUFREQ_ONDEMAND_UP_THRESHOLD" ] && cpufreq_ondemand_up_threshold +[ -n "$CPUFREQ_ONDEMAND_SAMPLING_RATE" ] && cpufreq_ondemand_sampling_rate [ -n "$CPUFREQ_ONDEMAND_POWERSAVE_BIAS" ] && cpufreq_ondemand_powersave_bias +[ -n "$CPUFREQ_SCHED_MC_POWER_SAVINGS" ] && cpufreq_sched_mc_power_savings [ -n "$SATA_ALPM" ] && sata_alpm [ -n "$EXTERNAL_HOOK" ] && external_hook [ -n "$HAL_DISABLE_POLLING" ] && hal_disable_polling diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/pm-profiler-0.1/tools/get_profile new/pm-profiler-0.1/tools/get_profile --- old/pm-profiler-0.1/tools/get_profile 1970-01-01 01:00:00.000000000 +0100 +++ new/pm-profiler-0.1/tools/get_profile 2009-02-26 17:49:34.000000000 +0100 @@ -0,0 +1,153 @@ +#!/bin/bash +# +# script to read out the current values which can be set by pm-profiler. +# + +HAL_COMPUTER_PATH="/org/freedesktop/Hal/devices/computer" +Gov_Prefix= + + +function pm_profile_name { + Value=`cat /etc/pm-profiler.conf |grep PM_PROFILER_PROFILE| \ + sed -e 's/PM_PROFILER_PROFILE=\"\(.*\)\"/\1/g'` + echo "NAME=$Value" +} + +function read_cpufreq_governor { + Option="CPUFREQ_GOVERNOR" + Value=`dbus-send --system --print-reply --dest=org.freedesktop.Hal\ + $HAL_COMPUTER_PATH \ + org.freedesktop.Hal.Device.CPUFreq.GetCPUFreqGovernor \ + | grep string | sed -e 's/\s*string //g' \ + | sed -e 's/"//g' 2> /dev/null` + if [ ! $? ]; then + echo "Warning: Bad return Value of dbus-send." >&2 + fi + Governor=$Value + echo $Option"="$Value +} + +function read_cpufreq_up_threshold { + Option="CPUFREQ_UP_THRESHOLD" + Value=`cat /sys/devices/system/cpu/cpu0/cpufreq/$Governor/up_threshold` + + for I in /sys/devices/system/cpu/cpu[[:digit:]]*; do + if [ -d $I/cpufreq/$Governor ]; then + Next_Value=`cat $I/cpufreq/$Governor/up_threshold` + if [[ $Next_Value != $Value ]]; then + echo "Warning: different values: "$Option >&2 + fi + else + echo "Warning: different governor on "$I >&2 + fi + done + echo $Option"="$Value +} + +function read_sampling_rate { + Option="CPUFREQ_UP_CPUFREQ_SAMPLING_RATE" + Value=`cat /sys/devices/system/cpu/cpu0/cpufreq/$Governor/sampling_rate` + + for I in /sys/devices/system/cpu/cpu[[:digit:]]*; do + if [ -d $I/cpufreq/$Governor ]; then + if [ `cat $I/cpufreq/$Governor/sampling_rate` != $Value ]; then + echo "Warning: different values: "$Option >&2 + fi + else + echo "Warning: different governor on "$I >&2 + fi + done + echo $Option"="$Value +} + +function read_cpufreq_ondemand_powersave_bias { + Option="CPUFREQ_ONDEMAND_POWERSAVE_BIAS" + Value=`cat /sys/devices/system/cpu/cpu0/cpufreq/$Governor/powersave_bias` + + for I in /sys/devices/system/cpu/cpu[[:digit:]]*; do + if [ -d $I/cpufreq/$Governor ]; then + if [ `cat $I/cpufreq/$Governor/powersave_bias` != $Value ]; then + echo "Warning: different values: "$Option >&2 + fi + else + echo "Warning: different governor on "$I >&2 + fi + done + echo $Option"="$Value +} + +function read_cpufreq_sched_mc_power_savings { + path_mc="/sys/devices/system/cpu/sched_mc_power_savings" + path_smp="/sys/devices/system/cpu/sched_smp_power_savings" + + if [ -f "$path_mc" ] ; then + Option="CPUFREQ_SCHED_MC_POWER_SAVINGS" + Value=`cat $path_mc` + echo $Option"="$Value + fi + if [ -f "$path_smp" ] ; then + Option="CPUFREQ_SCHED_MC_POWER_SAVINGS" + Value=`cat $path_smp` + echo $Option"="$Value + fi +} + +function read_sata_alpm { + Option="SATA_ALPM" + Value= + + if [ -f /sys/class/scsi_host/host0/link_power_management_policy ]; then + Value=`cat /sys/class/scsi_host/host0/link_power_management_policy` + + for I in /sys/class/scsi_host/host[[:digit:]]*/link_power_management_policy; do + if [ `cat /sys/class/scsi_host/host0/link_power_management_policy` != $Value ] ; then + echo "Warning: different values: "$Option >&2 + fi + done + fi + echo $Option"="$Value +} + +function read_dirty_writeback_centisecs { + Value=`cat /proc/sys/vm/dirty_writeback_centisecs` + echo "DIRTY_WRITEBACK_CENTISECS="$Value >&2 +} + +function read_ahead_kb { + Option="READ_AHEAD_KB" + Value=`cat /sys/block/sda/queue/read_ahead_kb` + cd /dev + for I in sd?; do + if [[ `cat /sys/block/$I/queue/read_ahead_kb` != $Value ]]; then + echo "Warning: different values: "$Option >&2 + fi + done + cd - > /dev/null + echo $Option"="$Value +} + +if [ -d /sys/devices/system/cpu/cpu0/cpufreq ]; then + pm_profile_name + read_cpufreq_governor + if [ $Governor == conservative -o $Governor == ondemand ]; then + read_sampling_rate + read_cpufreq_up_threshold + if [ $Governor == ondemand ]; then + read_cpufreq_ondemand_powersave_bias + fi + fi + read_cpufreq_sched_mc_power_savings + read_sata_alpm + read_dirty_writeback_centisecs + read_ahead_kb + exit 0 +else + echo "Error: unable to read settings." \ + "Please check if your cpu supports power management." >&2 + exit 126 +fi + + +exit 0 + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de