Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jan 2019 18:47:19 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343053 - head/lib/libmemstat
Message-ID:  <201901151847.x0FIlJRe038823@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Jan 15 18:47:19 2019
New Revision: 343053
URL: https://svnweb.freebsd.org/changeset/base/343053

Log:
  This was missed in r343051: make uz_allocs, uz_frees and uz_fails counter(9).

Modified:
  head/lib/libmemstat/memstat_uma.c

Modified: head/lib/libmemstat/memstat_uma.c
==============================================================================
--- head/lib/libmemstat/memstat_uma.c	Tue Jan 15 18:32:26 2019	(r343052)
+++ head/lib/libmemstat/memstat_uma.c	Tue Jan 15 18:47:19 2019	(r343053)
@@ -29,6 +29,7 @@
  */
 
 #include <sys/param.h>
+#include <sys/counter.h>
 #include <sys/cpuset.h>
 #include <sys/sysctl.h>
 
@@ -406,9 +407,12 @@ memstat_kvm_uma(struct memory_type_list *list, void *k
 			 * Reset the statistics on a current node.
 			 */
 			_memstat_mt_reset_stats(mtp, mp_maxid + 1);
-			mtp->mt_numallocs = uz.uz_allocs;
-			mtp->mt_numfrees = uz.uz_frees;
-			mtp->mt_failures = uz.uz_fails;
+			mtp->mt_numallocs = kvm_counter_u64_fetch(kvm,
+			    (unsigned long )uz.uz_allocs);
+			mtp->mt_numfrees = kvm_counter_u64_fetch(kvm,
+			    (unsigned long )uz.uz_frees);
+			mtp->mt_failures = kvm_counter_u64_fetch(kvm,
+			    (unsigned long )uz.uz_fails);
 			mtp->mt_sleeps = uz.uz_sleeps;
 			if (kz.uk_flags & UMA_ZFLAG_INTERNAL)
 				goto skip_percpu;



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