From 201b654e388e34eee6c132f23028c48c41160a22 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Thu, 20 Nov 2014 23:16:19 +0000 Subject: [PATCH] Clamp too-large hwpmc callchaindepth to the maximum If the depth requested by the user is too large, it's better to provide the maximum than the smaller default. Sponsored by: The FreeBSD Foundation --- sys/dev/hwpmc/hwpmc_mod.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c index 42dd66cee064..f1506d63093e 100644 --- a/sys/dev/hwpmc/hwpmc_mod.c +++ b/sys/dev/hwpmc/hwpmc_mod.c @@ -4749,8 +4749,9 @@ pmc_initialize(void) if (pmc_callchaindepth <= 0 || pmc_callchaindepth > PMC_CALLCHAIN_DEPTH_MAX) { (void) printf("hwpmc: tunable \"callchaindepth\"=%d out of " - "range.\n", pmc_callchaindepth); - pmc_callchaindepth = PMC_CALLCHAIN_DEPTH; + "range - using %d.\n", pmc_callchaindepth, + PMC_CALLCHAIN_DEPTH_MAX); + pmc_callchaindepth = PMC_CALLCHAIN_DEPTH_MAX; } md = pmc_md_initialize();