From owner-svn-src-head@FreeBSD.ORG Tue Oct 15 10:05:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 141F76EB; Tue, 15 Oct 2013 10:05:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 019FC21D6; Tue, 15 Oct 2013 10:05:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9FA5bmj090578; Tue, 15 Oct 2013 10:05:37 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9FA5bDq090573; Tue, 15 Oct 2013 10:05:37 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201310151005.r9FA5bDq090573@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 15 Oct 2013 10:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256514 - in head: lib/libkvm sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Oct 2013 10:05:38 -0000 Author: glebius Date: Tue Oct 15 10:05:37 2013 New Revision: 256514 URL: http://svnweb.freebsd.org/changeset/base/256514 Log: - While we are spreading the counter(9) across network stack, more userland tools would need to know about the counter_u64_t type. Allow to include sys/counter.h from userspace. - Utilize now defined type in kvm_counter_u64_fetch(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/lib/libkvm/kvm_pcpu.c head/sys/sys/counter.h Modified: head/lib/libkvm/kvm_pcpu.c ============================================================================== --- head/lib/libkvm/kvm_pcpu.c Tue Oct 15 10:01:15 2013 (r256513) +++ head/lib/libkvm/kvm_pcpu.c Tue Oct 15 10:05:37 2013 (r256514) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -319,7 +320,8 @@ kvm_read_zpcpu(kvm_t *kd, void *buf, u_l uint64_t kvm_counter_u64_fetch(kvm_t *kd, u_long base) { - uint64_t r, c; + counter_u64_t c; + uint64_t r; if (mp_ncpus == 0) if (_kvm_pcpu_init(kd) < 0) Modified: head/sys/sys/counter.h ============================================================================== --- head/sys/sys/counter.h Tue Oct 15 10:01:15 2013 (r256513) +++ head/sys/sys/counter.h Tue Oct 15 10:05:37 2013 (r256514) @@ -31,6 +31,7 @@ typedef uint64_t *counter_u64_t; +#ifdef _KERNEL #include counter_u64_t counter_u64_alloc(int); @@ -58,4 +59,5 @@ uint64_t counter_u64_fetch(counter_u64_t for (int i = 0; i < (n); i++) \ counter_u64_zero((a)[i]); \ } while (0) +#endif /* _KERNEL */ #endif /* ! __SYS_COUNTER_H__ */