Commit c5612c19 authored by Michael Holzheu's avatar Michael Holzheu Committed by Martin Schwidefsky

[S390] convert s390 debug feature printks to pr_xxx macros.

Signed-off-by: default avatarMichael Holzheu <holzheu@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent a4f5a299
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
* Bugreports to: <Linux390@de.ibm.com> * Bugreports to: <Linux390@de.ibm.com>
*/ */
#define KMSG_COMPONENT "s390dbf"
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h> #include <linux/errno.h>
...@@ -693,8 +696,8 @@ debug_info_t *debug_register_mode(const char *name, int pages_per_area, ...@@ -693,8 +696,8 @@ debug_info_t *debug_register_mode(const char *name, int pages_per_area,
/* Since debugfs currently does not support uid/gid other than root, */ /* Since debugfs currently does not support uid/gid other than root, */
/* we do not allow gid/uid != 0 until we get support for that. */ /* we do not allow gid/uid != 0 until we get support for that. */
if ((uid != 0) || (gid != 0)) if ((uid != 0) || (gid != 0))
printk(KERN_WARNING "debug: Warning - Currently only uid/gid " pr_warning("Root becomes the owner of all s390dbf files "
"= 0 are supported. Using root as owner now!"); "in sysfs\n");
if (!initialized) if (!initialized)
BUG(); BUG();
mutex_lock(&debug_mutex); mutex_lock(&debug_mutex);
...@@ -709,7 +712,7 @@ debug_info_t *debug_register_mode(const char *name, int pages_per_area, ...@@ -709,7 +712,7 @@ debug_info_t *debug_register_mode(const char *name, int pages_per_area,
debug_register_view(rc, &debug_pages_view); debug_register_view(rc, &debug_pages_view);
out: out:
if (!rc){ if (!rc){
printk(KERN_ERR "debug: debug_register failed for %s\n",name); pr_err("Registering debug feature %s failed\n", name);
} }
mutex_unlock(&debug_mutex); mutex_unlock(&debug_mutex);
return rc; return rc;
...@@ -763,8 +766,8 @@ debug_set_size(debug_info_t* id, int nr_areas, int pages_per_area) ...@@ -763,8 +766,8 @@ debug_set_size(debug_info_t* id, int nr_areas, int pages_per_area)
if(pages_per_area > 0){ if(pages_per_area > 0){
new_areas = debug_areas_alloc(pages_per_area, nr_areas); new_areas = debug_areas_alloc(pages_per_area, nr_areas);
if(!new_areas) { if(!new_areas) {
printk(KERN_WARNING "debug: could not allocate memory "\ pr_info("Allocating memory for %i pages failed\n",
"for pagenumber: %i\n",pages_per_area); pages_per_area);
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
} }
...@@ -780,8 +783,7 @@ debug_set_size(debug_info_t* id, int nr_areas, int pages_per_area) ...@@ -780,8 +783,7 @@ debug_set_size(debug_info_t* id, int nr_areas, int pages_per_area)
memset(id->active_entries,0,sizeof(int)*id->nr_areas); memset(id->active_entries,0,sizeof(int)*id->nr_areas);
memset(id->active_pages, 0, sizeof(int)*id->nr_areas); memset(id->active_pages, 0, sizeof(int)*id->nr_areas);
spin_unlock_irqrestore(&id->lock,flags); spin_unlock_irqrestore(&id->lock,flags);
printk(KERN_INFO "debug: %s: set new size (%i pages)\n"\ pr_info("%s: set new size (%i pages)\n" ,id->name, pages_per_area);
,id->name, pages_per_area);
out: out:
return rc; return rc;
} }
...@@ -800,10 +802,9 @@ debug_set_level(debug_info_t* id, int new_level) ...@@ -800,10 +802,9 @@ debug_set_level(debug_info_t* id, int new_level)
spin_lock_irqsave(&id->lock,flags); spin_lock_irqsave(&id->lock,flags);
if(new_level == DEBUG_OFF_LEVEL){ if(new_level == DEBUG_OFF_LEVEL){
id->level = DEBUG_OFF_LEVEL; id->level = DEBUG_OFF_LEVEL;
printk(KERN_INFO "debug: %s: switched off\n",id->name); pr_info("%s: switched off\n",id->name);
} else if ((new_level > DEBUG_MAX_LEVEL) || (new_level < 0)) { } else if ((new_level > DEBUG_MAX_LEVEL) || (new_level < 0)) {
printk(KERN_INFO pr_info("%s: level %i is out of range (%i - %i)\n",
"debug: %s: level %i is out of range (%i - %i)\n",
id->name, new_level, 0, DEBUG_MAX_LEVEL); id->name, new_level, 0, DEBUG_MAX_LEVEL);
} else { } else {
id->level = new_level; id->level = new_level;
...@@ -1108,8 +1109,8 @@ debug_register_view(debug_info_t * id, struct debug_view *view) ...@@ -1108,8 +1109,8 @@ debug_register_view(debug_info_t * id, struct debug_view *view)
pde = debugfs_create_file(view->name, mode, id->debugfs_root_entry, pde = debugfs_create_file(view->name, mode, id->debugfs_root_entry,
id , &debug_file_ops); id , &debug_file_ops);
if (!pde){ if (!pde){
printk(KERN_WARNING "debug: debugfs_create_file() failed!"\ pr_err("Registering view %s/%s failed due to out of "
" Cannot register view %s/%s\n", id->name,view->name); "memory\n", id->name,view->name);
rc = -1; rc = -1;
goto out; goto out;
} }
...@@ -1119,10 +1120,8 @@ debug_register_view(debug_info_t * id, struct debug_view *view) ...@@ -1119,10 +1120,8 @@ debug_register_view(debug_info_t * id, struct debug_view *view)
break; break;
} }
if (i == DEBUG_MAX_VIEWS) { if (i == DEBUG_MAX_VIEWS) {
printk(KERN_WARNING "debug: cannot register view %s/%s\n", pr_err("Registering view %s/%s would exceed the maximum "
id->name,view->name); "number of views %i\n", id->name, view->name, i);
printk(KERN_WARNING
"debug: maximum number of views reached (%i)!\n", i);
debugfs_remove(pde); debugfs_remove(pde);
rc = -1; rc = -1;
} else { } else {
...@@ -1303,7 +1302,8 @@ debug_input_level_fn(debug_info_t * id, struct debug_view *view, ...@@ -1303,7 +1302,8 @@ debug_input_level_fn(debug_info_t * id, struct debug_view *view,
new_level = debug_get_uint(str); new_level = debug_get_uint(str);
} }
if(new_level < 0) { if(new_level < 0) {
printk(KERN_INFO "debug: level `%s` is not valid\n", str); pr_warning("%s is not a valid level for a debug "
"feature\n", str);
rc = -EINVAL; rc = -EINVAL;
} else { } else {
debug_set_level(id, new_level); debug_set_level(id, new_level);
...@@ -1380,7 +1380,8 @@ debug_input_flush_fn(debug_info_t * id, struct debug_view *view, ...@@ -1380,7 +1380,8 @@ debug_input_flush_fn(debug_info_t * id, struct debug_view *view,
goto out; goto out;
} }
printk(KERN_INFO "debug: area `%c` is not valid\n", input_buf[0]); pr_info("Flushing debug data failed because %c is not a valid "
"area\n", input_buf[0]);
out: out:
*offset += user_len; *offset += user_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment