[Orca-checkins] r393 - trunk/orca/data_gatherers/orcallator

dmberezin at hotmail.com dmberezin at hotmail.com
Tue Sep 14 12:31:32 PDT 2004


Author: dmberezin at hotmail.com
Date: Tue Sep 14 12:29:33 2004
New Revision: 393

Modified:
   trunk/orca/data_gatherers/orcallator/orcallator.se
Log:
Update to the disk/tape data collection on Solaris.

* data_gatherers/orcallator/orcallator.se
  (orca_io_info_update): Removed unnecessary kstat function calls
  (orca_io_info_update): Removed unused variable
    kp
  (orca_io_info_update): Fixed some comments


Modified: trunk/orca/data_gatherers/orcallator/orcallator.se
==============================================================================
--- trunk/orca/data_gatherers/orcallator/orcallator.se	(original)
+++ trunk/orca/data_gatherers/orcallator/orcallator.se	Tue Sep 14 12:29:33 2004
@@ -347,7 +347,6 @@
   int		index;
   ulong       ul;
   kstat_ctl_t kc[1];
-  kstat_t     kp[1];
   kstat_t     nkp[1];
   kstat_io_t  kio;
 
@@ -356,28 +355,22 @@
   double      elapsed_etime;
   double      hz_etime;
 
+  // Initialize kstat control structure
   kc[0] = kstat_open();
-  // Read them.
-  if (kstat_read(kc, kp, 0) == -1) {
-    perror("orca_io_info_update:kstat_read");
-    exit(1);
-  }
-
   // Traverse the chain looking for IO events.
-  for (ul=kc[0].kc_chain; ul !=0; ul=nkp[0].ks_next) {
+  for (ul=kc[0].kc_chain; ul!=0; ul=nkp[0].ks_next) {
     struct_fill(nkp[0], ul);
     if (nkp[0].ks_type == KSTAT_TYPE_IO) {
       // Look for disk or tape statistics
       if (nkp[0].ks_class == "disk" || nkp[0].ks_class == "tape") {
-        // Update the device registers.
+        // Get data from the kernel for this kstat
         if (kstat_read(kc, nkp, 0) == -1) {
           perror("orca_io_info_update:kstat_read error");
           exit(1);
         }
-        // Read sys_kstat device IO queue to find out about recent activity.
         struct_fill(kio, nkp[0].ks_data);
 
-        // Try to locate device.
+        // Try to locate device in our array
         for (iodev=0; iodev < ORCA_io_dev_count; ++iodev) {
           if (ORCA_io_dev_info[iodev].short_name == nkp[0].ks_name) {
             break;



More information about the Orca-checkins mailing list