kernel - Add v_token_name to gd_cnt
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 24 Sep 2012 17:26:28 +0000 (10:26 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 24 Sep 2012 17:26:28 +0000 (10:26 -0700)
* Copy the tok->t_desc field into the gd_cnt.v_token_name buffer
  when a token collides so systat -pv 1 can pick it up.

sys/kern/lwkt_token.c
sys/sys/vmmeter.h

index 37ae5b9..e56e6c9 100644 (file)
@@ -468,6 +468,10 @@ lwkt_getalltokens(thread_t td, int spinning)
                         * Otherwise we failed to acquire all the tokens.
                         * Release whatever we did get.
                         */
+                       strncpy(td->td_gd->gd_cnt.v_token_name,
+                               tok->t_desc,
+                               sizeof(td->td_gd->gd_cnt.v_token_name) - 1);
+
                        if (lwkt_sched_debug > 0) {
                                --lwkt_sched_debug;
                                kprintf("toka %p %s %s\n",
index d14ccea..0bb1265 100644 (file)
@@ -102,11 +102,8 @@ struct vmmeter {
        u_int v_waitsys;        /* calls to waitsys() */
        u_int v_smpinvltlb;     /* nasty global invltlbs */
        u_int v_ppwakeups;      /* wakeups on processes stalled on VM */
-       u_int v_token_colls;
-       u_int v_reserved2;
-       u_int v_reserved3;
-       u_int v_reserved4;
-       u_int v_reserved5;
+       u_int v_token_colls;    /* # of token collisions */
+       char  v_token_name[16]; /* last-colliding token name */
        u_int v_reserved6;
        u_int v_reserved7;
 #define vmmeter_uint_end       v_reserved7