Commit 58eb27cd authored by Jan Glauber's avatar Jan Glauber Committed by Martin Schwidefsky

[S390] qdio: improve s390 debug feature usage

Improve s390 debug feature usage:
- log busy bit in dbf
- increase size of dbf views
- consistent logging of qdio api calls to setup view
- print subchannel number so one can associate the interface
  with the dbf data
- only log events to one view
Signed-off-by: default avatarJan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 53b41ba7
...@@ -61,18 +61,18 @@ ...@@ -61,18 +61,18 @@
/* s390dbf views */ /* s390dbf views */
#define QDIO_DBF_SETUP_LEN 8 #define QDIO_DBF_SETUP_LEN 8
#define QDIO_DBF_SETUP_PAGES 4 #define QDIO_DBF_SETUP_PAGES 8
#define QDIO_DBF_SETUP_NR_AREAS 1 #define QDIO_DBF_SETUP_NR_AREAS 1
#define QDIO_DBF_TRACE_LEN 8 #define QDIO_DBF_TRACE_LEN 8
#define QDIO_DBF_TRACE_NR_AREAS 2 #define QDIO_DBF_TRACE_NR_AREAS 2
#ifdef CONFIG_QDIO_DEBUG #ifdef CONFIG_QDIO_DEBUG
#define QDIO_DBF_TRACE_PAGES 16 #define QDIO_DBF_TRACE_PAGES 32
#define QDIO_DBF_SETUP_LEVEL 6 #define QDIO_DBF_SETUP_LEVEL 6
#define QDIO_DBF_TRACE_LEVEL 4 #define QDIO_DBF_TRACE_LEVEL 4
#else /* !CONFIG_QDIO_DEBUG */ #else /* !CONFIG_QDIO_DEBUG */
#define QDIO_DBF_TRACE_PAGES 4 #define QDIO_DBF_TRACE_PAGES 8
#define QDIO_DBF_SETUP_LEVEL 2 #define QDIO_DBF_SETUP_LEVEL 2
#define QDIO_DBF_TRACE_LEVEL 2 #define QDIO_DBF_TRACE_LEVEL 2
#endif /* CONFIG_QDIO_DEBUG */ #endif /* CONFIG_QDIO_DEBUG */
......
...@@ -330,6 +330,7 @@ static int qdio_siga_output(struct qdio_q *q) ...@@ -330,6 +330,7 @@ static int qdio_siga_output(struct qdio_q *q)
int cc; int cc;
u32 busy_bit; u32 busy_bit;
u64 start_time = 0; u64 start_time = 0;
char dbf_text[15];
QDIO_DBF_TEXT5(0, trace, "sigaout"); QDIO_DBF_TEXT5(0, trace, "sigaout");
QDIO_DBF_HEX5(0, trace, &q, sizeof(void *)); QDIO_DBF_HEX5(0, trace, &q, sizeof(void *));
...@@ -338,6 +339,9 @@ static int qdio_siga_output(struct qdio_q *q) ...@@ -338,6 +339,9 @@ static int qdio_siga_output(struct qdio_q *q)
again: again:
cc = qdio_do_siga_output(q, &busy_bit); cc = qdio_do_siga_output(q, &busy_bit);
if (queue_type(q) == QDIO_IQDIO_QFMT && cc == 2 && busy_bit) { if (queue_type(q) == QDIO_IQDIO_QFMT && cc == 2 && busy_bit) {
sprintf(dbf_text, "bb%4x%2x", q->irq_ptr->schid.sch_no, q->nr);
QDIO_DBF_TEXT3(0, trace, dbf_text);
if (!start_time) if (!start_time)
start_time = get_usecs(); start_time = get_usecs();
else if ((get_usecs() - start_time) < QDIO_BUSY_BIT_PATIENCE) else if ((get_usecs() - start_time) < QDIO_BUSY_BIT_PATIENCE)
...@@ -748,16 +752,18 @@ static void qdio_kick_outbound_q(struct qdio_q *q) ...@@ -748,16 +752,18 @@ static void qdio_kick_outbound_q(struct qdio_q *q)
rc = qdio_siga_output(q); rc = qdio_siga_output(q);
switch (rc) { switch (rc) {
case 0: case 0:
/* went smooth this time, reset timestamp */
q->u.out.timestamp = 0;
/* TODO: improve error handling for CC=0 case */ /* TODO: improve error handling for CC=0 case */
#ifdef CONFIG_QDIO_DEBUG #ifdef CONFIG_QDIO_DEBUG
if (q->u.out.timestamp) {
QDIO_DBF_TEXT3(0, trace, "cc2reslv"); QDIO_DBF_TEXT3(0, trace, "cc2reslv");
sprintf(dbf_text, "%4x%2x%2x", q->irq_ptr->schid.sch_no, q->nr, sprintf(dbf_text, "%4x%2x%2x", q->irq_ptr->schid.sch_no,
q->nr,
atomic_read(&q->u.out.busy_siga_counter)); atomic_read(&q->u.out.busy_siga_counter));
QDIO_DBF_TEXT3(0, trace, dbf_text); QDIO_DBF_TEXT3(0, trace, dbf_text);
}
#endif /* CONFIG_QDIO_DEBUG */ #endif /* CONFIG_QDIO_DEBUG */
/* went smooth this time, reset timestamp */
q->u.out.timestamp = 0;
break; break;
/* cc=2 and busy bit */ /* cc=2 and busy bit */
case (2 | QDIO_ERROR_SIGA_BUSY): case (2 | QDIO_ERROR_SIGA_BUSY):
...@@ -1066,14 +1072,12 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1066,14 +1072,12 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
if (IS_ERR(irb)) { if (IS_ERR(irb)) {
switch (PTR_ERR(irb)) { switch (PTR_ERR(irb)) {
case -EIO: case -EIO:
sprintf(dbf_text, "ierr%4x", sprintf(dbf_text, "ierr%4x", irq_ptr->schid.sch_no);
cdev->private->schid.sch_no);
QDIO_DBF_TEXT2(1, setup, dbf_text); QDIO_DBF_TEXT2(1, setup, dbf_text);
qdio_int_error(cdev); qdio_int_error(cdev);
return; return;
case -ETIMEDOUT: case -ETIMEDOUT:
sprintf(dbf_text, "qtoh%4x", sprintf(dbf_text, "qtoh%4x", irq_ptr->schid.sch_no);
cdev->private->schid.sch_no);
QDIO_DBF_TEXT2(1, setup, dbf_text); QDIO_DBF_TEXT2(1, setup, dbf_text);
qdio_int_error(cdev); qdio_int_error(cdev);
return; return;
...@@ -1124,8 +1128,10 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1124,8 +1128,10 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
struct qdio_ssqd_desc *qdio_get_ssqd_desc(struct ccw_device *cdev) struct qdio_ssqd_desc *qdio_get_ssqd_desc(struct ccw_device *cdev)
{ {
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr;
char dbf_text[15];
QDIO_DBF_TEXT0(0, setup, "getssqd"); sprintf(dbf_text, "qssq%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data; irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
...@@ -1149,14 +1155,13 @@ int qdio_cleanup(struct ccw_device *cdev, int how) ...@@ -1149,14 +1155,13 @@ int qdio_cleanup(struct ccw_device *cdev, int how)
char dbf_text[15]; char dbf_text[15];
int rc; int rc;
sprintf(dbf_text, "qcln%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data; irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
return -ENODEV; return -ENODEV;
sprintf(dbf_text, "qcln%4x", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT1(0, trace, dbf_text);
QDIO_DBF_TEXT0(0, setup, dbf_text);
rc = qdio_shutdown(cdev, how); rc = qdio_shutdown(cdev, how);
if (rc == 0) if (rc == 0)
rc = qdio_free(cdev); rc = qdio_free(cdev);
...@@ -1191,6 +1196,9 @@ int qdio_shutdown(struct ccw_device *cdev, int how) ...@@ -1191,6 +1196,9 @@ int qdio_shutdown(struct ccw_device *cdev, int how)
unsigned long flags; unsigned long flags;
char dbf_text[15]; char dbf_text[15];
sprintf(dbf_text, "qshu%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data; irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
return -ENODEV; return -ENODEV;
...@@ -1205,10 +1213,6 @@ int qdio_shutdown(struct ccw_device *cdev, int how) ...@@ -1205,10 +1213,6 @@ int qdio_shutdown(struct ccw_device *cdev, int how)
return 0; return 0;
} }
sprintf(dbf_text, "qsqs%4x", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT1(0, trace, dbf_text);
QDIO_DBF_TEXT0(0, setup, dbf_text);
tiqdio_remove_input_queues(irq_ptr); tiqdio_remove_input_queues(irq_ptr);
qdio_shutdown_queues(cdev); qdio_shutdown_queues(cdev);
qdio_shutdown_debug_entries(irq_ptr, cdev); qdio_shutdown_debug_entries(irq_ptr, cdev);
...@@ -1263,16 +1267,14 @@ int qdio_free(struct ccw_device *cdev) ...@@ -1263,16 +1267,14 @@ int qdio_free(struct ccw_device *cdev)
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr;
char dbf_text[15]; char dbf_text[15];
sprintf(dbf_text, "qfre%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data; irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
return -ENODEV; return -ENODEV;
mutex_lock(&irq_ptr->setup_mutex); mutex_lock(&irq_ptr->setup_mutex);
sprintf(dbf_text, "qfqs%4x", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT1(0, trace, dbf_text);
QDIO_DBF_TEXT0(0, setup, dbf_text);
cdev->private->qdio_data = NULL; cdev->private->qdio_data = NULL;
mutex_unlock(&irq_ptr->setup_mutex); mutex_unlock(&irq_ptr->setup_mutex);
...@@ -1295,7 +1297,6 @@ int qdio_initialize(struct qdio_initialize *init_data) ...@@ -1295,7 +1297,6 @@ int qdio_initialize(struct qdio_initialize *init_data)
sprintf(dbf_text, "qini%4x", init_data->cdev->private->schid.sch_no); sprintf(dbf_text, "qini%4x", init_data->cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text); QDIO_DBF_TEXT0(0, setup, dbf_text);
QDIO_DBF_TEXT0(0, trace, dbf_text);
rc = qdio_allocate(init_data); rc = qdio_allocate(init_data);
if (rc) if (rc)
...@@ -1319,7 +1320,6 @@ int qdio_allocate(struct qdio_initialize *init_data) ...@@ -1319,7 +1320,6 @@ int qdio_allocate(struct qdio_initialize *init_data)
sprintf(dbf_text, "qalc%4x", init_data->cdev->private->schid.sch_no); sprintf(dbf_text, "qalc%4x", init_data->cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text); QDIO_DBF_TEXT0(0, setup, dbf_text);
QDIO_DBF_TEXT0(0, trace, dbf_text);
if ((init_data->no_input_qs && !init_data->input_handler) || if ((init_data->no_input_qs && !init_data->input_handler) ||
(init_data->no_output_qs && !init_data->output_handler)) (init_data->no_output_qs && !init_data->output_handler))
...@@ -1389,6 +1389,9 @@ int qdio_establish(struct qdio_initialize *init_data) ...@@ -1389,6 +1389,9 @@ int qdio_establish(struct qdio_initialize *init_data)
unsigned long saveflags; unsigned long saveflags;
int rc; int rc;
sprintf(dbf_text, "qest%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data; irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
return -ENODEV; return -ENODEV;
...@@ -1399,10 +1402,6 @@ int qdio_establish(struct qdio_initialize *init_data) ...@@ -1399,10 +1402,6 @@ int qdio_establish(struct qdio_initialize *init_data)
if (!try_module_get(THIS_MODULE)) if (!try_module_get(THIS_MODULE))
return -EINVAL; return -EINVAL;
sprintf(dbf_text, "qest%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
QDIO_DBF_TEXT0(0, trace, dbf_text);
mutex_lock(&irq_ptr->setup_mutex); mutex_lock(&irq_ptr->setup_mutex);
qdio_setup_irq(init_data); qdio_setup_irq(init_data);
...@@ -1472,6 +1471,9 @@ int qdio_activate(struct ccw_device *cdev) ...@@ -1472,6 +1471,9 @@ int qdio_activate(struct ccw_device *cdev)
unsigned long saveflags; unsigned long saveflags;
char dbf_text[20]; char dbf_text[20];
sprintf(dbf_text, "qact%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data; irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
return -ENODEV; return -ENODEV;
...@@ -1485,10 +1487,6 @@ int qdio_activate(struct ccw_device *cdev) ...@@ -1485,10 +1487,6 @@ int qdio_activate(struct ccw_device *cdev)
goto out; goto out;
} }
sprintf(dbf_text, "qact%4x", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT2(0, setup, dbf_text);
QDIO_DBF_TEXT2(0, trace, dbf_text);
irq_ptr->ccw.cmd_code = irq_ptr->aqueue.cmd; irq_ptr->ccw.cmd_code = irq_ptr->aqueue.cmd;
irq_ptr->ccw.flags = CCW_FLAG_SLI; irq_ptr->ccw.flags = CCW_FLAG_SLI;
irq_ptr->ccw.count = irq_ptr->aqueue.count; irq_ptr->ccw.count = irq_ptr->aqueue.count;
...@@ -1663,7 +1661,7 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags, ...@@ -1663,7 +1661,7 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags,
#ifdef CONFIG_QDIO_DEBUG #ifdef CONFIG_QDIO_DEBUG
char dbf_text[20]; char dbf_text[20];
sprintf(dbf_text, "doQD%04x", cdev->private->schid.sch_no); sprintf(dbf_text, "doQD%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT3(0, trace, dbf_text); QDIO_DBF_TEXT3(0, trace, dbf_text);
#endif /* CONFIG_QDIO_DEBUG */ #endif /* CONFIG_QDIO_DEBUG */
......
...@@ -165,7 +165,7 @@ static void setup_queues(struct qdio_irq *irq_ptr, ...@@ -165,7 +165,7 @@ static void setup_queues(struct qdio_irq *irq_ptr,
void **output_sbal_array = qdio_init->output_sbal_addr_array; void **output_sbal_array = qdio_init->output_sbal_addr_array;
int i; int i;
sprintf(dbf_text, "qfqs%4x", qdio_init->cdev->private->schid.sch_no); sprintf(dbf_text, "qset%4x", qdio_init->cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text); QDIO_DBF_TEXT0(0, setup, dbf_text);
for_each_input_queue(irq_ptr, q, i) { for_each_input_queue(irq_ptr, q, i) {
...@@ -285,7 +285,7 @@ void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr) ...@@ -285,7 +285,7 @@ void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr)
rc = __get_ssqd_info(irq_ptr); rc = __get_ssqd_info(irq_ptr);
if (rc) { if (rc) {
QDIO_DBF_TEXT2(0, setup, "ssqdasig"); QDIO_DBF_TEXT2(0, setup, "ssqdasig");
sprintf(dbf_text, "schno%x", irq_ptr->schid.sch_no); sprintf(dbf_text, "schn%4x", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT2(0, setup, dbf_text); QDIO_DBF_TEXT2(0, setup, dbf_text);
sprintf(dbf_text, "rc:%d", rc); sprintf(dbf_text, "rc:%d", rc);
QDIO_DBF_TEXT2(0, setup, dbf_text); QDIO_DBF_TEXT2(0, setup, dbf_text);
...@@ -447,7 +447,7 @@ void qdio_print_subchannel_info(struct qdio_irq *irq_ptr, ...@@ -447,7 +447,7 @@ void qdio_print_subchannel_info(struct qdio_irq *irq_ptr,
{ {
char s[80]; char s[80];
sprintf(s, "%s ", cdev->dev.bus_id); sprintf(s, "%s sc:%x ", cdev->dev.bus_id, irq_ptr->schid.sch_no);
switch (irq_ptr->qib.qfmt) { switch (irq_ptr->qib.qfmt) {
case QDIO_QETH_QFMT: case QDIO_QETH_QFMT:
......
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