diff options
Diffstat (limited to 'arch/s390/kernel/debug.c')
| -rw-r--r-- | arch/s390/kernel/debug.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index d80fcd4a7fe1..ba03fc0a3a56 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
| @@ -10,6 +10,9 @@ | |||
| 10 | * Bugreports to: <Linux390@de.ibm.com> | 10 | * Bugreports to: <Linux390@de.ibm.com> |
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #define KMSG_COMPONENT "s390dbf" | ||
| 14 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | ||
| 15 | |||
| 13 | #include <linux/stddef.h> | 16 | #include <linux/stddef.h> |
| 14 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
| 15 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
| @@ -388,7 +391,7 @@ debug_info_copy(debug_info_t* in, int mode) | |||
| 388 | debug_info_free(rc); | 391 | debug_info_free(rc); |
| 389 | } while (1); | 392 | } while (1); |
| 390 | 393 | ||
| 391 | if(!rc || (mode == NO_AREAS)) | 394 | if (mode == NO_AREAS) |
| 392 | goto out; | 395 | goto out; |
| 393 | 396 | ||
| 394 | for(i = 0; i < in->nr_areas; i++){ | 397 | for(i = 0; i < in->nr_areas; i++){ |
| @@ -693,8 +696,8 @@ debug_info_t *debug_register_mode(const char *name, int pages_per_area, | |||
| 693 | /* Since debugfs currently does not support uid/gid other than root, */ | 696 | /* Since debugfs currently does not support uid/gid other than root, */ |
| 694 | /* we do not allow gid/uid != 0 until we get support for that. */ | 697 | /* we do not allow gid/uid != 0 until we get support for that. */ |
| 695 | if ((uid != 0) || (gid != 0)) | 698 | if ((uid != 0) || (gid != 0)) |
| 696 | printk(KERN_WARNING "debug: Warning - Currently only uid/gid " | 699 | pr_warning("Root becomes the owner of all s390dbf files " |
| 697 | "= 0 are supported. Using root as owner now!"); | 700 | "in sysfs\n"); |
| 698 | if (!initialized) | 701 | if (!initialized) |
| 699 | BUG(); | 702 | BUG(); |
| 700 | mutex_lock(&debug_mutex); | 703 | mutex_lock(&debug_mutex); |
| @@ -709,7 +712,7 @@ debug_info_t *debug_register_mode(const char *name, int pages_per_area, | |||
| 709 | debug_register_view(rc, &debug_pages_view); | 712 | debug_register_view(rc, &debug_pages_view); |
| 710 | out: | 713 | out: |
| 711 | if (!rc){ | 714 | if (!rc){ |
| 712 | printk(KERN_ERR "debug: debug_register failed for %s\n",name); | 715 | pr_err("Registering debug feature %s failed\n", name); |
| 713 | } | 716 | } |
| 714 | mutex_unlock(&debug_mutex); | 717 | mutex_unlock(&debug_mutex); |
| 715 | return rc; | 718 | return rc; |
| @@ -763,8 +766,8 @@ debug_set_size(debug_info_t* id, int nr_areas, int pages_per_area) | |||
| 763 | if(pages_per_area > 0){ | 766 | if(pages_per_area > 0){ |
| 764 | new_areas = debug_areas_alloc(pages_per_area, nr_areas); | 767 | new_areas = debug_areas_alloc(pages_per_area, nr_areas); |
| 765 | if(!new_areas) { | 768 | if(!new_areas) { |
| 766 | printk(KERN_WARNING "debug: could not allocate memory "\ | 769 | pr_info("Allocating memory for %i pages failed\n", |
| 767 | "for pagenumber: %i\n",pages_per_area); | 770 | pages_per_area); |
| 768 | rc = -ENOMEM; | 771 | rc = -ENOMEM; |
| 769 | goto out; | 772 | goto out; |
| 770 | } | 773 | } |
| @@ -780,8 +783,7 @@ debug_set_size(debug_info_t* id, int nr_areas, int pages_per_area) | |||
| 780 | memset(id->active_entries,0,sizeof(int)*id->nr_areas); | 783 | memset(id->active_entries,0,sizeof(int)*id->nr_areas); |
| 781 | memset(id->active_pages, 0, sizeof(int)*id->nr_areas); | 784 | memset(id->active_pages, 0, sizeof(int)*id->nr_areas); |
| 782 | spin_unlock_irqrestore(&id->lock,flags); | 785 | spin_unlock_irqrestore(&id->lock,flags); |
| 783 | printk(KERN_INFO "debug: %s: set new size (%i pages)\n"\ | 786 | pr_info("%s: set new size (%i pages)\n" ,id->name, pages_per_area); |
| 784 | ,id->name, pages_per_area); | ||
| 785 | out: | 787 | out: |
| 786 | return rc; | 788 | return rc; |
| 787 | } | 789 | } |
| @@ -800,10 +802,9 @@ debug_set_level(debug_info_t* id, int new_level) | |||
| 800 | spin_lock_irqsave(&id->lock,flags); | 802 | spin_lock_irqsave(&id->lock,flags); |
| 801 | if(new_level == DEBUG_OFF_LEVEL){ | 803 | if(new_level == DEBUG_OFF_LEVEL){ |
| 802 | id->level = DEBUG_OFF_LEVEL; | 804 | id->level = DEBUG_OFF_LEVEL; |
| 803 | printk(KERN_INFO "debug: %s: switched off\n",id->name); | 805 | pr_info("%s: switched off\n",id->name); |
| 804 | } else if ((new_level > DEBUG_MAX_LEVEL) || (new_level < 0)) { | 806 | } else if ((new_level > DEBUG_MAX_LEVEL) || (new_level < 0)) { |
| 805 | printk(KERN_INFO | 807 | pr_info("%s: level %i is out of range (%i - %i)\n", |
| 806 | "debug: %s: level %i is out of range (%i - %i)\n", | ||
| 807 | id->name, new_level, 0, DEBUG_MAX_LEVEL); | 808 | id->name, new_level, 0, DEBUG_MAX_LEVEL); |
| 808 | } else { | 809 | } else { |
| 809 | id->level = new_level; | 810 | id->level = new_level; |
| @@ -1108,8 +1109,8 @@ debug_register_view(debug_info_t * id, struct debug_view *view) | |||
| 1108 | pde = debugfs_create_file(view->name, mode, id->debugfs_root_entry, | 1109 | pde = debugfs_create_file(view->name, mode, id->debugfs_root_entry, |
| 1109 | id , &debug_file_ops); | 1110 | id , &debug_file_ops); |
| 1110 | if (!pde){ | 1111 | if (!pde){ |
| 1111 | printk(KERN_WARNING "debug: debugfs_create_file() failed!"\ | 1112 | pr_err("Registering view %s/%s failed due to out of " |
| 1112 | " Cannot register view %s/%s\n", id->name,view->name); | 1113 | "memory\n", id->name,view->name); |
| 1113 | rc = -1; | 1114 | rc = -1; |
| 1114 | goto out; | 1115 | goto out; |
| 1115 | } | 1116 | } |
| @@ -1119,10 +1120,8 @@ debug_register_view(debug_info_t * id, struct debug_view *view) | |||
| 1119 | break; | 1120 | break; |
| 1120 | } | 1121 | } |
| 1121 | if (i == DEBUG_MAX_VIEWS) { | 1122 | if (i == DEBUG_MAX_VIEWS) { |
| 1122 | printk(KERN_WARNING "debug: cannot register view %s/%s\n", | 1123 | pr_err("Registering view %s/%s would exceed the maximum " |
| 1123 | id->name,view->name); | 1124 | "number of views %i\n", id->name, view->name, i); |
| 1124 | printk(KERN_WARNING | ||
| 1125 | "debug: maximum number of views reached (%i)!\n", i); | ||
| 1126 | debugfs_remove(pde); | 1125 | debugfs_remove(pde); |
| 1127 | rc = -1; | 1126 | rc = -1; |
| 1128 | } else { | 1127 | } else { |
| @@ -1303,7 +1302,8 @@ debug_input_level_fn(debug_info_t * id, struct debug_view *view, | |||
| 1303 | new_level = debug_get_uint(str); | 1302 | new_level = debug_get_uint(str); |
| 1304 | } | 1303 | } |
| 1305 | if(new_level < 0) { | 1304 | if(new_level < 0) { |
| 1306 | printk(KERN_INFO "debug: level `%s` is not valid\n", str); | 1305 | pr_warning("%s is not a valid level for a debug " |
| 1306 | "feature\n", str); | ||
| 1307 | rc = -EINVAL; | 1307 | rc = -EINVAL; |
| 1308 | } else { | 1308 | } else { |
| 1309 | debug_set_level(id, new_level); | 1309 | debug_set_level(id, new_level); |
| @@ -1380,7 +1380,8 @@ debug_input_flush_fn(debug_info_t * id, struct debug_view *view, | |||
| 1380 | goto out; | 1380 | goto out; |
| 1381 | } | 1381 | } |
| 1382 | 1382 | ||
| 1383 | printk(KERN_INFO "debug: area `%c` is not valid\n", input_buf[0]); | 1383 | pr_info("Flushing debug data failed because %c is not a valid " |
| 1384 | "area\n", input_buf[0]); | ||
| 1384 | 1385 | ||
| 1385 | out: | 1386 | out: |
| 1386 | *offset += user_len; | 1387 | *offset += user_len; |
