aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/debug.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-22 21:15:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-22 21:15:32 -0400
commitdb1417967959569599da2a4bd0ffb93b17ad795f (patch)
tree08751414d5f4a9e264af924154ed3543a8e573a9 /arch/s390/kernel/debug.c
parent48aab2f79dfc1357c48ce22ff5c989b52a590069 (diff)
parentc6da39f26cfe475704ec521723192e520e8f51b8 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 patches from Martin Schwidefsky: "The biggest patch is the rework of the smp code, something I wanted to do for some time. There are some patches for our various dump methods and one new thing: z/VM LGR detection. LGR stands for linux-guest- relocation and is the guest migration feature of z/VM. For debugging purposes we keep a log of the systems where a specific guest has lived." Fix up trivial conflict in arch/s390/kernel/smp.c due to the scheduler cleanup having removed some code next to removed s390 code. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: [S390] kernel: Pass correct stack for smp_call_ipl_cpu() [S390] Ensure that vmcore_info pointer is never accessed directly [S390] dasd: prevent validate server for offline devices [S390] Remove monolithic build option for zcrypt driver. [S390] stack dump: fix indentation in output [S390] kernel: Add OS info memory interface [S390] Use block_sigmask() [S390] kernel: Add z/VM LGR detection [S390] irq: external interrupt code passing [S390] irq: set __ARCH_IRQ_EXIT_IRQS_DISABLED [S390] zfcpdump: Implement async sdias event processing [S390] Use copy_to_absolute_zero() instead of "stura/sturg" [S390] rework idle code [S390] rework smp code [S390] rename lowcore field [S390] Fix gcc 4.6.0 compile warning
Diffstat (limited to 'arch/s390/kernel/debug.c')
-rw-r--r--arch/s390/kernel/debug.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 6848828b962..19e5e9eba54 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -2,8 +2,8 @@
2 * arch/s390/kernel/debug.c 2 * arch/s390/kernel/debug.c
3 * S/390 debug facility 3 * S/390 debug facility
4 * 4 *
5 * Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH, 5 * Copyright IBM Corp. 1999, 2012
6 * IBM Corporation 6 *
7 * Author(s): Michael Holzheu (holzheu@de.ibm.com), 7 * Author(s): Michael Holzheu (holzheu@de.ibm.com),
8 * Holger Smolinski (Holger.Smolinski@de.ibm.com) 8 * Holger Smolinski (Holger.Smolinski@de.ibm.com)
9 * 9 *
@@ -167,6 +167,7 @@ static debug_info_t *debug_area_last = NULL;
167static DEFINE_MUTEX(debug_mutex); 167static DEFINE_MUTEX(debug_mutex);
168 168
169static int initialized; 169static int initialized;
170static int debug_critical;
170 171
171static const struct file_operations debug_file_ops = { 172static const struct file_operations debug_file_ops = {
172 .owner = THIS_MODULE, 173 .owner = THIS_MODULE,
@@ -932,6 +933,11 @@ debug_stop_all(void)
932} 933}
933 934
934 935
936void debug_set_critical(void)
937{
938 debug_critical = 1;
939}
940
935/* 941/*
936 * debug_event_common: 942 * debug_event_common:
937 * - write debug entry with given size 943 * - write debug entry with given size
@@ -945,7 +951,11 @@ debug_event_common(debug_info_t * id, int level, const void *buf, int len)
945 951
946 if (!debug_active || !id->areas) 952 if (!debug_active || !id->areas)
947 return NULL; 953 return NULL;
948 spin_lock_irqsave(&id->lock, flags); 954 if (debug_critical) {
955 if (!spin_trylock_irqsave(&id->lock, flags))
956 return NULL;
957 } else
958 spin_lock_irqsave(&id->lock, flags);
949 active = get_active_entry(id); 959 active = get_active_entry(id);
950 memset(DEBUG_DATA(active), 0, id->buf_size); 960 memset(DEBUG_DATA(active), 0, id->buf_size);
951 memcpy(DEBUG_DATA(active), buf, min(len, id->buf_size)); 961 memcpy(DEBUG_DATA(active), buf, min(len, id->buf_size));
@@ -968,7 +978,11 @@ debug_entry_t
968 978
969 if (!debug_active || !id->areas) 979 if (!debug_active || !id->areas)
970 return NULL; 980 return NULL;
971 spin_lock_irqsave(&id->lock, flags); 981 if (debug_critical) {
982 if (!spin_trylock_irqsave(&id->lock, flags))
983 return NULL;
984 } else
985 spin_lock_irqsave(&id->lock, flags);
972 active = get_active_entry(id); 986 active = get_active_entry(id);
973 memset(DEBUG_DATA(active), 0, id->buf_size); 987 memset(DEBUG_DATA(active), 0, id->buf_size);
974 memcpy(DEBUG_DATA(active), buf, min(len, id->buf_size)); 988 memcpy(DEBUG_DATA(active), buf, min(len, id->buf_size));
@@ -1013,7 +1027,11 @@ debug_sprintf_event(debug_info_t* id, int level,char *string,...)
1013 return NULL; 1027 return NULL;
1014 numargs=debug_count_numargs(string); 1028 numargs=debug_count_numargs(string);
1015 1029
1016 spin_lock_irqsave(&id->lock, flags); 1030 if (debug_critical) {
1031 if (!spin_trylock_irqsave(&id->lock, flags))
1032 return NULL;
1033 } else
1034 spin_lock_irqsave(&id->lock, flags);
1017 active = get_active_entry(id); 1035 active = get_active_entry(id);
1018 curr_event=(debug_sprintf_entry_t *) DEBUG_DATA(active); 1036 curr_event=(debug_sprintf_entry_t *) DEBUG_DATA(active);
1019 va_start(ap,string); 1037 va_start(ap,string);
@@ -1047,7 +1065,11 @@ debug_sprintf_exception(debug_info_t* id, int level,char *string,...)
1047 1065
1048 numargs=debug_count_numargs(string); 1066 numargs=debug_count_numargs(string);
1049 1067
1050 spin_lock_irqsave(&id->lock, flags); 1068 if (debug_critical) {
1069 if (!spin_trylock_irqsave(&id->lock, flags))
1070 return NULL;
1071 } else
1072 spin_lock_irqsave(&id->lock, flags);
1051 active = get_active_entry(id); 1073 active = get_active_entry(id);
1052 curr_event=(debug_sprintf_entry_t *)DEBUG_DATA(active); 1074 curr_event=(debug_sprintf_entry_t *)DEBUG_DATA(active);
1053 va_start(ap,string); 1075 va_start(ap,string);
@@ -1428,10 +1450,10 @@ debug_hex_ascii_format_fn(debug_info_t * id, struct debug_view *view,
1428 rc += sprintf(out_buf + rc, "| "); 1450 rc += sprintf(out_buf + rc, "| ");
1429 for (i = 0; i < id->buf_size; i++) { 1451 for (i = 0; i < id->buf_size; i++) {
1430 unsigned char c = in_buf[i]; 1452 unsigned char c = in_buf[i];
1431 if (!isprint(c)) 1453 if (isascii(c) && isprint(c))
1432 rc += sprintf(out_buf + rc, ".");
1433 else
1434 rc += sprintf(out_buf + rc, "%c", c); 1454 rc += sprintf(out_buf + rc, "%c", c);
1455 else
1456 rc += sprintf(out_buf + rc, ".");
1435 } 1457 }
1436 rc += sprintf(out_buf + rc, "\n"); 1458 rc += sprintf(out_buf + rc, "\n");
1437 return rc; 1459 return rc;