public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* heatload 0.4 now with throttling support
@ 2002-12-18 14:07 Malte Thoma
       [not found] ` <20021218153355.GK347@poup.poupinou.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Malte Thoma @ 2002-12-18 14:07 UTC (permalink / raw)
  To: ACPI-Devel, acpi-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hallo,

now it is possible to adjust the throttling with heatload.
You have to add the following lines to '/etc/sudoers'

Cmnd_Alias      THROTTLING=/usr/sbin/set_throttling
ALL     ALL=NOPASSWD: THROTTLING


hope you test it and can give suggestions for improvements.


Greetings,

Malte


ftp://ftp.berlios.de/pub/heatload/heatload_0.4.0_i386.deb
ftp://ftp.berlios.de/pub/heatload/heatload_0.4.0.orig.tgz




-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: heatload 0.4 now with throttling support
       [not found]   ` <20021218153355.GK347-j6u/t2rXLliUoIHC/UFpr9i2O/JbrIOy@public.gmane.org>
@ 2002-12-18 16:13     ` Malte Thoma
       [not found]       ` <3E009EB5.7010109-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Malte Thoma @ 2002-12-18 16:13 UTC (permalink / raw)
  To: Ducrot Bruno, ACPI-Devel



Ducrot Bruno wrote:

>After dpkg and heatload, get
> Sorry can't open any of the following files:
>	 /proc/acpi/thermal_zone/THRM/temperature
>	 /proc/acpi/thermal/0/status
>
>But
># ls /proc/acpi/thermal_zone/
>THM0
>
>
>Please fix by parsing the entry of /proc/acpi/thermal_zone, 
>
can you please send me

cat /proc/acpi/thermal_zone/THM0

... it seems to me that there are a LOT of different 
proc/acpi-structures :-(

/proc/acpi/thermal/0/status
/proc/acpi/thermal_zone
/proc/acpi/thermal_zone/THRM/temperature

and now:
/proc/acpi/thermal_zone/THM0

hope that the ACPI-group stabilize this ;-)

>and
>do not forget that you can have more than one thermal zone.
>
>  
>
until now heatload workes only for one CPU (i suppose the thermal_zone 
is coherent to the counting of CPUs?)

I won't be hard to improve it to more than one, but doing THAT for 
recurrent changing directory structs does not make fun.
If you can tell me more about the future (and present) of the 
proc/acpi-structure depending on the numers of CPU I will start 
implementing this feature between christmas and new years eve ;-)


Greetings,

Malte







>  
>



-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players,  XBox Games,  Flying Saucers,  WebCams,  Smart Putty.
T H I N K G E E K . C O M       http://www.thinkgeek.com/sf/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: heatload 0.4 now with throttling support
       [not found]       ` <3E009EB5.7010109-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org>
@ 2002-12-18 17:08         ` Faye Pearson
       [not found]           ` <20021218170828.GA9127-6JSjyQ0Qj1ReoWH0uzbU5w@public.gmane.org>
  2002-12-19 12:09         ` Ducrot Bruno
  1 sibling, 1 reply; 9+ messages in thread
From: Faye Pearson @ 2002-12-18 17:08 UTC (permalink / raw)
  To: Malte Thoma; +Cc: Ducrot Bruno, ACPI-Devel

Malte Thoma [thoma-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org] wrote:
> cat /proc/acpi/thermal_zone/THM0
> 
> ... it seems to me that there are a LOT of different 
> proc/acpi-structures :-(
> 
> /proc/acpi/thermal/0/status
> /proc/acpi/thermal_zone
> /proc/acpi/thermal_zone/THRM/temperature
> /proc/acpi/thermal_zone/THM0

As with most ACPI things, the name of the thermal_zone is defined by the
DSDT table, and is arbitrary.  You should read everything in the
directory.

> hope that the ACPI-group stabilize this ;-)

They can't do anything about it.

> until now heatload workes only for one CPU (i suppose the thermal_zone 
> is coherent to the counting of CPUs?)

No, there could be a passive zone, a critical zone etc.


Faye

-- 
Faye Pearson,
Covert Development
ClaraNET Ltd.       Tel 020 7903 3000

Convention is the ruler of all.
		-- Pindar


-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players,  XBox Games,  Flying Saucers,  WebCams,  Smart Putty.
T H I N K G E E K . C O M       http://www.thinkgeek.com/sf/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: heatload 0.4 now with throttling support
       [not found]           ` <20021218170828.GA9127-6JSjyQ0Qj1ReoWH0uzbU5w@public.gmane.org>
@ 2002-12-18 17:22             ` Malte Thoma
       [not found]               ` <3E00AEC8.9050906-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Malte Thoma @ 2002-12-18 17:22 UTC (permalink / raw)
  To: Faye Pearson; +Cc: Ducrot Bruno, ACPI-Devel



Faye Pearson wrote:

>Malte Thoma [thoma-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org] wrote:
>  
>
>>cat /proc/acpi/thermal_zone/THM0
>>
>>... it seems to me that there are a LOT of different 
>>proc/acpi-structures :-(
>>
>>/proc/acpi/thermal/0/status
>>/proc/acpi/thermal_zone
>>/proc/acpi/thermal_zone/THRM/temperature
>>/proc/acpi/thermal_zone/THM0
>>    
>>
>
>As with most ACPI things, the name of the thermal_zone is defined by the
>DSDT table, and is arbitrary.  You should read everything in the
>directory.
>  
>
In which directory, in /proc/acpi or in ../thermal_zone ?

>>hope that the ACPI-group stabilize this ;-)
>>    
>>
>
>They can't do anything about it.
>  
>
Thank you for this importent and disillusioned information :-(

>>until now heatload workes only for one CPU (i suppose the thermal_zone 
>>is coherent to the counting of CPUs?)
>>    
>>
>
>No, there could be a passive zone, a critical zone etc.
>  
>
Wonderfull task: something to develope for machines I cannot test it for :-(
coming along that my skills are not guru-like :-(

So what can you advise me?

parsing /proc/acpi and looking for


processor ->throttling
thermal*  -> ????
battery -> state or status
ac_adapter   -> state or status

excpecially in the thermal zone it looks as if ther is no regularity :-(
Do you have some more hints ?


Greetings,

Malte








>  
>



-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players,  XBox Games,  Flying Saucers,  WebCams,  Smart Putty.
T H I N K G E E K . C O M       http://www.thinkgeek.com/sf/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: heatload 0.4 now with throttling support
       [not found]               ` <3E00AEC8.9050906-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org>
@ 2002-12-18 18:03                 ` Faye Pearson
       [not found]                   ` <20021218180329.GA9439-6JSjyQ0Qj1ReoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Faye Pearson @ 2002-12-18 18:03 UTC (permalink / raw)
  To: Malte Thoma; +Cc: ACPI-Devel

Malte Thoma [thoma-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org] wrote:
> In which directory, in /proc/acpi or in ../thermal_zone ?

Well, everything under /proc/acpi is well-known (so far at least)
ac_adapter/
thermal_zone/
battery/
processor/
etc.

In each of those directories there may be one or more other directories
- one for each node eg.

ACAD, AC0 for AC
BAT0, BAT1, BAT2, BATR for batteries
TZ0, THRM for thermal zones.
CPU0, PROC, for processor

The only thing you can do is opendir("/proc/acpi/thermalzone"), then
readdir for each item - ignore . and .. of course.

> Wonderfull task: something to develope for machines I cannot test it for :-(
> coming along that my skills are not guru-like :-(

If you don't hardcode the directories under ac_adapter,thermal_zone etc.
then you should be ok.

> processor ->throttling
processor/*/throttling
processor/*/performance


My processor (for example) doesn't support throttling, just performance.

> thermal*  -> ????

thermal_zone/*/temperature I guess :)

> battery -> state or status

Is it status or info which holds the most useful information?

> ac_adapter   -> state or status

Present: yes or no is about all that's useful there I think.


Faye

-- 
Faye Pearson,
Covert Development
ClaraNET Ltd.       Tel 020 7903 3000

I have the simplest tastes.  I am always satisfied with the best.
		-- Oscar Wilde


-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players,  XBox Games,  Flying Saucers,  WebCams,  Smart Putty.
T H I N K G E E K . C O M       http://www.thinkgeek.com/sf/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: heatload 0.4 now with throttling support
       [not found]       ` <3E009EB5.7010109-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org>
  2002-12-18 17:08         ` Faye Pearson
@ 2002-12-19 12:09         ` Ducrot Bruno
  1 sibling, 0 replies; 9+ messages in thread
From: Ducrot Bruno @ 2002-12-19 12:09 UTC (permalink / raw)
  To: Malte Thoma; +Cc: Ducrot Bruno, ACPI-Devel

On Wed, Dec 18, 2002 at 05:13:41PM +0100, Malte Thoma wrote:
> 
> 
> Ducrot Bruno wrote:
> 
> >After dpkg and heatload, get
> >Sorry can't open any of the following files:
> >	 /proc/acpi/thermal_zone/THRM/temperature
> >	 /proc/acpi/thermal/0/status
> >
> >But
> ># ls /proc/acpi/thermal_zone/
> >THM0
> >
> >
> >Please fix by parsing the entry of /proc/acpi/thermal_zone, 
> >

It is exactly the same as for your /proc/acpi/thermal_zone/THRM/temperature

You can not know in advance what will be the name of
/proc/acpi/thermal_zone/THRM

The 'name' THRM is actually given by the BIOS (by the DSDT, in fact).

the only 'clean' way to go is to get the entry(ies) of

/proc/acpi/thermal_zone/

Doing something like (not tested):

char *get_the_name_of_that_damned_temp_file(void)
{
	int		n;
	int		i;
	struct dirent **temp;
	char	       *name;

	static char temperature[4096];		/* OK.. we can do certainly better here via malloc.. */


	n = scandir("/proc/acpi/thermal_zone", &temp, 0, alphasort);

	if (n < 0) {
		return NULL;
	}

	for (i = 0; i < n; i++) {
		/* skip .* */
		if ((temp[i]->d_name)[0] == '.')
			continue;

		name = temp[i]->d_name;
		sprintf(temperature, "/proc/acpi/thermal_zone/%s/temperature", name);
		free(temp);
		return temperature;
	}
	free(temp);
	return NULL;
}

It should return the first 'temperature' file for all newer release of ACPI.
For 'older', it is OK for /proc/acpi/thermal/0/temperature

Then, that file contain:
ducrot@novae:~$ cat /proc/acpi/thermal_zone/THM0/temperature 
temperature:             45 C


(I must admit also that I don't know for /proc/acpi/thermal/0/temperature,
'older' way).

Cheers,

-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This SF.NET email is sponsored by: Geek Gift Procrastinating?
Get the perfect geek gift now!  Before the Holidays pass you by.
T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: heatload 0.4 now with throttling support
       [not found]                   ` <20021218180329.GA9439-6JSjyQ0Qj1ReoWH0uzbU5w@public.gmane.org>
@ 2002-12-19 13:23                     ` Ducrot Bruno
       [not found]                       ` <20021219132303.GH4257-j6u/t2rXLliUoIHC/UFpr9i2O/JbrIOy@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Ducrot Bruno @ 2002-12-19 13:23 UTC (permalink / raw)
  To: Faye Pearson; +Cc: Malte Thoma, ACPI-Devel

On Wed, Dec 18, 2002 at 06:03:29PM +0000, Faye Pearson wrote:
> Malte Thoma [thoma-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org] wrote:
> > In which directory, in /proc/acpi or in ../thermal_zone ?
> 
> Well, everything under /proc/acpi is well-known (so far at least)
> ac_adapter/
> thermal_zone/
> battery/
> processor/
> etc.
> 
> In each of those directories there may be one or more other directories
> - one for each node eg.
> 
> ACAD, AC0 for AC
> BAT0, BAT1, BAT2, BATR for batteries
> TZ0, THRM for thermal zones.
> CPU0, PROC, for processor
> 
> The only thing you can do is opendir("/proc/acpi/thermalzone"), then
> readdir for each item - ignore . and .. of course.

No.  scandir().  You can alphasort.

-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This SF.NET email is sponsored by: Geek Gift Procrastinating?
Get the perfect geek gift now!  Before the Holidays pass you by.
T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: heatload 0.4 now with throttling support
       [not found]                       ` <20021219132303.GH4257-j6u/t2rXLliUoIHC/UFpr9i2O/JbrIOy@public.gmane.org>
@ 2002-12-19 15:27                         ` Faye Pearson
       [not found]                           ` <20021219152724.GA14703-6JSjyQ0Qj1ReoWH0uzbU5w@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Faye Pearson @ 2002-12-19 15:27 UTC (permalink / raw)
  To: Ducrot Bruno; +Cc: Malte Thoma, ACPI-Devel

Ducrot Bruno [ducrot-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org] wrote:
> > The only thing you can do is opendir("/proc/acpi/thermalzone"), then
> > readdir for each item - ignore . and .. of course.
> 
> No.  scandir().  You can alphasort.

Picky :)  What I was trying to say is that you've got no choice but to
scan/read directories, you can't hardcode.

Scandir is cute, but perhaps unnecessary in a procfs where the nodes are
created in-order anyway?


Faye

-- 
Faye Pearson,
Covert Development
ClaraNET Ltd.       Tel 020 7903 3000

When it comes to broken marriages most husbands will split the blame --
half his wife's fault, and half her mother's.


-------------------------------------------------------
This SF.NET email is sponsored by: Geek Gift Procrastinating?
Get the perfect geek gift now!  Before the Holidays pass you by.
T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: heatload 0.4 now with throttling support
       [not found]                           ` <20021219152724.GA14703-6JSjyQ0Qj1ReoWH0uzbU5w@public.gmane.org>
@ 2002-12-19 15:39                             ` Ducrot Bruno
  0 siblings, 0 replies; 9+ messages in thread
From: Ducrot Bruno @ 2002-12-19 15:39 UTC (permalink / raw)
  To: Faye Pearson; +Cc: Ducrot Bruno, Malte Thoma, ACPI-Devel

On Thu, Dec 19, 2002 at 03:27:24PM +0000, Faye Pearson wrote:
> Ducrot Bruno [ducrot-kk6yZipjEM5g9hUCZPvPmw@public.gmane.org] wrote:
> > > The only thing you can do is opendir("/proc/acpi/thermalzone"), then
> > > readdir for each item - ignore . and .. of course.
> > 
> > No.  scandir().  You can alphasort.
> 
> Picky :)  What I was trying to say is that you've got no choice but to
> scan/read directories, you can't hardcode.
> 
> Scandir is cute, but perhaps unnecessary in a procfs where the nodes are
> created in-order anyway?

Nope.  I really need to scandir() especially for the batteries case, because
the opendir() gave me BAT2 then BAT1 at least for me.

Cheers,

-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This SF.NET email is sponsored by: Geek Gift Procrastinating?
Get the perfect geek gift now!  Before the Holidays pass you by.
T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-12-19 15:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-18 14:07 heatload 0.4 now with throttling support Malte Thoma
     [not found] ` <20021218153355.GK347@poup.poupinou.org>
     [not found]   ` <20021218153355.GK347-j6u/t2rXLliUoIHC/UFpr9i2O/JbrIOy@public.gmane.org>
2002-12-18 16:13     ` Malte Thoma
     [not found]       ` <3E009EB5.7010109-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org>
2002-12-18 17:08         ` Faye Pearson
     [not found]           ` <20021218170828.GA9127-6JSjyQ0Qj1ReoWH0uzbU5w@public.gmane.org>
2002-12-18 17:22             ` Malte Thoma
     [not found]               ` <3E00AEC8.9050906-iYtK5bfT9M8b1SvskN2V4Q@public.gmane.org>
2002-12-18 18:03                 ` Faye Pearson
     [not found]                   ` <20021218180329.GA9439-6JSjyQ0Qj1ReoWH0uzbU5w@public.gmane.org>
2002-12-19 13:23                     ` Ducrot Bruno
     [not found]                       ` <20021219132303.GH4257-j6u/t2rXLliUoIHC/UFpr9i2O/JbrIOy@public.gmane.org>
2002-12-19 15:27                         ` Faye Pearson
     [not found]                           ` <20021219152724.GA14703-6JSjyQ0Qj1ReoWH0uzbU5w@public.gmane.org>
2002-12-19 15:39                             ` Ducrot Bruno
2002-12-19 12:09         ` Ducrot Bruno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox