1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-30 12:04:07 +00:00

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
This commit is contained in:
Ed Maste 2014-11-20 23:16:19 +00:00
parent adafc9d6e7
commit 201b654e38
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274766

View File

@ -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();