Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Mar 2014 07:45:54 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r262827 - head/tools/tools/ath/athaggrstats
Message-ID:  <201403060745.s267jsfr063988@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Thu Mar  6 07:45:53 2014
New Revision: 262827
URL: http://svnweb.freebsd.org/changeset/base/262827

Log:
  Migrate athaggrstats to use bsdstat.

Deleted:
  head/tools/tools/ath/athaggrstats/statfoo.c
  head/tools/tools/ath/athaggrstats/statfoo.h
Modified:
  head/tools/tools/ath/athaggrstats/Makefile
  head/tools/tools/ath/athaggrstats/athaggrstats.c
  head/tools/tools/ath/athaggrstats/athaggrstats.h

Modified: head/tools/tools/ath/athaggrstats/Makefile
==============================================================================
--- head/tools/tools/ath/athaggrstats/Makefile	Thu Mar  6 07:44:45 2014	(r262826)
+++ head/tools/tools/ath/athaggrstats/Makefile	Thu Mar  6 07:45:53 2014	(r262827)
@@ -4,7 +4,7 @@
 
 PROG=	athaggrstats
 
-SRCS=	main.c statfoo.c athaggrstats.c opt_ah.h ah_osdep.h
+SRCS=	main.c athaggrstats.c opt_ah.h ah_osdep.h
 
 CLEANFILES+=	opt_ah.h
 
@@ -12,6 +12,8 @@ CLEANFILES+=	opt_ah.h
 
 CFLAGS+=-DATH_SUPPORT_ANI
 CFLAGS+=-DATH_SUPPORT_TDMA
+USEPRIVATELIB=
+LDADD=-lbsdstat
 
 opt_ah.h:
 	echo "#define AH_DEBUG 1" > opt_ah.h

Modified: head/tools/tools/ath/athaggrstats/athaggrstats.c
==============================================================================
--- head/tools/tools/ath/athaggrstats/athaggrstats.c	Thu Mar  6 07:44:45 2014	(r262826)
+++ head/tools/tools/ath/athaggrstats/athaggrstats.c	Thu Mar  6 07:45:53 2014	(r262827)
@@ -184,7 +184,7 @@ ath_collect(struct athaggrstatfoo_p *wf,
 }
 
 static void
-ath_collect_cur(struct statfoo *sf)
+ath_collect_cur(struct bsdstat *sf)
 {
 	struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf;
 
@@ -192,7 +192,7 @@ ath_collect_cur(struct statfoo *sf)
 }
 
 static void
-ath_collect_tot(struct statfoo *sf)
+ath_collect_tot(struct bsdstat *sf)
 {
 	struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf;
 
@@ -200,7 +200,7 @@ ath_collect_tot(struct statfoo *sf)
 }
 
 static void
-ath_update_tot(struct statfoo *sf)
+ath_update_tot(struct bsdstat *sf)
 {
 	struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf;
 
@@ -219,7 +219,7 @@ snprintrate(char b[], size_t bs, int rat
 }
 
 static int
-ath_get_curstat(struct statfoo *sf, int s, char b[], size_t bs)
+ath_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs)
 {
 	struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf;
 #define	STAT(x) \
@@ -275,7 +275,7 @@ ath_get_curstat(struct statfoo *sf, int 
 }
 
 static int
-ath_get_totstat(struct statfoo *sf, int s, char b[], size_t bs)
+ath_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs)
 {
 	struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf;
 #define	STAT(x) \
@@ -331,7 +331,7 @@ ath_get_totstat(struct statfoo *sf, int 
 }
 
 static void
-ath_print_verbose(struct statfoo *sf, FILE *fd)
+ath_print_verbose(struct bsdstat *sf, FILE *fd)
 {
 	struct athaggrstatfoo_p *wf = (struct athaggrstatfoo_p *) sf;
 	const struct fmt *f;
@@ -363,7 +363,7 @@ ath_print_verbose(struct statfoo *sf, FI
 	fprintf(fd, "\n");
 }
 
-STATFOO_DEFINE_BOUNCE(athaggrstatfoo)
+BSDSTAT_DEFINE_BOUNCE(athaggrstatfoo)
 
 struct athaggrstatfoo *
 athaggrstats_new(const char *ifname, const char *fmtstring)
@@ -373,7 +373,7 @@ athaggrstats_new(const char *ifname, con
 
 	wf = calloc(1, sizeof(struct athaggrstatfoo_p));
 	if (wf != NULL) {
-		statfoo_init(&wf->base.base, "athaggrstats",
+		bsdstat_init(&wf->base.base, "athaggrstats",
 		    athaggrstats, N(athaggrstats));
 		/* override base methods */
 		wf->base.base.collect_cur = ath_collect_cur;
@@ -384,7 +384,7 @@ athaggrstats_new(const char *ifname, con
 		wf->base.base.print_verbose = ath_print_verbose;
 
 		/* setup bounce functions for public methods */
-		STATFOO_BOUNCE(wf, athaggrstatfoo);
+		BSDSTAT_BOUNCE(wf, athaggrstatfoo);
 
 		/* setup our public methods */
 		wf->base.setifname = ath_setifname;

Modified: head/tools/tools/ath/athaggrstats/athaggrstats.h
==============================================================================
--- head/tools/tools/ath/athaggrstats/athaggrstats.h	Thu Mar  6 07:44:45 2014	(r262826)
+++ head/tools/tools/ath/athaggrstats/athaggrstats.h	Thu Mar  6 07:45:53 2014	(r262827)
@@ -32,15 +32,15 @@
 #ifndef _ATHAGGRSTATS_H_
 #define	_ATHAGGRSTATS_H_
 
-#include "statfoo.h"
+#include "bsdstat.h"
 
 /*
  * ath statistics class.
  */
 struct athaggrstatfoo {
-	struct statfoo base;
+	struct bsdstat base;
 
-	STATFOO_DECL_METHODS(struct athaggrstatfoo *);
+	BSDSTAT_DECL_METHODS(struct athaggrstatfoo *);
 
 	/* set the network interface name for collection */
 	void (*setifname)(struct athaggrstatfoo *, const char *ifname);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403060745.s267jsfr063988>