public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: more verbose thermal zone shutdown message
@ 2007-04-05 14:15 Danny Kukawka
  2007-04-05 15:12 ` Stefan Seyfried
  2007-04-15 19:11 ` Pavel Machek
  0 siblings, 2 replies; 4+ messages in thread
From: Danny Kukawka @ 2007-04-05 14:15 UTC (permalink / raw)
  To: linux-acpi; +Cc: linux-kernel

Hi,

while debug some strange termal shutdowns I wrote this patch to get more 
information in /var/log/messages about the reason for the shutdown. I 
think this would be useful in general.

Danny

From: Danny Kukawka <dkukawka@suse.de>
Subject: ACPI: more verbose thermal zone shutdown message

add more information to acpi thermal zone shutdown message for easier
debugging

Signed-off-by: Danny Kukawka <dkukawka@suse.de>
---
 thermal.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

--- linux-2.6.21-rc5/drivers/acpi/thermal.c	2007-04-05 13:37:07.000000000 +0200
+++ linux-2.6.21-rc5/drivers/acpi/thermal.c	2007-04-05 16:02:03.000000000 +0200
@@ -457,14 +457,20 @@
 		return -EINVAL;
 
 	if (tz->temperature >= tz->trips.critical.temperature) {
-		printk(KERN_WARNING PREFIX "Critical trip point\n");
+		printk(KERN_WARNING PREFIX 
+		       "Critical trip point (%ld C) reached on thermal zone [%s]\n",
+		       KELVIN_TO_CELSIUS(tz->trips.critical.temperature),
+		       acpi_device_bid(tz->device)); 
 		tz->trips.critical.flags.enabled = 1;
 	} else if (tz->trips.critical.flags.enabled)
 		tz->trips.critical.flags.enabled = 0;
 
 	printk(KERN_EMERG
-	       "Critical temperature reached (%ld C), shutting down.\n",
-	       KELVIN_TO_CELSIUS(tz->temperature));
+	       "Critical temperature reached (%ld C on [%s] with trip point set to: %ld C), shutting down.\n",
+	       KELVIN_TO_CELSIUS(tz->temperature),
+	       acpi_device_bid(tz->device),
+	       KELVIN_TO_CELSIUS(tz->trips.critical.temperature));
+
 	acpi_bus_generate_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL,
 				tz->trips.critical.flags.enabled);
 

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

* Re: [PATCH] ACPI: more verbose thermal zone shutdown message
  2007-04-05 14:15 [PATCH] ACPI: more verbose thermal zone shutdown message Danny Kukawka
@ 2007-04-05 15:12 ` Stefan Seyfried
  2007-04-15 19:11 ` Pavel Machek
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Seyfried @ 2007-04-05 15:12 UTC (permalink / raw)
  To: Danny Kukawka; +Cc: linux-acpi, linux-kernel

On Thu, Apr 05, 2007 at 04:15:07PM +0200, Danny Kukawka wrote:
> Hi,
> 
> while debug some strange termal shutdowns I wrote this patch to get more 
> information in /var/log/messages about the reason for the shutdown. I 
> think this would be useful in general.

Yes, especially as these were bogus thermal shutdowns, it is useful for
debugging to know from which thermal zone they were initiated.

> Danny
> 
> From: Danny Kukawka <dkukawka@suse.de>
> Subject: ACPI: more verbose thermal zone shutdown message
> 
> add more information to acpi thermal zone shutdown message for easier
> debugging
> 
> Signed-off-by: Danny Kukawka <dkukawka@suse.de>

FWIW:
Signed-off-by: Stefan Seyfried <seife@suse.de>

-- 
Stefan Seyfried

"Any ideas, John?"
"Well, surrounding them's out." 

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

* Re: [PATCH] ACPI: more verbose thermal zone shutdown message
  2007-04-05 14:15 [PATCH] ACPI: more verbose thermal zone shutdown message Danny Kukawka
  2007-04-05 15:12 ` Stefan Seyfried
@ 2007-04-15 19:11 ` Pavel Machek
  2007-04-16 15:58   ` Danny Kukawka
  1 sibling, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2007-04-15 19:11 UTC (permalink / raw)
  To: Danny Kukawka; +Cc: linux-acpi, linux-kernel

Hi!

> while debug some strange termal shutdowns I wrote this patch to get more 
> information in /var/log/messages about the reason for the shutdown. I 
> think this would be useful in general.
> 
> Danny
> 
> From: Danny Kukawka <dkukawka@suse.de>
> Subject: ACPI: more verbose thermal zone shutdown message
> 
> add more information to acpi thermal zone shutdown message for easier
> debugging
> 
> Signed-off-by: Danny Kukawka <dkukawka@suse.de>

Yes, please.

(I actually had similar patch in my tree forever).

>  	if (tz->temperature >= tz->trips.critical.temperature) {
> -		printk(KERN_WARNING PREFIX "Critical trip point\n");
> +		printk(KERN_WARNING PREFIX 
> +		       "Critical trip point (%ld C) reached on thermal zone [%s]\n",
> +		       KELVIN_TO_CELSIUS(tz->trips.critical.temperature),
> +		       acpi_device_bid(tz->device)); 
>  		tz->trips.critical.flags.enabled = 1;
>  	} else if (tz->trips.critical.flags.enabled)
>  		tz->trips.critical.flags.enabled = 0;
>  
>  	printk(KERN_EMERG
> -	       "Critical temperature reached (%ld C), shutting down.\n",
> -	       KELVIN_TO_CELSIUS(tz->temperature));
> +	       "Critical temperature reached (%ld C on [%s] with trip point set to: %ld C), shutting down.\n",
> +	       KELVIN_TO_CELSIUS(tz->temperature),
> +	       acpi_device_bid(tz->device),
> +	       KELVIN_TO_CELSIUS(tz->trips.critical.temperature));
> +

Why two printks with same info, and why is one of them WARNING and
second EMERG?

							Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [PATCH] ACPI: more verbose thermal zone shutdown message
  2007-04-15 19:11 ` Pavel Machek
@ 2007-04-16 15:58   ` Danny Kukawka
  0 siblings, 0 replies; 4+ messages in thread
From: Danny Kukawka @ 2007-04-16 15:58 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-acpi, linux-kernel, Stefan Seyfried

On Sonntag, 15. April 2007, Pavel Machek wrote:
> Hi!
> 
> > while debug some strange termal shutdowns I wrote this patch to get more 
> > information in /var/log/messages about the reason for the shutdown. I 
> > think this would be useful in general.
> > 
> > Danny
> > 
> > From: Danny Kukawka <dkukawka@suse.de>
> > Subject: ACPI: more verbose thermal zone shutdown message
> > 
> > add more information to acpi thermal zone shutdown message for easier
> > debugging
> > 
> > Signed-off-by: Danny Kukawka <dkukawka@suse.de>
> 
> Yes, please.
[..]
> Why two printks with same info, and why is one of them WARNING and
> second EMERG?

I think this is  what happen and why there are currently two messages:

* if the temperature is really critical you get (now) this:
----------------
kernel: Critical trip point (102 C) reached on Thermalzone [THM]
kernel: Critical temperature reached (150 C on [THM] with trip point set to: 
102 C), shutting down.
----------------

* and if something send a critical temp event to the thermal zone you get:
----------------
kernel: Critical temperature reached (42 C on [THM] with trip point set to: 
102 C), shutting down.
----------------

Maybe we can delete the first one, since you get now also from second 
message the information if the temperature was really critical or if 
there was an other reason for the shutdown, but in the past this was
IMO needed to differ.

Danny

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

end of thread, other threads:[~2007-04-16 16:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-05 14:15 [PATCH] ACPI: more verbose thermal zone shutdown message Danny Kukawka
2007-04-05 15:12 ` Stefan Seyfried
2007-04-15 19:11 ` Pavel Machek
2007-04-16 15:58   ` Danny Kukawka

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