From owner-svn-src-head@freebsd.org Sat Dec 5 10:00:02 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CABB9A4214A; Sat, 5 Dec 2015 10:00:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A48A14C4; Sat, 5 Dec 2015 10:00:02 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB5A01bZ010876; Sat, 5 Dec 2015 10:00:01 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB5A01W7010875; Sat, 5 Dec 2015 10:00:01 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512051000.tB5A01W7010875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 5 Dec 2015 10:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291855 - head/sys/cddl/dev/profile 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.20 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: Sat, 05 Dec 2015 10:00:02 -0000 Author: andrew Date: Sat Dec 5 10:00:01 2015 New Revision: 291855 URL: https://svnweb.freebsd.org/changeset/base/291855 Log: Allow the artificial profile frames to be adjusted as needed by the user. While here update for armv6 to a tested value. Submitted by: Howard Su Reviewed by: stat Differential Revision: https://reviews.freebsd.org/D4315 Modified: head/sys/cddl/dev/profile/profile.c Modified: head/sys/cddl/dev/profile/profile.c ============================================================================== --- head/sys/cddl/dev/profile/profile.c Sat Dec 5 09:53:58 2015 (r291854) +++ head/sys/cddl/dev/profile/profile.c Sat Dec 5 10:00:01 2015 (r291855) @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -134,10 +135,7 @@ struct profile_probe_percpu; #endif #ifdef __arm__ -/* - * At least on ARMv7, this appears to work quite well. - */ -#define PROF_ARTIFICIAL_FRAMES 10 +#define PROF_ARTIFICIAL_FRAMES 3 #endif #ifdef __aarch64__ @@ -233,7 +231,12 @@ static dtrace_pops_t profile_pops = { static struct cdev *profile_cdev; static dtrace_provider_id_t profile_id; static hrtime_t profile_interval_min = NANOSEC / 5000; /* 5000 hz */ -static int profile_aframes = 0; /* override */ +static int profile_aframes = PROF_ARTIFICIAL_FRAMES; + +SYSCTL_DECL(_kern_dtrace); +SYSCTL_NODE(_kern_dtrace, OID_AUTO, profile, CTLFLAG_RD, 0, "DTrace profile parameters"); +SYSCTL_INT(_kern_dtrace_profile, OID_AUTO, aframes, CTLFLAG_RW, &profile_aframes, + 0, "Skipped frames for profile provider"); static sbintime_t nsec_to_sbt(hrtime_t nsec) @@ -352,7 +355,7 @@ profile_create(hrtime_t interval, char * prof->prof_kind = kind; prof->prof_id = dtrace_probe_create(profile_id, NULL, NULL, name, - profile_aframes ? profile_aframes : PROF_ARTIFICIAL_FRAMES, prof); + profile_aframes, prof); } /*ARGSUSED*/