The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/servers/is/dmp_ds.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* This file contains procedures to dump DS data structures.
    2  *
    3  * The entry points into this file are
    4  *   data_store_dmp:    display DS data store contents 
    5  *
    6  * Created:
    7  *   Oct 18, 2005:      by Jorrit N. Herder
    8  */
    9 
   10 #include "inc.h"
   11 #include "../ds/store.h"
   12 
   13 PUBLIC struct data_store store[NR_DS_KEYS];
   14 
   15 FORWARD _PROTOTYPE( char *s_flags_str, (int flags)              );
   16 
   17 /*===========================================================================*
   18  *                              data_store_dmp                               *
   19  *===========================================================================*/
   20 PUBLIC void data_store_dmp()
   21 {
   22   struct data_store *dsp;
   23   int i,j, n=0;
   24   static int prev_i=0;
   25 
   26 
   27   printf("Data Store (DS) contents dump\n");
   28 
   29   getsysinfo(DS_PROC_NR, SI_DATA_STORE, store);
   30 
   31   printf("-slot- -key- -flags- -val_l1- -val_l2-\n");
   32 
   33   for (i=prev_i; i<NR_DS_KEYS; i++) {
   34         dsp = &store[i];
   35         if (! dsp->ds_flags & DS_IN_USE) continue;
   36         if (++n > 22) break;
   37         printf("%3d %8d %s  [%8d] [%8d] \n",
   38                 i, dsp->ds_key,
   39                 s_flags_str(dsp->ds_flags),
   40                 dsp->ds_val_l1,
   41                 dsp->ds_val_l2
   42         );
   43   }
   44   if (i >= NR_DS_KEYS) i = 0;
   45   else printf("--more--\r");
   46   prev_i = i;
   47 }
   48 
   49 
   50 PRIVATE char *s_flags_str(int flags)
   51 {
   52         static char str[5];
   53         str[0] = (flags & DS_IN_USE) ? 'U' : '-';
   54         str[1] = (flags & DS_PUBLIC) ? 'P' : '-';
   55         str[2] = '-';
   56         str[3] = '\0';
   57 
   58         return(str);
   59 }
   60 

Cache object: a0f1a973848f6aa45769de29fa5544bf


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.