Blame test/allocator_perf_tool/Allocation_info.cpp
|
Packit Service |
7f3b24 |
// SPDX-License-Identifier: BSD-2-Clause
|
|
Packit Service |
7f3b24 |
/* Copyright (C) 2015 - 2020 Intel Corporation. */
|
|
Packit |
345191 |
|
|
Packit |
345191 |
#include "Allocation_info.hpp"
|
|
Packit |
345191 |
#include <numaif.h>
|
|
Packit |
345191 |
|
|
Packit |
345191 |
double convert_bytes_to_mb(uint64_t bytes)
|
|
Packit |
345191 |
{
|
|
Packit |
345191 |
return bytes / (1024.0 * 1024.0);
|
|
Packit |
345191 |
}
|
|
Packit |
345191 |
|
|
Packit |
345191 |
int get_numa_node_id(void *ptr)
|
|
Packit |
345191 |
{
|
|
Packit |
345191 |
int status = -1;
|
|
Packit |
345191 |
|
|
Packit |
345191 |
get_mempolicy(&status, NULL, 0, ptr, MPOL_F_NODE | MPOL_F_ADDR);
|
|
Packit |
345191 |
return status;
|
|
Packit |
345191 |
}
|