summaryrefslogtreecommitdiff
path: root/deps/jemalloc/test/unit/prof_thread_name.c
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2023-05-07 17:41:17 +0300
committerGitHub <noreply@github.com>2023-05-07 17:41:17 +0300
commit07d54dc5baa1b2e7adb5ce8e7bee398d376fe13b (patch)
treebd5b11001e44bac9cc2100dfae0af96c31bc4e99 /deps/jemalloc/test/unit/prof_thread_name.c
parent42dd98ec191fd71528785bd7d31bd18112078f66 (diff)
parent0897c8afedc210db5f827bed9d225f24011245eb (diff)
downloadredis-07d54dc5baa1b2e7adb5ce8e7bee398d376fe13b.tar.gz
Merge pull request #12115 from oranagra/update_jemalloc_5_3_0
Upgrade to jemalloc 5.3.0 hoping to resolve a potential for deadlock in a fork child see https://github.com/jemalloc/jemalloc/issues/2402 steps: * Upgrade subtree according to the instructions in deps/README * update iget_defrag_hint by following changes to arena_dalloc_no_tcache
Diffstat (limited to 'deps/jemalloc/test/unit/prof_thread_name.c')
-rw-r--r--deps/jemalloc/test/unit/prof_thread_name.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/deps/jemalloc/test/unit/prof_thread_name.c b/deps/jemalloc/test/unit/prof_thread_name.c
index c9c2a2b76..3c4614fca 100644
--- a/deps/jemalloc/test/unit/prof_thread_name.c
+++ b/deps/jemalloc/test/unit/prof_thread_name.c
@@ -7,11 +7,11 @@ mallctl_thread_name_get_impl(const char *thread_name_expected, const char *func,
size_t sz;
sz = sizeof(thread_name_old);
- assert_d_eq(mallctl("thread.prof.name", (void *)&thread_name_old, &sz,
+ expect_d_eq(mallctl("thread.prof.name", (void *)&thread_name_old, &sz,
NULL, 0), 0,
"%s():%d: Unexpected mallctl failure reading thread.prof.name",
func, line);
- assert_str_eq(thread_name_old, thread_name_expected,
+ expect_str_eq(thread_name_old, thread_name_expected,
"%s():%d: Unexpected thread.prof.name value", func, line);
}
#define mallctl_thread_name_get(a) \
@@ -20,9 +20,9 @@ mallctl_thread_name_get_impl(const char *thread_name_expected, const char *func,
static void
mallctl_thread_name_set_impl(const char *thread_name, const char *func,
int line) {
- assert_d_eq(mallctl("thread.prof.name", NULL, NULL,
+ expect_d_eq(mallctl("thread.prof.name", NULL, NULL,
(void *)&thread_name, sizeof(thread_name)), 0,
- "%s():%d: Unexpected mallctl failure reading thread.prof.name",
+ "%s():%d: Unexpected mallctl failure writing thread.prof.name",
func, line);
mallctl_thread_name_get_impl(thread_name, func, line);
}
@@ -33,20 +33,21 @@ TEST_BEGIN(test_prof_thread_name_validation) {
const char *thread_name;
test_skip_if(!config_prof);
+ test_skip_if(opt_prof_sys_thread_name);
mallctl_thread_name_get("");
mallctl_thread_name_set("hi there");
/* NULL input shouldn't be allowed. */
thread_name = NULL;
- assert_d_eq(mallctl("thread.prof.name", NULL, NULL,
+ expect_d_eq(mallctl("thread.prof.name", NULL, NULL,
(void *)&thread_name, sizeof(thread_name)), EFAULT,
"Unexpected mallctl result writing \"%s\" to thread.prof.name",
thread_name);
/* '\n' shouldn't be allowed. */
thread_name = "hi\nthere";
- assert_d_eq(mallctl("thread.prof.name", NULL, NULL,
+ expect_d_eq(mallctl("thread.prof.name", NULL, NULL,
(void *)&thread_name, sizeof(thread_name)), EFAULT,
"Unexpected mallctl result writing \"%s\" to thread.prof.name",
thread_name);
@@ -57,7 +58,7 @@ TEST_BEGIN(test_prof_thread_name_validation) {
size_t sz;
sz = sizeof(thread_name_old);
- assert_d_eq(mallctl("thread.prof.name",
+ expect_d_eq(mallctl("thread.prof.name",
(void *)&thread_name_old, &sz, (void *)&thread_name,
sizeof(thread_name)), EPERM,
"Unexpected mallctl result writing \"%s\" to "
@@ -82,7 +83,7 @@ thd_start(void *varg) {
mallctl_thread_name_set(thread_name);
for (i = 0; i < NRESET; i++) {
- assert_d_eq(mallctl("prof.reset", NULL, NULL, NULL, 0), 0,
+ expect_d_eq(mallctl("prof.reset", NULL, NULL, NULL, 0), 0,
"Unexpected error while resetting heap profile data");
mallctl_thread_name_get(thread_name);
}
@@ -94,12 +95,13 @@ thd_start(void *varg) {
}
TEST_BEGIN(test_prof_thread_name_threaded) {
+ test_skip_if(!config_prof);
+ test_skip_if(opt_prof_sys_thread_name);
+
thd_t thds[NTHREADS];
unsigned thd_args[NTHREADS];
unsigned i;
- test_skip_if(!config_prof);
-
for (i = 0; i < NTHREADS; i++) {
thd_args[i] = i;
thd_create(&thds[i], thd_start, (void *)&thd_args[i]);