From owner-freebsd-ports@FreeBSD.ORG Sat Apr 19 01:24:32 2003 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 574E237B401 for ; Sat, 19 Apr 2003 01:24:32 -0700 (PDT) Received: from magic.adaptec.com (magic-mail.adaptec.com [208.236.45.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE55F43F85 for ; Sat, 19 Apr 2003 01:24:31 -0700 (PDT) (envelope-from scott_long@btc.adaptec.com) Received: from redfish.adaptec.com (redfish.adaptec.com [162.62.50.11]) by magic.adaptec.com (8.11.6/8.11.6) with ESMTP id h3J8M6Z17866; Sat, 19 Apr 2003 01:22:06 -0700 Received: from btc.btc.adaptec.com ([10.100.0.52]) by redfish.adaptec.com (8.8.8p2+Sun/8.8.8) with ESMTP id BAA20629; Sat, 19 Apr 2003 01:24:17 -0700 (PDT) Received: from btc.adaptec.com (hollin [10.100.253.56]) by btc.btc.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id CAA08022; Sat, 19 Apr 2003 02:24:13 -0600 (MDT) Message-ID: <3EA107AB.1090408@btc.adaptec.com> Date: Sat, 19 Apr 2003 02:24:11 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.2.1) Gecko/20030206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: sk-ports@vegamuse.org, ports@freebsd.org Content-Type: multipart/mixed; boundary="------------060908010706060202030200" Subject: Patches to make wmmon work under 5-current X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Apr 2003 08:24:32 -0000 This is a multi-part message in MIME format. --------------060908010706060202030200 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, Attached are patches to make wmmon work under 5-CURRENT. I added appropriate #if __FreeBSD_version lines near the top of the file, but got lazy and gave up as I went on. Just about every single change needs to be bracketed with #if __FreeBSD_version >= 500106 ... #else ... #endif. The patch is relative to the patched version of wmmon.c that is generated from the 'make patch' stage. Scott --------------060908010706060202030200 Content-Type: text/plain; name="wmmon.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="wmmon.c.diff" --- wmmon.c.orig Sat Apr 19 01:51:32 2003 +++ wmmon.c Sat Apr 19 02:19:37 2003 @@ -93,7 +93,12 @@ #include #include #include +#if __FreeBSD_version < 500101 #include +#endif +#if __FreeBSD_version >= 500106 +#include +#endif #if __FreeBSD_version >= 300000 #include #endif @@ -190,7 +195,7 @@ void wmmon_routine(int, char **); -void main(int argc, char *argv[]) { +int main(int argc, char *argv[]) { int i; @@ -230,7 +235,7 @@ } } - if( checkversion() < 0 ) + if( devstat_checkversion(NULL) < 0 ) { fprintf( stderr, devstat_errbuf ); exit(1); @@ -340,7 +345,7 @@ } #if __FreeBSD_version >= 300000 - ndrives = getnumdevs(); + ndrives = devstat_getnumdevs(NULL); #else if (nl[0].n_type != 0) { (void) kvm_read(kvmd, nl[N_DK_NDRIVE].n_value, (char *)&ndrives, sizeof(ndrives)); @@ -936,7 +941,7 @@ static int initted = 0; static struct statinfo last; static struct statinfo cur; - int ndevs = getnumdevs(); + int ndevs = devstat_getnumdevs(NULL); int gotdevs = 0; long generation; int num_devices_specified = 0; @@ -986,10 +991,10 @@ memcpy( &last, &cur, sizeof(cur) ); cur.dinfo = tmp; - last.busy_time = cur.busy_time; + last.snap_time = cur.snap_time; } - if( !gotdevs && ( getdevs( &cur ) >= 0 ) ) + if( !gotdevs && ( devstat_getdevs( NULL, &cur ) >= 0 ) ) gotdevs = 1; if( gotdevs ) @@ -999,7 +1004,7 @@ if( !initted ) { - selectdevs( &dev_select, &num_selected, &num_selections, + devstat_selectdevs( &dev_select, &num_selected, &num_selections, &select_generation, generation, cur.dinfo->devices, ndevs, matches, num_matches, specified_devices, num_devices_specified, DS_SELECT_ONLY, maxshowdevs, @@ -1010,10 +1015,10 @@ struct devinfo *tmpinfo; long tmp; - switch( getdevs( &cur ) ) + switch( devstat_getdevs( NULL, &cur ) ) { case 1: - selectdevs( &dev_select, &num_selected, + devstat_selectdevs( &dev_select, &num_selected, &num_selections, &select_generation, generation, cur.dinfo->devices, ndevs, matches, num_matches, @@ -1041,13 +1046,13 @@ memcpy( &last, &cur, sizeof(cur) ); cur.dinfo = tmpinfo; - last.busy_time = cur.busy_time; + last.snap_time = cur.snap_time; break; default: break; } - selectdevs( &dev_select, &num_selected, &num_selections, + devstat_selectdevs( &dev_select, &num_selected, &num_selections, &select_generation, generation, cur.dinfo->devices, ndevs, matches, num_matches, specified_devices, num_devices_specified, DS_SELECT_ONLY, maxshowdevs, @@ -1068,7 +1073,7 @@ long double busy_seconds; long double blocks_per_second, ms_per_transaction; - busy_seconds = compute_etime( cur.busy_time, last.busy_time ); + busy_seconds = cur.snap_time - last.snap_time; for( dn = 0; dn < ndevs; dn++ ) { --------------060908010706060202030200--