Skip to content

Commit feee27a

Browse files
committed
Add logs to query_attribute_value()
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 69ecc44 commit feee27a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/memory_targets/memory_target_numa.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,27 +189,31 @@ static umf_result_t query_attribute_value(void *srcMemoryTarget,
189189
memattr_type_t type) {
190190
hwloc_topology_t topology = umfGetTopology();
191191
if (!topology) {
192+
LOG_ERR("umfGetTopology() failed");
192193
return UMF_RESULT_ERROR_NOT_SUPPORTED;
193194
}
194195

195196
hwloc_obj_t srcNumaNode = hwloc_get_obj_by_type(
196197
topology, HWLOC_OBJ_NUMANODE,
197198
((struct numa_memory_target_t *)srcMemoryTarget)->physical_id);
198199
if (!srcNumaNode) {
200+
LOG_ERR("hwloc_get_obj_by_type() failed");
199201
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
200202
}
201203

202204
hwloc_obj_t dstNumaNode = hwloc_get_obj_by_type(
203205
topology, HWLOC_OBJ_NUMANODE,
204206
((struct numa_memory_target_t *)dstMemoryTarget)->physical_id);
205207
if (!dstNumaNode) {
208+
LOG_ERR("hwloc_get_obj_by_type() failed");
206209
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
207210
}
208211

209212
// Given NUMA nodes aren't local, HWLOC returns an error in such case.
210213
if (!hwloc_bitmap_intersects(srcNumaNode->cpuset, dstNumaNode->cpuset)) {
211214
// Since we want to skip such query, we return the worst possible
212215
// value for given memory attribute.
216+
LOG_ERR("hwloc_bitmap_intersects() failed - memattr_get_worst_value()");
213217
*value = memattr_get_worst_value(type);
214218
return UMF_RESULT_SUCCESS;
215219
}
@@ -234,6 +238,7 @@ static umf_result_t query_attribute_value(void *srcMemoryTarget,
234238
int ret = hwloc_memattr_get_value(topology, hwlocMemAttrType, dstNumaNode,
235239
&initiator, 0, &memAttrValue);
236240
if (ret) {
241+
LOG_PERR("hwloc_memattr_get_value() failed");
237242
return (errno == EINVAL) ? UMF_RESULT_ERROR_NOT_SUPPORTED
238243
: UMF_RESULT_ERROR_UNKNOWN;
239244
}

0 commit comments

Comments
 (0)