diff options
author | andrew <andrew@FreeBSD.org> | 2015-12-05 10:00:01 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2015-12-05 10:00:01 +0000 |
commit | ecf3965dfa88f396aa240ba433cf39ebe5328eb0 (patch) | |
tree | 4346706e2d69ce299f2befaa8aa81b659038e4fe /sys/cddl | |
parent | 67195f5ef1511d34c1b20ecf640143aaf345e932 (diff) | |
download | FreeBSD-src-ecf3965dfa88f396aa240ba433cf39ebe5328eb0.zip FreeBSD-src-ecf3965dfa88f396aa240ba433cf39ebe5328eb0.tar.gz |
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 <howard0su@gmail.com>
Reviewed by: stat
Differential Revision: https://reviews.freebsd.org/D4315
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/dev/profile/profile.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c index 80a0eca..4deac87 100644 --- a/sys/cddl/dev/profile/profile.c +++ b/sys/cddl/dev/profile/profile.c @@ -50,6 +50,7 @@ #include <sys/proc.h> #include <sys/selinfo.h> #include <sys/smp.h> +#include <sys/sysctl.h> #include <sys/uio.h> #include <sys/unistd.h> #include <machine/cpu.h> @@ -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 *name, int kind) 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*/ |