avoid hypervisor panic when printing lock profiling information
authorJuergen Gross <juergen.gross@ts.fujitsu.com>
Mon, 7 Nov 2011 14:37:51 +0000 (14:37 +0000)
committerJuergen Gross <juergen.gross@ts.fujitsu.com>
Mon, 7 Nov 2011 14:37:51 +0000 (14:37 +0000)
When printing lock profiling information via keyhandler in the
hypervisor the system will panic. This patch corrects the problem.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
xen/common/spinlock.c

index 14ecfd7f3da5e9a5a26c67fcffda7a128e5de06a..ecf5b441df6c276c751398ac22dfc2b36488355c 100644 (file)
@@ -458,9 +458,9 @@ static void spinlock_profile_print_elem(struct lock_profile *data,
     int32_t type, int32_t idx, void *par)
 {
     if ( type == LOCKPROF_TYPE_GLOBAL )
-        printk("%s %s:\n", lock_profile_ancs[idx].name, data->name);
+        printk("%s %s:\n", lock_profile_ancs[type].name, data->name);
     else
-        printk("%s %d %s:\n", lock_profile_ancs[idx].name, idx, data->name);
+        printk("%s %d %s:\n", lock_profile_ancs[type].name, idx, data->name);
     printk("  lock:%12"PRId64"(%08X:%08X), block:%12"PRId64"(%08X:%08X)\n",
            data->lock_cnt, (u32)(data->time_hold >> 32), (u32)data->time_hold,
            data->block_cnt, (u32)(data->time_block >> 32),