[S390] qdio: add eqbs/sqbs instruction counters
authorJan Glauber <jang@linux.vnet.ibm.com>
Thu, 25 Dec 2008 12:38:44 +0000 (13:38 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 25 Dec 2008 12:38:58 +0000 (13:38 +0100)
Add counters for the eqbs and sqbs instructions that indicate how often
we issued the instructions and how often the instructions returned with
less buffers than specified.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/qdio_main.c
drivers/s390/cio/qdio_perf.c
drivers/s390/cio/qdio_perf.h

index 7572a005762370b38ac996daf1a33546dc5f649d..a44a8c5b91beb7f79597db31343675242dd0e249 100644 (file)
@@ -129,6 +129,7 @@ static int qdio_do_eqbs(struct qdio_q *q, unsigned char *state,
        char dbf_text[15];
 
        BUG_ON(!q->irq_ptr->sch_token);
+       qdio_perf_stat_inc(&perf_stats.debug_eqbs_all);
 
        if (!q->is_input_q)
                nr += q->irq_ptr->nr_input_qs;
@@ -139,8 +140,10 @@ again:
        /* At least one buffer was processed, return and extract the remaining
         * buffers later.
         */
-       if ((ccq == 96) && (count != tmp_count))
+       if ((ccq == 96) && (count != tmp_count)) {
+               qdio_perf_stat_inc(&perf_stats.debug_eqbs_incomplete);
                return (count - tmp_count);
+       }
        if (rc == 1) {
                QDIO_DBF_TEXT5(1, trace, "eqAGAIN");
                goto again;
@@ -179,6 +182,7 @@ static int qdio_do_sqbs(struct qdio_q *q, unsigned char state, int start,
        char dbf_text[15];
 
        BUG_ON(!q->irq_ptr->sch_token);
+       qdio_perf_stat_inc(&perf_stats.debug_sqbs_all);
 
        if (!q->is_input_q)
                nr += q->irq_ptr->nr_input_qs;
@@ -187,6 +191,7 @@ again:
        rc = qdio_check_ccq(q, ccq);
        if (rc == 1) {
                QDIO_DBF_TEXT5(1, trace, "sqAGAIN");
+               qdio_perf_stat_inc(&perf_stats.debug_sqbs_incomplete);
                goto again;
        }
        if (rc < 0) {
index ec5c4a41423521bfa30c06f64aee6e5ae75597f6..bec01100f8e82fc9582544bb3b232449601fa493 100644 (file)
@@ -80,6 +80,12 @@ static int qdio_perf_proc_show(struct seq_file *m, void *v)
                   (long)atomic_long_read(&perf_stats.debug_stop_polling));
        seq_printf(m, "AI inbound tasklet loops after stop polling\t: %li\n",
                   (long)atomic_long_read(&perf_stats.thinint_inbound_loop2));
+       seq_printf(m, "QEBSM EQBS total/incomplete\t\t\t: %li/%li\n",
+                  (long)atomic_long_read(&perf_stats.debug_eqbs_all),
+                  (long)atomic_long_read(&perf_stats.debug_eqbs_incomplete));
+       seq_printf(m, "QEBSM SQBS total/incomplete\t\t\t: %li/%li\n",
+                  (long)atomic_long_read(&perf_stats.debug_sqbs_all),
+                  (long)atomic_long_read(&perf_stats.debug_sqbs_incomplete));
        seq_printf(m, "\n");
        return 0;
 }
index 5c406a8b73870127c4be66fa8c0ef8ed8aa0619f..d16c1c67160fffdfdfee74e030484b676a108a71 100644 (file)
@@ -40,6 +40,10 @@ struct qdio_perf_stats {
        /* for debugging */
        atomic_long_t debug_tl_out_timer;
        atomic_long_t debug_stop_polling;
+       atomic_long_t debug_eqbs_all;
+       atomic_long_t debug_eqbs_incomplete;
+       atomic_long_t debug_sqbs_all;
+       atomic_long_t debug_sqbs_incomplete;
 };
 
 extern struct qdio_perf_stats perf_stats;