s390/qdio: fix truncated debug output of hex values

Calling debug_event the s390 debug feature only logs up to buf_size
bytes of the debug view. If debug_event is called with more bytes
than buf_size the additional data is ignored and not logged in the
debug view.

Use multiple calls to debug_event if the length exceeds buf_size.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Jan Glauber 2012-09-11 13:42:06 +02:00 committed by Martin Schwidefsky
parent c0162b07b3
commit d3feb48108
1 changed files with 25 additions and 13 deletions

View File

@ -37,10 +37,14 @@ static inline int qdio_dbf_passes(debug_info_t *dbf_grp, int level)
debug_text_event(qdio_dbf_setup, DBF_ERR, debug_buffer); \
} while (0)
#define DBF_HEX(addr, len) \
do { \
debug_event(qdio_dbf_setup, DBF_ERR, (void*)(addr), len); \
} while (0)
static inline void DBF_HEX(void *addr, int len)
{
while (len > 0) {
debug_event(qdio_dbf_setup, DBF_ERR, addr, len);
len -= qdio_dbf_setup->buf_size;
addr += qdio_dbf_setup->buf_size;
}
}
#define DBF_ERROR(text...) \
do { \
@ -49,11 +53,14 @@ static inline int qdio_dbf_passes(debug_info_t *dbf_grp, int level)
debug_text_event(qdio_dbf_error, DBF_ERR, debug_buffer); \
} while (0)
#define DBF_ERROR_HEX(addr, len) \
do { \
debug_event(qdio_dbf_error, DBF_ERR, (void*)(addr), len); \
} while (0)
static inline void DBF_ERROR_HEX(void *addr, int len)
{
while (len > 0) {
debug_event(qdio_dbf_error, DBF_ERR, addr, len);
len -= qdio_dbf_error->buf_size;
addr += qdio_dbf_error->buf_size;
}
}
#define DBF_DEV_EVENT(level, device, text...) \
do { \
@ -64,10 +71,15 @@ static inline int qdio_dbf_passes(debug_info_t *dbf_grp, int level)
} \
} while (0)
#define DBF_DEV_HEX(level, device, addr, len) \
do { \
debug_event(device->debug_area, level, (void*)(addr), len); \
} while (0)
static inline void DBF_DEV_HEX(struct qdio_irq *dev, void *addr,
int len, int level)
{
while (len > 0) {
debug_event(dev->debug_area, level, addr, len);
len -= dev->debug_area->buf_size;
addr += dev->debug_area->buf_size;
}
}
void qdio_allocate_dbf(struct qdio_initialize *init_data,
struct qdio_irq *irq_ptr);