Skip to content

Commit 49265d8

Browse files
committed
remove tests for changing pool name thru ctl
1 parent 7796ebe commit 49265d8

17 files changed

+98
-360
lines changed

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ if(LINUX)
300300

301301
target_include_directories(
302302
${EXAMPLE_NAME} PRIVATE ${UMF_CMAKE_SOURCE_DIR}/src/utils
303-
${UMF_CMAKE_SOURCE_DIR}/include)
303+
${UMF_CMAKE_SOURCE_DIR}/include)
304304

305305
target_link_directories(${EXAMPLE_NAME} PRIVATE ${LIBHWLOC_LIBRARY_DIRS})
306306

examples/ctl/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Copyright(C) 2024 Intel Corporation
2-
#Under the Apache License v2.0 with LLVM Exceptions.See LICENSE.TXT.
3-
#SPDX - License - Identifier : Apache - 2.0 WITH LLVM - exception
1+
# Copyright (C) 2025 Intel Corporation
2+
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

55
cmake_minimum_required(VERSION 3.14.0 FATAL_ERROR)
66
project(umf_example_ctl LANGUAGES C)

examples/ctl/ctl_example.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/*
2+
*
3+
* Copyright (C) 2025 Intel Corporation
4+
*
5+
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
6+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
*
8+
*/
9+
110
#define _GNU_SOURCE 1
211
#include <stdarg.h>
312
#include <stdio.h>

examples/ctl/ctl_statistics_example.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,8 @@ static void print_pool_stat_by_handle(const char *label,
9494
size_t value = 0;
9595
/* Surround the {} placeholder with literal segments so CTL resolves
9696
* whichever pool handle the allocator hands back. */
97-
umf_result_t res =
98-
umfCtlGet("umf.pool.by_handle.{}.stats.{}", &value, sizeof(value),
99-
pool, stat_node);
97+
umf_result_t res = umfCtlGet("umf.pool.by_handle.{}.stats.{}", &value,
98+
sizeof(value), pool, stat_node);
10099
if (report_pool_stat_failure(label, required_trace_level, res)) {
101100
return;
102101
}

src/ctl/ctl_defaults.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef UMF_CTL_DEFAULTS_H
1010
#define UMF_CTL_DEFAULTS_H 1
1111

12-
#include <stddef.h>
1312
#include <stdarg.h>
13+
#include <stddef.h>
1414

1515
#include <umf/base.h>
1616

src/pool/pool_disjoint.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ CTL_WRITE_HANDLER(capacity)(void *ctx, umf_ctl_query_source_t source, void *arg,
205205
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
206206
}
207207
size_t value = *(size_t *)arg;
208-
umf_result_t ret =
209-
umfDisjointPoolParamsSetCapacity(&pool->params, value);
208+
umf_result_t ret = umfDisjointPoolParamsSetCapacity(&pool->params, value);
210209
if (ret == UMF_RESULT_SUCCESS) {
211210
pool->params_overridden |= DP_OVERRIDE_CAPACITY;
212211
}
@@ -279,8 +278,7 @@ CTL_WRITE_HANDLER(pool_trace)(void *ctx, umf_ctl_query_source_t source,
279278
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
280279
}
281280
int value = *(int *)arg;
282-
umf_result_t ret =
283-
umfDisjointPoolParamsSetTrace(&pool->params, value);
281+
umf_result_t ret = umfDisjointPoolParamsSetTrace(&pool->params, value);
284282
if (ret == UMF_RESULT_SUCCESS) {
285283
pool->params_overridden |= DP_OVERRIDE_POOL_TRACE;
286284
}
@@ -557,8 +555,8 @@ umf_result_t disjoint_pool_ctl(void *hPool,
557555
umf_ctl_query_type_t queryType, va_list args) {
558556
utils_init_once(&ctl_initialized, initialize_disjoint_ctl);
559557

560-
return ctl_query(&disjoint_ctl_root, hPool, operationType, name,
561-
queryType, arg, size, args);
558+
return ctl_query(&disjoint_ctl_root, hPool, operationType, name, queryType,
559+
arg, size, args);
562560
}
563561

564562
// Temporary solution for disabling memory poisoning. This is needed because

src/pool/pool_jemalloc.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#include <stdlib.h>
1212
#include <string.h>
1313

14-
#include "ctl/ctl_internal.h"
1514
#include "base_alloc_global.h"
15+
#include "ctl/ctl_internal.h"
1616
#include "memory_provider_internal.h"
1717
#include "provider_tracking.h"
1818
#include "utils_common.h"
@@ -616,9 +616,10 @@ static umf_result_t op_post_initialize(void *pool) {
616616
return UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC;
617617
}
618618

619-
static umf_result_t CTL_RUNNABLE_HANDLER(post_initialize)(
620-
void *ctx, umf_ctl_query_source_t source, void *arg, size_t size,
621-
umf_ctl_index_utlist_t *indexes) {
619+
static umf_result_t
620+
CTL_RUNNABLE_HANDLER(post_initialize)(void *ctx, umf_ctl_query_source_t source,
621+
void *arg, size_t size,
622+
umf_ctl_index_utlist_t *indexes) {
622623
(void)source;
623624
(void)arg;
624625
(void)size;
@@ -627,12 +628,11 @@ static umf_result_t CTL_RUNNABLE_HANDLER(post_initialize)(
627628
}
628629

629630
static void initialize_jemalloc_ctl(void) {
630-
jemalloc_ctl_root.root[jemalloc_ctl_root.first_free++] =
631-
(umf_ctl_node_t){
632-
.name = "post_initialize",
633-
.type = CTL_NODE_LEAF,
634-
.runnable_cb = CTL_RUNNABLE_HANDLER(post_initialize),
635-
};
631+
jemalloc_ctl_root.root[jemalloc_ctl_root.first_free++] = (umf_ctl_node_t){
632+
.name = "post_initialize",
633+
.type = CTL_NODE_LEAF,
634+
.runnable_cb = CTL_RUNNABLE_HANDLER(post_initialize),
635+
};
636636
}
637637

638638
static umf_result_t op_ctl(void *pool, umf_ctl_query_source_t operationType,

src/pool/pool_scalable.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,10 @@ static umf_result_t tbb_get_last_allocation_error(void *pool) {
469469
return TLS_last_allocation_error;
470470
}
471471

472-
static umf_result_t CTL_RUNNABLE_HANDLER(post_initialize)(
473-
void *ctx, umf_ctl_query_source_t source, void *arg, size_t size,
474-
umf_ctl_index_utlist_t *indexes) {
472+
static umf_result_t
473+
CTL_RUNNABLE_HANDLER(post_initialize)(void *ctx, umf_ctl_query_source_t source,
474+
void *arg, size_t size,
475+
umf_ctl_index_utlist_t *indexes) {
475476
(void)source;
476477
(void)arg;
477478
(void)size;

src/provider/provider_cuda.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ struct ctl cu_memory_ctl_root;
110110
static UTIL_ONCE_FLAG ctl_initialized = UTIL_ONCE_FLAG_INIT;
111111

112112
static umf_result_t cu_memory_provider_post_initialize(void *provider);
113-
static umf_result_t CTL_RUNNABLE_HANDLER(post_initialize)(
114-
void *ctx, umf_ctl_query_source_t source, void *arg, size_t size,
115-
umf_ctl_index_utlist_t *indexes) {
113+
static umf_result_t
114+
CTL_RUNNABLE_HANDLER(post_initialize)(void *ctx, umf_ctl_query_source_t source,
115+
void *arg, size_t size,
116+
umf_ctl_index_utlist_t *indexes) {
116117
(void)source;
117118
(void)arg;
118119
(void)size;
@@ -159,12 +160,11 @@ static umf_result_t cu2umf_result(CUresult result) {
159160

160161
static void initialize_cu_ctl(void) {
161162
CTL_REGISTER_MODULE(&cu_memory_ctl_root, stats);
162-
cu_memory_ctl_root.root[cu_memory_ctl_root.first_free++] =
163-
(umf_ctl_node_t){
164-
.name = "post_initialize",
165-
.type = CTL_NODE_LEAF,
166-
.runnable_cb = CTL_RUNNABLE_HANDLER(post_initialize),
167-
};
163+
cu_memory_ctl_root.root[cu_memory_ctl_root.first_free++] = (umf_ctl_node_t){
164+
.name = "post_initialize",
165+
.type = CTL_NODE_LEAF,
166+
.runnable_cb = CTL_RUNNABLE_HANDLER(post_initialize),
167+
};
168168
}
169169

170170
static void init_cu_global_state(void) {

src/provider/provider_file_memory.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ struct ctl file_memory_ctl_root;
161161
static UTIL_ONCE_FLAG ctl_initialized = UTIL_ONCE_FLAG_INIT;
162162

163163
static umf_result_t file_post_initialize(void *provider);
164-
static umf_result_t CTL_RUNNABLE_HANDLER(post_initialize)(
165-
void *ctx, umf_ctl_query_source_t source, void *arg, size_t size,
166-
umf_ctl_index_utlist_t *indexes) {
164+
static umf_result_t
165+
CTL_RUNNABLE_HANDLER(post_initialize)(void *ctx, umf_ctl_query_source_t source,
166+
void *arg, size_t size,
167+
umf_ctl_index_utlist_t *indexes) {
167168
(void)source;
168169
(void)arg;
169170
(void)size;

0 commit comments

Comments
 (0)