All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] ACPI: hotplug messages improvement
@ 2012-07-20 16:54 Toshi Kani
  2012-07-20 16:54 ` [PATCH v2 1/4] ACPI: Add acpi_pr_<level>() interfaces Toshi Kani
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Toshi Kani @ 2012-07-20 16:54 UTC (permalink / raw)
  To: lenb, linux-acpi
  Cc: linux-kernel, joe, bhelgaas, isimatu.yasuaki, liuj97,
	srivatsa.bhat, prarit, imammedo, vijaymohan.pandarathil,
	Toshi Kani

This patchset improves logging messages for ACPI CPU, Memory, and
Container hotplug notify handlers.  The patchset introduces a set of
new macro interfaces, acpi_pr_<level>(), and updates the notify
handlers to use them.  acpi_pr_<level>() appends "ACPI" prefix and
ACPI object path to the messages.  This improves diagnostics in
hotplug operations since it identifies an object that caused an
issue in a log file.

v2:
 - Set buffer.pointer to NULL in acpi_printk().
 - Added acpi_pr_debug().

---
This patchset applies on top of the patch below.

[PATCH] ACPI: Add ACPI CPU hot-remove support
http://marc.info/?l=linux-acpi&m=134098193327362&w=2

---
Toshi Kani (4):
 ACPI: Add acpi_pr_<level>() interfaces
 ACPI: Update CPU hotplug messages
 ACPI: Update Memory hotplug messages
 ACPI: Update Container hotplug messages

---
 drivers/acpi/acpi_memhotplug.c  |   24 ++++++++++++------------
 drivers/acpi/container.c        |    6 +++---
 drivers/acpi/processor_driver.c |   36 +++++++++++++++++++++---------------
 drivers/acpi/utils.c            |   34 ++++++++++++++++++++++++++++++++++
 include/acpi/acpi_bus.h         |   20 ++++++++++++++++++++
 5 files changed, 90 insertions(+), 30 deletions(-)

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

* [PATCH v2 1/4] ACPI: Add acpi_pr_<level>() interfaces
  2012-07-20 16:54 [PATCH v2 0/4] ACPI: hotplug messages improvement Toshi Kani
@ 2012-07-20 16:54 ` Toshi Kani
  2012-07-25  7:06   ` Joe Perches
  2012-07-20 16:54 ` [PATCH v2 2/4] ACPI: Update CPU hotplug messages Toshi Kani
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Toshi Kani @ 2012-07-20 16:54 UTC (permalink / raw)
  To: lenb, linux-acpi
  Cc: linux-kernel, joe, bhelgaas, isimatu.yasuaki, liuj97,
	srivatsa.bhat, prarit, imammedo, vijaymohan.pandarathil,
	Toshi Kani

This patch introduces acpi_pr_<level>(), where <level> is a message
level such as err/warn/info, to support improved logging messages
for ACPI, esp. in hotplug operations.  acpi_pr_<level>() appends
"ACPI" prefix and ACPI object path to the messages.  This improves
diagnostics in hotplug operations since it identifies an object that
caused an issue in a log file.

acpi_pr_<level>() takes acpi_handle as an argument, which is passed
to ACPI hotplug notify handlers from the ACPI CA.  Therefore, it is
always available unlike other kernel objects, such as device.

For example, the statement below
  acpi_pr_err(handle, "Device don't exist, dropping EJECT\n");
logs an error message like this at KERN_ERR.
  ACPI: \_SB_.SCK4.CPU4: Device don't exist, dropping EJECT

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
 drivers/acpi/utils.c    |   34 ++++++++++++++++++++++++++++++++++
 include/acpi/acpi_bus.h |   20 ++++++++++++++++++++
 2 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 3e87c9c..d4311de 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -454,3 +454,37 @@ acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event,
 #endif
 }
 EXPORT_SYMBOL(acpi_evaluate_hotplug_ost);
+
+/**
+ * acpi_printk: Print messages with ACPI prefix and object path
+ *
+ * This function is intended to be called through acpi_pr_<level> macros.
+ */
+void
+acpi_printk(const char *level, acpi_handle handle, const char *fmt, ...)
+{
+	struct va_format vaf;
+	va_list args;
+	struct acpi_buffer buffer = {
+		.length = ACPI_ALLOCATE_BUFFER,
+		.pointer = NULL
+	};
+	char *path;
+	acpi_status ret;
+
+	va_start(args, fmt);
+	vaf.fmt = fmt;
+	vaf.va = &args;
+
+	ret = acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);
+	if (ret == AE_OK)
+		path = buffer.pointer;
+	else
+		path = "<n/a>";
+
+	printk("%sACPI: %s: %pV", level, path, &vaf);
+
+	va_end(args);
+	kfree(buffer.pointer);
+}
+EXPORT_SYMBOL(acpi_printk);
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index b22b774..2ceeca3 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -85,6 +85,26 @@ struct acpi_pld {
 
 acpi_status
 acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld *pld);
+
+void acpi_printk(const char *level, acpi_handle handle, const char *fmt, ...);
+
+#define acpi_pr_emerg(handle, fmt, ...)				\
+	acpi_printk(KERN_EMERG, handle, fmt, ##__VA_ARGS__)
+#define acpi_pr_alert(handle, fmt, ...)				\
+	acpi_printk(KERN_ALERT, handle, fmt, ##__VA_ARGS__)
+#define acpi_pr_crit(handle, fmt, ...)				\
+	acpi_printk(KERN_CRIT, handle, fmt, ##__VA_ARGS__)
+#define acpi_pr_err(handle, fmt, ...)				\
+	acpi_printk(KERN_ERR, handle, fmt, ##__VA_ARGS__)
+#define acpi_pr_warn(handle, fmt, ...)				\
+	acpi_printk(KERN_WARNING, handle, fmt, ##__VA_ARGS__)
+#define acpi_pr_notice(handle, fmt, ...)			\
+	acpi_printk(KERN_NOTICE, handle, fmt, ##__VA_ARGS__)
+#define acpi_pr_info(handle, fmt, ...)				\
+	acpi_printk(KERN_INFO, handle, fmt, ##__VA_ARGS__)
+#define acpi_pr_debug(handle, fmt, ...)				\
+	acpi_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__)
+
 #ifdef CONFIG_ACPI
 
 #include <linux/proc_fs.h>
-- 
1.7.7.6

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

* [PATCH v2 2/4] ACPI: Update CPU hotplug messages
  2012-07-20 16:54 [PATCH v2 0/4] ACPI: hotplug messages improvement Toshi Kani
  2012-07-20 16:54 ` [PATCH v2 1/4] ACPI: Add acpi_pr_<level>() interfaces Toshi Kani
@ 2012-07-20 16:54 ` Toshi Kani
  2012-07-20 16:54 ` [PATCH v2 3/4] ACPI: Update Memory " Toshi Kani
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Toshi Kani @ 2012-07-20 16:54 UTC (permalink / raw)
  To: lenb, linux-acpi
  Cc: linux-kernel, joe, bhelgaas, isimatu.yasuaki, liuj97,
	srivatsa.bhat, prarit, imammedo, vijaymohan.pandarathil,
	Toshi Kani

Updated CPU hotplug log messages with acpi_pr_<level>(),
dev_<level>() and pr_<level>().  Some messages are also
changed for clarity.

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
 drivers/acpi/processor_driver.c |   36 +++++++++++++++++++++---------------
 1 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index a6f6bde..40727d9 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -280,7 +280,9 @@ static int acpi_processor_get_info(struct acpi_device *device)
 		/* Declared with "Processor" statement; match ProcessorID */
 		status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);
 		if (ACPI_FAILURE(status)) {
-			printk(KERN_ERR PREFIX "Evaluating processor object\n");
+			acpi_pr_err(pr->handle,
+				"Failed to evaluate processor object (0x%x)\n",
+				status);
 			return -ENODEV;
 		}
 
@@ -299,8 +301,9 @@ static int acpi_processor_get_info(struct acpi_device *device)
 		status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID,
 						NULL, &value);
 		if (ACPI_FAILURE(status)) {
-			printk(KERN_ERR PREFIX
-			    "Evaluating processor _UID [%#x]\n", status);
+			acpi_pr_err(pr->handle,
+				"Failed to evaluate processor _UID (0x%x)\n",
+				status);
 			return -ENODEV;
 		}
 		device_declaration = 1;
@@ -343,7 +346,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
 	if (!object.processor.pblk_address)
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
 	else if (object.processor.pblk_length != 6)
-		printk(KERN_ERR PREFIX "Invalid PBLK length [%d]\n",
+		acpi_pr_err(pr->handle, "Invalid PBLK length [%d]\n",
 			    object.processor.pblk_length);
 	else {
 		pr->throttling.address = object.processor.pblk_address;
@@ -430,8 +433,8 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
 			struct cpuidle_driver *idle_driver =
 				cpuidle_get_driver();
 
-			printk(KERN_INFO "Will online and init hotplugged "
-			       "CPU: %d\n", pr->id);
+			pr_info("Will online and init hotplugged CPU: %d\n",
+				pr->id);
 			WARN(acpi_processor_start(pr), "Failed to start CPU:"
 				" %d\n", pr->id);
 			pr->flags.need_hotplug_init = 0;
@@ -496,14 +499,16 @@ static __ref int acpi_processor_start(struct acpi_processor *pr)
 				   &pr->cdev->device.kobj,
 				   "thermal_cooling");
 	if (result) {
-		printk(KERN_ERR PREFIX "Create sysfs link\n");
+		dev_err(&device->dev,
+			"Failed to create sysfs link 'thermal_cooling'\n");
 		goto err_thermal_unregister;
 	}
 	result = sysfs_create_link(&pr->cdev->device.kobj,
 				   &device->dev.kobj,
 				   "device");
 	if (result) {
-		printk(KERN_ERR PREFIX "Create sysfs link\n");
+		dev_err(&pr->cdev->device,
+			"Failed to create sysfs link 'device'\n");
 		goto err_remove_sysfs_thermal;
 	}
 
@@ -565,8 +570,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
 	 */
 	if (per_cpu(processor_device_array, pr->id) != NULL &&
 	    per_cpu(processor_device_array, pr->id) != device) {
-		printk(KERN_WARNING "BIOS reported wrong ACPI id "
-			"for the processor\n");
+		pr_warn("BIOS reported wrong ACPI id for the processor\n");
 		result = -ENODEV;
 		goto err_free_cpumask;
 	}
@@ -720,7 +724,7 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
 
 		result = acpi_processor_device_add(handle, &device);
 		if (result) {
-			pr_err(PREFIX "Unable to add the device\n");
+			acpi_pr_err(handle, "Unable to add the device\n");
 			break;
 		}
 
@@ -732,17 +736,19 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
 				  "received ACPI_NOTIFY_EJECT_REQUEST\n"));
 
 		if (acpi_bus_get_device(handle, &device)) {
-			pr_err(PREFIX "Device don't exist, dropping EJECT\n");
+			acpi_pr_err(handle,
+				"Device don't exist, dropping EJECT\n");
 			break;
 		}
 		if (!acpi_driver_data(device)) {
-			pr_err(PREFIX "Driver data is NULL, dropping EJECT\n");
+			acpi_pr_err(handle,
+				"Driver data is NULL, dropping EJECT\n");
 			break;
 		}
 
 		ej_event = kmalloc(sizeof(*ej_event), GFP_KERNEL);
 		if (!ej_event) {
-			pr_err(PREFIX "No memory, dropping EJECT\n");
+			acpi_pr_err(handle, "No memory, dropping EJECT\n");
 			break;
 		}
 
@@ -852,7 +858,7 @@ static acpi_status acpi_processor_hotadd_init(struct acpi_processor *pr)
 	 * and do it when the CPU gets online the first time
 	 * TBD: Cleanup above functions and try to do this more elegant.
 	 */
-	printk(KERN_INFO "CPU %d got hotplugged\n", pr->id);
+	pr_info("CPU %d got hotplugged\n", pr->id);
 	pr->flags.need_hotplug_init = 1;
 
 	return AE_OK;
-- 
1.7.7.6

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

* [PATCH v2 3/4] ACPI: Update Memory hotplug messages
  2012-07-20 16:54 [PATCH v2 0/4] ACPI: hotplug messages improvement Toshi Kani
  2012-07-20 16:54 ` [PATCH v2 1/4] ACPI: Add acpi_pr_<level>() interfaces Toshi Kani
  2012-07-20 16:54 ` [PATCH v2 2/4] ACPI: Update CPU hotplug messages Toshi Kani
@ 2012-07-20 16:54 ` Toshi Kani
  2012-07-20 16:54 ` [PATCH v2 4/4] ACPI: Update Container " Toshi Kani
  2012-07-25  6:15 ` [PATCH v2 0/4] ACPI: hotplug messages improvement Pandarathil, Vijaymohan R
  4 siblings, 0 replies; 11+ messages in thread
From: Toshi Kani @ 2012-07-20 16:54 UTC (permalink / raw)
  To: lenb, linux-acpi
  Cc: linux-kernel, joe, bhelgaas, isimatu.yasuaki, liuj97,
	srivatsa.bhat, prarit, imammedo, vijaymohan.pandarathil,
	Toshi Kani

Updated Memory hotplug log messages with acpi_pr_<level>()
and pr_<level>().

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
 drivers/acpi/acpi_memhotplug.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 06c55cd..dcc8f4d 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -170,7 +170,7 @@ acpi_memory_get_device(acpi_handle handle,
 	/* Get the parent device */
 	result = acpi_bus_get_device(phandle, &pdevice);
 	if (result) {
-		printk(KERN_WARNING PREFIX "Cannot get acpi bus device");
+		acpi_pr_warn(phandle, "Cannot get acpi bus device\n");
 		return -EINVAL;
 	}
 
@@ -180,14 +180,14 @@ acpi_memory_get_device(acpi_handle handle,
 	 */
 	result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
 	if (result) {
-		printk(KERN_WARNING PREFIX "Cannot add acpi bus");
+		acpi_pr_warn(handle, "Cannot add acpi bus\n");
 		return -EINVAL;
 	}
 
       end:
 	*mem_device = acpi_driver_data(device);
 	if (!(*mem_device)) {
-		printk(KERN_ERR "\n driver data not found");
+		acpi_pr_err(handle, "driver data not found\n");
 		return -ENODEV;
 	}
 
@@ -224,7 +224,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 	/* Get the range from the _CRS */
 	result = acpi_memory_get_device_resources(mem_device);
 	if (result) {
-		printk(KERN_ERR PREFIX "get_device_resources failed\n");
+		pr_err(PREFIX "get_device_resources failed\n");
 		mem_device->state = MEMORY_INVALID_STATE;
 		return result;
 	}
@@ -257,7 +257,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 		num_enabled++;
 	}
 	if (!num_enabled) {
-		printk(KERN_ERR PREFIX "add_memory failed\n");
+		acpi_pr_err(mem_device->device->handle, "add_memory failed\n");
 		mem_device->state = MEMORY_INVALID_STATE;
 		return -EINVAL;
 	}
@@ -353,7 +353,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
 			ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 					  "\nReceived DEVICE CHECK notification for device\n"));
 		if (acpi_memory_get_device(handle, &mem_device)) {
-			printk(KERN_ERR PREFIX "Cannot find driver data\n");
+			acpi_pr_err(handle, "Cannot find driver data\n");
 			break;
 		}
 
@@ -361,7 +361,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
 			break;
 
 		if (acpi_memory_enable_device(mem_device)) {
-			pr_err(PREFIX "Cannot enable memory device\n");
+			acpi_pr_err(handle, "Cannot enable memory device\n");
 			break;
 		}
 
@@ -373,12 +373,12 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
 				  "\nReceived EJECT REQUEST notification for device\n"));
 
 		if (acpi_bus_get_device(handle, &device)) {
-			printk(KERN_ERR PREFIX "Device doesn't exist\n");
+			acpi_pr_err(handle, "Device doesn't exist\n");
 			break;
 		}
 		mem_device = acpi_driver_data(device);
 		if (!mem_device) {
-			printk(KERN_ERR PREFIX "Driver Data is NULL\n");
+			acpi_pr_err(handle, "Driver Data is NULL\n");
 			break;
 		}
 
@@ -389,7 +389,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
 		 *      with generic sysfs driver
 		 */
 		if (acpi_memory_disable_device(mem_device)) {
-			pr_err(PREFIX "Disable memory device\n");
+			acpi_pr_err(handle, "Disable memory device\n");
 			/*
 			 * If _EJ0 was called but failed, _OST is not
 			 * necessary.
@@ -449,7 +449,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
 	/* Set the device state */
 	mem_device->state = MEMORY_POWER_ON_STATE;
 
-	printk(KERN_DEBUG "%s \n", acpi_device_name(device));
+	pr_debug("%s\n", acpi_device_name(device));
 
 	/*
 	 * Early boot code has recognized memory area by EFI/E820.
@@ -464,7 +464,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
 		/* call add_memory func */
 		result = acpi_memory_enable_device(mem_device);
 		if (result)
-			printk(KERN_ERR PREFIX
+			acpi_pr_err(device->handle,
 				"Error in acpi_memory_enable_device\n");
 	}
 	return result;
-- 
1.7.7.6


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

* [PATCH v2 4/4] ACPI: Update Container hotplug messages
  2012-07-20 16:54 [PATCH v2 0/4] ACPI: hotplug messages improvement Toshi Kani
                   ` (2 preceding siblings ...)
  2012-07-20 16:54 ` [PATCH v2 3/4] ACPI: Update Memory " Toshi Kani
@ 2012-07-20 16:54 ` Toshi Kani
  2012-07-25  6:15 ` [PATCH v2 0/4] ACPI: hotplug messages improvement Pandarathil, Vijaymohan R
  4 siblings, 0 replies; 11+ messages in thread
From: Toshi Kani @ 2012-07-20 16:54 UTC (permalink / raw)
  To: lenb, linux-acpi
  Cc: linux-kernel, joe, bhelgaas, isimatu.yasuaki, liuj97,
	srivatsa.bhat, prarit, imammedo, vijaymohan.pandarathil,
	Toshi Kani

Updated Container hotplug log messages with acpi_pr_<level>()
and pr_<level>().

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
 drivers/acpi/container.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index 01a986d..643e962 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -99,7 +99,7 @@ static int acpi_container_add(struct acpi_device *device)
 
 
 	if (!device) {
-		printk(KERN_ERR PREFIX "device is NULL\n");
+		pr_err(PREFIX "device is NULL\n");
 		return -EINVAL;
 	}
 
@@ -164,7 +164,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
 	case ACPI_NOTIFY_BUS_CHECK:
 		/* Fall through */
 	case ACPI_NOTIFY_DEVICE_CHECK:
-		printk(KERN_WARNING "Container driver received %s event\n",
+		pr_warn("Container driver received %s event\n",
 		       (type == ACPI_NOTIFY_BUS_CHECK) ?
 		       "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK");
 
@@ -185,7 +185,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
 
 		result = container_device_add(&device, handle);
 		if (result) {
-			pr_warn("Failed to add container\n");
+			acpi_pr_warn(handle, "Failed to add container\n");
 			break;
 		}
 
-- 
1.7.7.6

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

* RE: [PATCH v2 0/4] ACPI: hotplug messages improvement
  2012-07-20 16:54 [PATCH v2 0/4] ACPI: hotplug messages improvement Toshi Kani
                   ` (3 preceding siblings ...)
  2012-07-20 16:54 ` [PATCH v2 4/4] ACPI: Update Container " Toshi Kani
@ 2012-07-25  6:15 ` Pandarathil, Vijaymohan R
  2012-07-25 15:31   ` Toshi Kani
  4 siblings, 1 reply; 11+ messages in thread
From: Pandarathil, Vijaymohan R @ 2012-07-25  6:15 UTC (permalink / raw)
  To: Kani, Toshimitsu, lenb, linux-acpi
  Cc: linux-kernel, joe, bhelgaas, isimatu.yasuaki, liuj97,
	srivatsa.bhat, prarit, imammedo

Hi Toshi,

Tested your patches on a KVM setup. Since all your acpi_pr* macros are in the error path, I didn't see an easy way to trigger them. Instead added an acpi_pr_err() message in the success path and tested out vcpu addition/deletion sequence. No regressions seen in the functional tests and the ACPI err message comes out on the console and message buffer with a valid ACPI device path.

Vijay

Tested-by: Vijay Mohan Pandarathil<vijaymohan.pandarathil@hp.com>


-----Original Message-----
From: Kani, Toshimitsu 
Sent: Friday, July 20, 2012 9:54 AM
To: lenb@kernel.org; linux-acpi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org; joe@perches.com; bhelgaas@google.com; isimatu.yasuaki@jp.fujitsu.com; liuj97@gmail.com; srivatsa.bhat@linux.vnet.ibm.com; prarit@redhat.com; imammedo@redhat.com; Pandarathil, Vijaymohan R; Kani, Toshimitsu
Subject: [PATCH v2 0/4] ACPI: hotplug messages improvement

This patchset improves logging messages for ACPI CPU, Memory, and
Container hotplug notify handlers.  The patchset introduces a set of
new macro interfaces, acpi_pr_<level>(), and updates the notify
handlers to use them.  acpi_pr_<level>() appends "ACPI" prefix and
ACPI object path to the messages.  This improves diagnostics in
hotplug operations since it identifies an object that caused an
issue in a log file.

v2:
 - Set buffer.pointer to NULL in acpi_printk().
 - Added acpi_pr_debug().

---
This patchset applies on top of the patch below.

[PATCH] ACPI: Add ACPI CPU hot-remove support
http://marc.info/?l=linux-acpi&m=134098193327362&w=2

---
Toshi Kani (4):
 ACPI: Add acpi_pr_<level>() interfaces
 ACPI: Update CPU hotplug messages
 ACPI: Update Memory hotplug messages
 ACPI: Update Container hotplug messages

---
 drivers/acpi/acpi_memhotplug.c  |   24 ++++++++++++------------
 drivers/acpi/container.c        |    6 +++---
 drivers/acpi/processor_driver.c |   36 +++++++++++++++++++++---------------
 drivers/acpi/utils.c            |   34 ++++++++++++++++++++++++++++++++++
 include/acpi/acpi_bus.h         |   20 ++++++++++++++++++++
 5 files changed, 90 insertions(+), 30 deletions(-)

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

* Re: [PATCH v2 1/4] ACPI: Add acpi_pr_<level>() interfaces
  2012-07-20 16:54 ` [PATCH v2 1/4] ACPI: Add acpi_pr_<level>() interfaces Toshi Kani
@ 2012-07-25  7:06   ` Joe Perches
  2012-07-25 17:53     ` Toshi Kani
  0 siblings, 1 reply; 11+ messages in thread
From: Joe Perches @ 2012-07-25  7:06 UTC (permalink / raw)
  To: Toshi Kani
  Cc: lenb, linux-acpi, linux-kernel, bhelgaas, isimatu.yasuaki,
	liuj97, srivatsa.bhat, prarit, imammedo, vijaymohan.pandarathil

On Fri, 2012-07-20 at 10:54 -0600, Toshi Kani wrote:
> This patch introduces acpi_pr_<level>(), where <level> is a message
> level such as err/warn/info, to support improved logging messages
> for ACPI, esp. in hotplug operations.  acpi_pr_<level>() appends
> "ACPI" prefix and ACPI object path to the messages.  This improves
> diagnostics in hotplug operations since it identifies an object that
> caused an issue in a log file.

trivia:

> diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
[]
> @@ -454,3 +454,37 @@ acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event,
[]
> +	char *path;

const ?

> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
[]
> @@ -85,6 +85,26 @@ struct acpi_pld {
[]
> +#define acpi_pr_debug(handle, fmt, ...)				\
> +	acpi_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__)

Might be nicer if this somehow had a dynamic debug
mechanism too.


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

* RE: [PATCH v2 0/4] ACPI: hotplug messages improvement
  2012-07-25  6:15 ` [PATCH v2 0/4] ACPI: hotplug messages improvement Pandarathil, Vijaymohan R
@ 2012-07-25 15:31   ` Toshi Kani
  0 siblings, 0 replies; 11+ messages in thread
From: Toshi Kani @ 2012-07-25 15:31 UTC (permalink / raw)
  To: Pandarathil, Vijaymohan R
  Cc: lenb, linux-acpi, linux-kernel, joe, bhelgaas, isimatu.yasuaki,
	liuj97, srivatsa.bhat, prarit, imammedo

On Wed, 2012-07-25 at 06:15 +0000, Pandarathil, Vijaymohan R wrote:
> Hi Toshi,
> 
> Tested your patches on a KVM setup. Since all your acpi_pr* macros
> are in the error path, I didn't see an easy way to trigger them.
> Instead added an acpi_pr_err() message in the success path and tested
> out vcpu addition/deletion sequence. No regressions seen in the
> functional tests and the ACPI err message comes out on the console
> and message buffer with a valid ACPI device path.
> 
> Vijay
> 
> Tested-by: Vijay Mohan Pandarathil<vijaymohan.pandarathil@hp.com>

Hi Vijay,

Thanks for the testing!  It sounds good to me and that's how I tested as
well, i.e. copied all messages to the normal path.  I will add your
Tested-by to patch 1/4 and 2/4.

-Toshi


> -----Original Message-----
> From: Kani, Toshimitsu 
> Sent: Friday, July 20, 2012 9:54 AM
> To: lenb@kernel.org; linux-acpi@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org; joe@perches.com; bhelgaas@google.com; isimatu.yasuaki@jp.fujitsu.com; liuj97@gmail.com; srivatsa.bhat@linux.vnet.ibm.com; prarit@redhat.com; imammedo@redhat.com; Pandarathil, Vijaymohan R; Kani, Toshimitsu
> Subject: [PATCH v2 0/4] ACPI: hotplug messages improvement
> 
> This patchset improves logging messages for ACPI CPU, Memory, and
> Container hotplug notify handlers.  The patchset introduces a set of
> new macro interfaces, acpi_pr_<level>(), and updates the notify
> handlers to use them.  acpi_pr_<level>() appends "ACPI" prefix and
> ACPI object path to the messages.  This improves diagnostics in
> hotplug operations since it identifies an object that caused an
> issue in a log file.
> 
> v2:
>  - Set buffer.pointer to NULL in acpi_printk().
>  - Added acpi_pr_debug().
> 
> ---
> This patchset applies on top of the patch below.
> 
> [PATCH] ACPI: Add ACPI CPU hot-remove support
> http://marc.info/?l=linux-acpi&m=134098193327362&w=2
> 
> ---
> Toshi Kani (4):
>  ACPI: Add acpi_pr_<level>() interfaces
>  ACPI: Update CPU hotplug messages
>  ACPI: Update Memory hotplug messages
>  ACPI: Update Container hotplug messages
> 
> ---
>  drivers/acpi/acpi_memhotplug.c  |   24 ++++++++++++------------
>  drivers/acpi/container.c        |    6 +++---
>  drivers/acpi/processor_driver.c |   36 +++++++++++++++++++++---------------
>  drivers/acpi/utils.c            |   34 ++++++++++++++++++++++++++++++++++
>  include/acpi/acpi_bus.h         |   20 ++++++++++++++++++++
>  5 files changed, 90 insertions(+), 30 deletions(-)



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

* Re: [PATCH v2 1/4] ACPI: Add acpi_pr_<level>() interfaces
  2012-07-25  7:06   ` Joe Perches
@ 2012-07-25 17:53     ` Toshi Kani
  2012-07-25 18:11       ` Joe Perches
  0 siblings, 1 reply; 11+ messages in thread
From: Toshi Kani @ 2012-07-25 17:53 UTC (permalink / raw)
  To: Joe Perches
  Cc: lenb, linux-acpi, linux-kernel, bhelgaas, isimatu.yasuaki,
	liuj97, srivatsa.bhat, prarit, imammedo, vijaymohan.pandarathil

On Wed, 2012-07-25 at 00:06 -0700, Joe Perches wrote:
> On Fri, 2012-07-20 at 10:54 -0600, Toshi Kani wrote:
> > This patch introduces acpi_pr_<level>(), where <level> is a message
> > level such as err/warn/info, to support improved logging messages
> > for ACPI, esp. in hotplug operations.  acpi_pr_<level>() appends
> > "ACPI" prefix and ACPI object path to the messages.  This improves
> > diagnostics in hotplug operations since it identifies an object that
> > caused an issue in a log file.

Hi Joe,

Thanks for reviewing!

> trivia:

Did you mean to say something more on this?  Just checking...

> > diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
> []
> > @@ -454,3 +454,37 @@ acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event,
> []
> > +	char *path;
> 
> const ?

Agreed.  I will update with the change.

> > diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> []
> > @@ -85,6 +85,26 @@ struct acpi_pld {
> []
> > +#define acpi_pr_debug(handle, fmt, ...)				\
> > +	acpi_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__)
> 
> Might be nicer if this somehow had a dynamic debug
> mechanism too.

Good point!  I will try to add a dynamic debug mechanism on this.

Thanks,
-Toshi



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

* Re: [PATCH v2 1/4] ACPI: Add acpi_pr_<level>() interfaces
  2012-07-25 17:53     ` Toshi Kani
@ 2012-07-25 18:11       ` Joe Perches
  2012-07-25 18:30         ` Toshi Kani
  0 siblings, 1 reply; 11+ messages in thread
From: Joe Perches @ 2012-07-25 18:11 UTC (permalink / raw)
  To: Toshi Kani
  Cc: lenb, linux-acpi, linux-kernel, bhelgaas, isimatu.yasuaki,
	liuj97, srivatsa.bhat, prarit, imammedo, vijaymohan.pandarathil

On Wed, 2012-07-25 at 11:53 -0600, Toshi Kani wrote:
> On Wed, 2012-07-25 at 00:06 -0700, Joe Perches wrote:
> > On Fri, 2012-07-20 at 10:54 -0600, Toshi Kani wrote:
> > > This patch introduces acpi_pr_<level>(), where <level> is a message
> > > level such as err/warn/info, to support improved logging messages
> > > for ACPI, esp. in hotplug operations.  acpi_pr_<level>() appends
> > > "ACPI" prefix and ACPI object path to the messages.  This improves
> > > diagnostics in hotplug operations since it identifies an object that
> > > caused an issue in a log file.
> 
> Hi Joe,
> 
> Thanks for reviewing!
> 
> > trivia:
> 
> Did you mean to say something more on this?  Just checking...

No.  I just intended to note that the comments that followed
weren't particularly important nor should it really stop the
patch from being applied if you didn't want to update it.

cheers, Joe


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

* Re: [PATCH v2 1/4] ACPI: Add acpi_pr_<level>() interfaces
  2012-07-25 18:11       ` Joe Perches
@ 2012-07-25 18:30         ` Toshi Kani
  0 siblings, 0 replies; 11+ messages in thread
From: Toshi Kani @ 2012-07-25 18:30 UTC (permalink / raw)
  To: Joe Perches
  Cc: lenb, linux-acpi, linux-kernel, bhelgaas, isimatu.yasuaki,
	liuj97, srivatsa.bhat, prarit, imammedo, vijaymohan.pandarathil

On Wed, 2012-07-25 at 11:11 -0700, Joe Perches wrote:
> On Wed, 2012-07-25 at 11:53 -0600, Toshi Kani wrote:
> > On Wed, 2012-07-25 at 00:06 -0700, Joe Perches wrote:
> > > On Fri, 2012-07-20 at 10:54 -0600, Toshi Kani wrote:
> > > > This patch introduces acpi_pr_<level>(), where <level> is a message
> > > > level such as err/warn/info, to support improved logging messages
> > > > for ACPI, esp. in hotplug operations.  acpi_pr_<level>() appends
> > > > "ACPI" prefix and ACPI object path to the messages.  This improves
> > > > diagnostics in hotplug operations since it identifies an object that
> > > > caused an issue in a log file.
> > 
> > Hi Joe,
> > 
> > Thanks for reviewing!
> > 
> > > trivia:
> > 
> > Did you mean to say something more on this?  Just checking...
> 
> No.  I just intended to note that the comments that followed
> weren't particularly important nor should it really stop the
> patch from being applied if you didn't want to update it.
> 
> cheers, Joe

Thanks Joe for the clarification and suggestion.  If the dynamic debug
change becomes something non-trivial, I will postpone it.

-Toshi



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

end of thread, other threads:[~2012-07-25 18:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 16:54 [PATCH v2 0/4] ACPI: hotplug messages improvement Toshi Kani
2012-07-20 16:54 ` [PATCH v2 1/4] ACPI: Add acpi_pr_<level>() interfaces Toshi Kani
2012-07-25  7:06   ` Joe Perches
2012-07-25 17:53     ` Toshi Kani
2012-07-25 18:11       ` Joe Perches
2012-07-25 18:30         ` Toshi Kani
2012-07-20 16:54 ` [PATCH v2 2/4] ACPI: Update CPU hotplug messages Toshi Kani
2012-07-20 16:54 ` [PATCH v2 3/4] ACPI: Update Memory " Toshi Kani
2012-07-20 16:54 ` [PATCH v2 4/4] ACPI: Update Container " Toshi Kani
2012-07-25  6:15 ` [PATCH v2 0/4] ACPI: hotplug messages improvement Pandarathil, Vijaymohan R
2012-07-25 15:31   ` Toshi Kani

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.