aboutsummaryrefslogtreecommitdiff
path: root/include/asm-s390
diff options
context:
space:
mode:
authorMichael Holzheu <holzheu@de.ibm.com>2005-06-25 14:55:33 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 16:24:37 -0700
commit66a464dbc8e0345b6f972b92bf1118e043d7c987 (patch)
tree4c8f83ce6b1879556025fe77b97629a8380aa4dd /include/asm-s390
parent6b979de395c7e1b7e59f74a870e1d1911853eccb (diff)
[PATCH] s390: debug feature changes
This patch changes the memory allocation method for the s390 debug feature. Trace buffers had been allocated using the get_free_pages() function before. Therefore it was not possible to get big memory areas in a running system due to memory fragmentation. Now the trace buffers are subdivided into several subbuffers with pagesize. Therefore it is now possible to allocate more memory for the trace buffers and more trace records can be written. In addition to that, dynamic specification of the size of the trace buffers is implemented. It is now possible to change the size of a trace buffer using a new debugfs file instance. When writing a number into this file, the trace buffer size is changed to 'number * pagesize'. In the past all the traces could be obtained from userspace by accessing files in the "proc" filesystem. Now with debugfs we have a new filesystem which should be used for debugging purposes. This patch moves the debug feature from procfs to debugfs. Since the interface of debug_register() changed, all device drivers, which use the debug feature had to be adjusted. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-s390')
-rw-r--r--include/asm-s390/debug.h48
1 files changed, 29 insertions, 19 deletions
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index 6bbcdea42a8..92360d90144 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -9,6 +9,8 @@
#ifndef DEBUG_H
#define DEBUG_H
+#include <linux/config.h>
+#include <linux/fs.h>
#include <linux/string.h>
/* Note:
@@ -31,19 +33,18 @@ struct __debug_entry{
} __attribute__((packed));
-#define __DEBUG_FEATURE_VERSION 1 /* version of debug feature */
+#define __DEBUG_FEATURE_VERSION 2 /* version of debug feature */
#ifdef __KERNEL__
#include <linux/spinlock.h>
#include <linux/kernel.h>
#include <linux/time.h>
-#include <linux/proc_fs.h>
#define DEBUG_MAX_LEVEL 6 /* debug levels range from 0 to 6 */
#define DEBUG_OFF_LEVEL -1 /* level where debug is switched off */
#define DEBUG_FLUSH_ALL -1 /* parameter to flush all areas */
#define DEBUG_MAX_VIEWS 10 /* max number of views in proc fs */
-#define DEBUG_MAX_PROCF_LEN 64 /* max length for a proc file name */
+#define DEBUG_MAX_NAME_LEN 64 /* max length for a debugfs file name */
#define DEBUG_DEFAULT_LEVEL 3 /* initial debug level */
#define DEBUG_DIR_ROOT "s390dbf" /* name of debug root directory in proc fs */
@@ -64,16 +65,17 @@ typedef struct debug_info {
spinlock_t lock;
int level;
int nr_areas;
- int page_order;
+ int pages_per_area;
int buf_size;
int entry_size;
- debug_entry_t** areas;
+ debug_entry_t*** areas;
int active_area;
- int *active_entry;
- struct proc_dir_entry* proc_root_entry;
- struct proc_dir_entry* proc_entries[DEBUG_MAX_VIEWS];
+ int *active_pages;
+ int *active_entries;
+ struct dentry* debugfs_root_entry;
+ struct dentry* debugfs_entries[DEBUG_MAX_VIEWS];
struct debug_view* views[DEBUG_MAX_VIEWS];
- char name[DEBUG_MAX_PROCF_LEN];
+ char name[DEBUG_MAX_NAME_LEN];
} debug_info_t;
typedef int (debug_header_proc_t) (debug_info_t* id,
@@ -98,7 +100,7 @@ int debug_dflt_header_fn(debug_info_t* id, struct debug_view* view,
int area, debug_entry_t* entry, char* out_buf);
struct debug_view {
- char name[DEBUG_MAX_PROCF_LEN];
+ char name[DEBUG_MAX_NAME_LEN];
debug_prolog_proc_t* prolog_proc;
debug_header_proc_t* header_proc;
debug_format_proc_t* format_proc;
@@ -120,7 +122,7 @@ debug_entry_t* debug_exception_common(debug_info_t* id, int level,
/* Debug Feature API: */
-debug_info_t* debug_register(char* name, int pages_index, int nr_areas,
+debug_info_t* debug_register(char* name, int pages, int nr_areas,
int buf_size);
void debug_unregister(debug_info_t* id);
@@ -132,7 +134,8 @@ void debug_stop_all(void);
extern inline debug_entry_t*
debug_event(debug_info_t* id, int level, void* data, int length)
{
- if ((!id) || (level > id->level)) return NULL;
+ if ((!id) || (level > id->level) || (id->pages_per_area == 0))
+ return NULL;
return debug_event_common(id,level,data,length);
}
@@ -140,7 +143,8 @@ extern inline debug_entry_t*
debug_int_event(debug_info_t* id, int level, unsigned int tag)
{
unsigned int t=tag;
- if ((!id) || (level > id->level)) return NULL;
+ if ((!id) || (level > id->level) || (id->pages_per_area == 0))
+ return NULL;
return debug_event_common(id,level,&t,sizeof(unsigned int));
}
@@ -148,14 +152,16 @@ extern inline debug_entry_t *
debug_long_event (debug_info_t* id, int level, unsigned long tag)
{
unsigned long t=tag;
- if ((!id) || (level > id->level)) return NULL;
+ if ((!id) || (level > id->level) || (id->pages_per_area == 0))
+ return NULL;
return debug_event_common(id,level,&t,sizeof(unsigned long));
}
extern inline debug_entry_t*
debug_text_event(debug_info_t* id, int level, const char* txt)
{
- if ((!id) || (level > id->level)) return NULL;
+ if ((!id) || (level > id->level) || (id->pages_per_area == 0))
+ return NULL;
return debug_event_common(id,level,txt,strlen(txt));
}
@@ -167,7 +173,8 @@ debug_sprintf_event(debug_info_t* id,int level,char *string,...)
extern inline debug_entry_t*
debug_exception(debug_info_t* id, int level, void* data, int length)
{
- if ((!id) || (level > id->level)) return NULL;
+ if ((!id) || (level > id->level) || (id->pages_per_area == 0))
+ return NULL;
return debug_exception_common(id,level,data,length);
}
@@ -175,7 +182,8 @@ extern inline debug_entry_t*
debug_int_exception(debug_info_t* id, int level, unsigned int tag)
{
unsigned int t=tag;
- if ((!id) || (level > id->level)) return NULL;
+ if ((!id) || (level > id->level) || (id->pages_per_area == 0))
+ return NULL;
return debug_exception_common(id,level,&t,sizeof(unsigned int));
}
@@ -183,14 +191,16 @@ extern inline debug_entry_t *
debug_long_exception (debug_info_t* id, int level, unsigned long tag)
{
unsigned long t=tag;
- if ((!id) || (level > id->level)) return NULL;
+ if ((!id) || (level > id->level) || (id->pages_per_area == 0))
+ return NULL;
return debug_exception_common(id,level,&t,sizeof(unsigned long));
}
extern inline debug_entry_t*
debug_text_exception(debug_info_t* id, int level, const char* txt)
{
- if ((!id) || (level > id->level)) return NULL;
+ if ((!id) || (level > id->level) || (id->pages_per_area == 0))
+ return NULL;
return debug_exception_common(id,level,txt,strlen(txt));
}