mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-03 09:00:30 +03:00
Deduplicate prof hook ctl handlers
This commit is contained in:
parent
366a2cd9c0
commit
bbe86b591f
2 changed files with 54 additions and 93 deletions
|
|
@ -334,9 +334,23 @@ TEST_BEGIN(test_prof_sample_hooks) {
|
|||
}
|
||||
TEST_END
|
||||
|
||||
TEST_BEGIN(test_prof_hook_noop) {
|
||||
test_skip_if(!config_prof);
|
||||
|
||||
const char *hooks[] = {"experimental.hooks.prof_backtrace",
|
||||
"experimental.hooks.prof_dump", "experimental.hooks.prof_sample",
|
||||
"experimental.hooks.prof_sample_free"};
|
||||
|
||||
for (unsigned i = 0; i < sizeof(hooks) / sizeof(hooks[0]); i++) {
|
||||
expect_d_eq(mallctl(hooks[i], NULL, NULL, NULL, 0), EINVAL,
|
||||
"Unexpected noop hook mallctl result");
|
||||
}
|
||||
}
|
||||
TEST_END
|
||||
|
||||
int
|
||||
main(void) {
|
||||
return test(test_prof_backtrace_hook_replace,
|
||||
test_prof_backtrace_hook_augment, test_prof_dump_hook,
|
||||
test_prof_sample_hooks);
|
||||
test_prof_sample_hooks, test_prof_hook_noop);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue