diff options
author | Damjan Marion <damarion@cisco.com> | 2024-02-29 16:14:27 +0100 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2024-03-04 08:53:08 +0000 |
commit | 4b6614030f384f7c8d847360cacf5c7f7560c6be (patch) | |
tree | b560c46a2cda2bf6b16e147a52a70ed83c3ce1ce /src/plugins/perfmon | |
parent | 2921e0234185f615d7530343b340573e2cb5caec (diff) |
vppinfra: add os_get_online_cpu_core() and os_get_online_cpu_node()
Type: improvement
Change-Id: I6f99f09c7724ce656a4f41a1d5f9c88d74c00faf
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/perfmon')
-rw-r--r-- | src/plugins/perfmon/intel/uncore.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/perfmon/intel/uncore.c b/src/plugins/perfmon/intel/uncore.c index a709a8d40be..316ebb13571 100644 --- a/src/plugins/perfmon/intel/uncore.c +++ b/src/plugins/perfmon/intel/uncore.c @@ -15,6 +15,8 @@ #include <vnet/vnet.h> #include <vppinfra/linux/sysfs.h> +#include <vppinfra/bitmap.h> +#include <vppinfra/unix.h> #include <perfmon/perfmon.h> #include <perfmon/intel/core.h> #include <perfmon/intel/uncore.h> @@ -148,12 +150,9 @@ intel_uncore_init (vlib_main_t *vm, perfmon_source_t *src) u32 i, j; u8 *s = 0; - if ((err = clib_sysfs_read ("/sys/devices/system/node/online", "%U", - unformat_bitmap_list, &node_bitmap))) - { - clib_error_free (err); - return clib_error_return (0, "failed to discover numa topology"); - } + node_bitmap = os_get_online_cpu_node_bitmap (); + if (!node_bitmap) + return clib_error_return (0, "failed to discover numa topology"); clib_bitmap_foreach (i, node_bitmap) { |