From 3ee18d4f08fd32bd5271b049a2f0ed2491f9ae21 Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Mon, 2 Dec 2024 16:05:04 +0100 Subject: [PATCH] Enable sysfeatures for ACCESSMODE=perf_event --- src/access.c | 29 +++++++++++++--- src/configuration.c | 8 +++++ src/frequency_cpu.c | 2 +- src/sysFeatures_amd.c | 33 +++++++++++++++++- src/sysFeatures_amd_rapl.c | 26 ++++++++++++++ src/sysFeatures_common.c | 1 + src/sysFeatures_cpufreq.c | 48 +++++++++++++------------- src/sysFeatures_intel_rapl.c | 34 ++++++++++++------ src/sysFeatures_linux_numa_balancing.c | 8 ++--- 9 files changed, 144 insertions(+), 45 deletions(-) diff --git a/src/access.c b/src/access.c index 2e4b05e56..c3bdd0bb3 100644 --- a/src/access.c +++ b/src/access.c @@ -79,7 +79,22 @@ int HPMinit(void) { int ret = 0; - topology_init(); + Configuration_t config = NULL; + ret = topology_init(); + if (ret < 0) + { + errno = -ret; + ERROR_PRINT(Failed to initialize topology); + return ret; + } + ret = init_configuration(); + if (ret < 0) + { + errno = -ret; + ERROR_PRINT(Failed to initialize configuration); + return ret; + } + config = get_configuration(); if (registeredCpuList == NULL) { registeredCpuList = malloc(cpuid_topology.numHWThreads* sizeof(int)); @@ -89,11 +104,11 @@ HPMinit(void) if (access_init == NULL) { #if defined(__x86_64__) || defined(__i386__) - if (config.daemonMode == -1) + if (config->daemonMode == -2) { - config.daemonMode = ACCESSMODE_DAEMON; + config->daemonMode = ACCESSMODE_DAEMON; } - if (config.daemonMode == ACCESSMODE_DAEMON) + if (config->daemonMode == ACCESSMODE_DAEMON) { DEBUG_PLAIN_PRINT(DEBUGLEV_DEVELOP, Adjusting functions for x86 architecture in daemon mode); access_init = &access_client_init; @@ -102,7 +117,7 @@ HPMinit(void) access_finalize = &access_client_finalize; access_check = &access_client_check; } - else if (config.daemonMode == ACCESSMODE_DIRECT) + else if (config->daemonMode == ACCESSMODE_DIRECT) { DEBUG_PLAIN_PRINT(DEBUGLEV_DEVELOP, Adjusting functions for x86 architecture in direct mode); access_init = &access_x86_init; @@ -111,6 +126,10 @@ HPMinit(void) access_finalize = &access_x86_finalize; access_check = &access_x86_check; } + else + { + DEBUG_PLAIN_PRINT(DEBUGLEV_DEVELOP, HPMinit called in perf_event mode); + } #endif } diff --git a/src/configuration.c b/src/configuration.c index 063039045..fc36cbf12 100644 --- a/src/configuration.c +++ b/src/configuration.c @@ -261,6 +261,14 @@ init_configuration(void) { config.daemonMode = ACCESSMODE_DIRECT; } + else if (strcmp(value, "perf_event") == 0) + { +#ifdef LIKWID_USE_PERFEVENT + config.daemonMode = ACCESSMODE_PERF; +#else + ERROR_PRINT(Invalid access mode 'perf_event'. Library not built with 'perf_event' support); +#endif + } } else if (strcmp(name, "max_threads") == 0) { diff --git a/src/frequency_cpu.c b/src/frequency_cpu.c index 30c28bd56..1f6dcb776 100644 --- a/src/frequency_cpu.c +++ b/src/frequency_cpu.c @@ -943,7 +943,7 @@ _freqInit(void) if (freq_init_f == NULL) { #if defined(__x86_64__) || defined(__i386__) - if (config.daemonMode == -1) + if (config.daemonMode == -2) { config.daemonMode = ACCESSMODE_DAEMON; } diff --git a/src/sysFeatures_amd.c b/src/sysFeatures_amd.c index 4fa4dd41f..bf9176b45 100644 --- a/src/sysFeatures_amd.c +++ b/src/sysFeatures_amd.c @@ -76,6 +76,31 @@ int likwid_sysft_init_x86_amd(_SysFeatureList* out) return (c > 0 ? 0 : -ENOTSUP); } +static int amd_cpu_register_access_test() +{ + int err = 0; + Configuration_t config = NULL; + err = init_configuration(); + if (err < 0) + { + errno = -err; + ERROR_PRINT(Failed to initialize configuration); + return err; + } + config = get_configuration(); + if (config->daemonMode == ACCESSMODE_PERF) + { + return 0; + } + err = HPMinit(); + if (err < 0) + return err; + err = HPMaddThread(0); + if (err < 0) + return err; + return 1; +} + static int amd_cpu_l1_stream_getter(const LikwidDevice_t device, char** value) { return likwid_sysft_readmsr_bit_to_string(device, MSR_AMD19_PREFETCH_CONTROL, 0, true, value); @@ -137,6 +162,7 @@ static _SysFeature amd_k19_cpu_prefetch_features[] = { static const _SysFeatureList amd_k19_cpu_prefetch_feature_list = { .num_features = ARRAY_COUNT(amd_k19_cpu_prefetch_features), .features = amd_k19_cpu_prefetch_features, + .tester = amd_cpu_register_access_test, }; static int amd_cpu_spec_ibrs_getter(const LikwidDevice_t device, char** value) @@ -195,16 +221,19 @@ static _SysFeature amd_k17_cpu_speculation_features[] = { static const _SysFeatureList amd_k19_cpu_speculation_feature_list = { .num_features = ARRAY_COUNT(amd_k19_cpu_speculation_features), .features = amd_k19_cpu_speculation_features, + .tester = amd_cpu_register_access_test, }; static const _SysFeatureList amd_k17_cpu_speculation_feature_list = { .num_features = ARRAY_COUNT(amd_k17_cpu_speculation_features), .features = amd_k17_cpu_speculation_features, + .tester = amd_cpu_register_access_test, }; static int amd_cpu_flush_l1(const LikwidDevice_t device, const char* value) { uint64_t flush; + int err = likwid_sysft_string_to_uint64(value, &flush); if (err < 0) return err; @@ -224,6 +253,7 @@ static _SysFeature amd_k19_cpu_l1dflush_features[] = { static const _SysFeatureList amd_k19_cpu_l1dflush_feature_list = { .num_features = ARRAY_COUNT(amd_k19_cpu_l1dflush_features), .features = amd_k19_cpu_l1dflush_features, + .tester = amd_cpu_register_access_test, }; static int amd_cpu_hwconfig_cpddis_getter(const LikwidDevice_t device, char** value) @@ -237,12 +267,13 @@ static int amd_cpu_hwconfig_cpddis_setter(const LikwidDevice_t device, const cha } static _SysFeature amd_k17_cpu_hwconfig_features[] = { - {"TurboMode", "cpufreq", "Specifies whether core performance boost is requested to be enabled or disabled", amd_cpu_hwconfig_cpddis_getter, amd_cpu_hwconfig_cpddis_setter, DEVICE_TYPE_HWTHREAD}, + {"turbo_mode", "cpu_freq", "Specifies whether core performance boost is requested to be enabled or disabled", amd_cpu_hwconfig_cpddis_getter, amd_cpu_hwconfig_cpddis_setter, DEVICE_TYPE_HWTHREAD}, }; static const _SysFeatureList amd_k17_cpu_hwconfig_feature_list = { .num_features = ARRAY_COUNT(amd_k17_cpu_hwconfig_features), .features = amd_k17_cpu_hwconfig_features, + .tester = amd_cpu_register_access_test, }; // models 0xA0 - 0xAF, 0x18 diff --git a/src/sysFeatures_amd_rapl.c b/src/sysFeatures_amd_rapl.c index 5e8c0e6f8..eca4696f0 100644 --- a/src/sysFeatures_amd_rapl.c +++ b/src/sysFeatures_amd_rapl.c @@ -198,6 +198,20 @@ static const _SysFeatureList amd_rapl_l3_feature_list = { int likwid_sysft_init_amd_rapl(_SysFeatureList* out) { int err = 0; + Configuration_t config = NULL; + err = init_configuration(); + if (err < 0) + { + errno = -err; + ERROR_PRINT(Failed to initialize configuration); + return err; + } + config = get_configuration(); + if (config->daemonMode == ACCESSMODE_PERF) + { + DEBUG_PRINT(DEBUGLEV_INFO, No AMD RAPL support with accessmode=perf_event); + return 0; + } if (amd_rapl_pkg_test()) { DEBUG_PRINT(DEBUGLEV_INFO, Register AMD RAPL PKG domain); @@ -207,6 +221,10 @@ int likwid_sysft_init_amd_rapl(_SysFeatureList* out) DEBUG_PRINT(DEBUGLEV_INFO, AMD RAPL domain PKG not supported); } } + else + { + DEBUG_PRINT(DEBUGLEV_INFO, AMD RAPL domain PKG not supported); + } if (amd_rapl_core_test()) { DEBUG_PRINT(DEBUGLEV_INFO, Register AMD RAPL CORE domain); @@ -216,6 +234,10 @@ int likwid_sysft_init_amd_rapl(_SysFeatureList* out) DEBUG_PRINT(DEBUGLEV_INFO, AMD RAPL domain CORE not supported); } } + else + { + DEBUG_PRINT(DEBUGLEV_INFO, AMD RAPL domain CORE not supported); + } if (amd_rapl_l3_test()) { DEBUG_PRINT(DEBUGLEV_INFO, Register AMD RAPL L3 domain); @@ -225,5 +247,9 @@ int likwid_sysft_init_amd_rapl(_SysFeatureList* out) DEBUG_PRINT(DEBUGLEV_INFO, AMD RAPL domain L3 not supported); } } + else + { + DEBUG_PRINT(DEBUGLEV_INFO, AMD RAPL domain L3 not supported); + } return 0; } diff --git a/src/sysFeatures_common.c b/src/sysFeatures_common.c index bb20fd5d2..ce0c053bb 100644 --- a/src/sysFeatures_common.c +++ b/src/sysFeatures_common.c @@ -309,6 +309,7 @@ int likwid_sysft_foreach_socket_testmsr_cb(uint64_t reg, likwid_sysft_msr_test_f int err = topology_init(); if (err < 0) return err; + err = HPMinit(); if (err < 0) return err; diff --git a/src/sysFeatures_cpufreq.c b/src/sysFeatures_cpufreq.c index 5a3547855..5d86347fa 100644 --- a/src/sysFeatures_cpufreq.c +++ b/src/sysFeatures_cpufreq.c @@ -195,11 +195,11 @@ static int cpufreq_acpi_test(void) } static _SysFeature cpufreq_acpi_features[] = { - {"cur_cpu_freq", "cpu_freq", "Current CPU frequency", cpufreq_acpi_cur_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD}, - {"min_cpu_freq", "cpu_freq", "Minimal CPU frequency", cpufreq_acpi_min_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD}, - {"max_cpu_freq", "cpu_freq", "Maximal CPU frequency", cpufreq_acpi_max_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD}, + {"cur_cpu_freq", "cpu_freq", "Current CPU frequency", cpufreq_acpi_cur_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"min_cpu_freq", "cpu_freq", "Minimal CPU frequency", cpufreq_acpi_min_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"max_cpu_freq", "cpu_freq", "Maximal CPU frequency", cpufreq_acpi_max_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, {"avail_freqs", "cpu_freq", "Available CPU frequencies", cpufreq_acpi_avail_cpu_freqs_getter, NULL, DEVICE_TYPE_HWTHREAD}, - {"governor", "cpu_freq", "CPU frequency governor", cpufreq_acpi_governor_getter, cpufreq_acpi_governor_setter, DEVICE_TYPE_HWTHREAD}, + {"governor", "cpu_freq", "CPU frequency governor", cpufreq_acpi_governor_getter, /*cpufreq_acpi_governor_setter*/ NULL, DEVICE_TYPE_HWTHREAD}, {"avail_governors", "cpu_freq", "Available CPU frequency governors", cpufreq_acpi_avail_governors_getter, NULL, DEVICE_TYPE_HWTHREAD}, }; @@ -264,10 +264,10 @@ static int cpufreq_intel_pstate_test(void) } static _SysFeature cpufreq_pstate_features[] = { - {"base_freq", "cpu_freq", "Base CPU frequency", cpufreq_intel_pstate_base_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD}, - {"cur_cpu_freq", "cpu_freq", "Current CPU frequency", cpufreq_intel_pstate_cur_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD}, - {"min_cpu_freq", "cpu_freq", "Minimal CPU frequency", cpufreq_intel_pstate_min_cpu_freq_getter, cpufreq_intel_pstate_min_cpu_freq_setter, DEVICE_TYPE_HWTHREAD}, - {"max_cpu_freq", "cpu_freq", "Maximal CPU frequency", cpufreq_intel_pstate_max_cpu_freq_getter, cpufreq_intel_pstate_max_cpu_freq_setter, DEVICE_TYPE_HWTHREAD}, + {"base_freq", "cpu_freq", "Base CPU frequency", cpufreq_intel_pstate_base_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"cur_cpu_freq", "cpu_freq", "Current CPU frequency", cpufreq_intel_pstate_cur_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"min_cpu_freq", "cpu_freq", "Minimal CPU frequency", cpufreq_intel_pstate_min_cpu_freq_getter, cpufreq_intel_pstate_min_cpu_freq_setter, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"max_cpu_freq", "cpu_freq", "Maximal CPU frequency", cpufreq_intel_pstate_max_cpu_freq_getter, cpufreq_intel_pstate_max_cpu_freq_setter, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, {"governor", "cpu_freq", "CPU frequency governor", cpufreq_intel_pstate_governor_getter, cpufreq_intel_pstate_governor_setter, DEVICE_TYPE_HWTHREAD}, {"avail_governors", "cpu_freq", "Available CPU frequency governors", cpufreq_intel_pstate_avail_governors_getter, NULL, DEVICE_TYPE_HWTHREAD}, }; @@ -288,9 +288,9 @@ static int cpufreq_intel_cpufreq_test(void) /* INFO: Most sysfs entries are the same as for the intel_pstate driver, * so they share the same getters. */ static _SysFeature cpufreq_intel_cpufreq_features[] = { - {"cur_cpu_freq", "cpu_freq", "Current CPU frequency", cpufreq_intel_pstate_cur_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD}, - {"min_cpu_freq", "cpu_freq", "Minimal CPU frequency", cpufreq_intel_pstate_min_cpu_freq_getter, cpufreq_intel_pstate_min_cpu_freq_setter, DEVICE_TYPE_HWTHREAD}, - {"max_cpu_freq", "cpu_freq", "Maximal CPU frequency", cpufreq_intel_pstate_max_cpu_freq_getter, cpufreq_intel_pstate_max_cpu_freq_setter, DEVICE_TYPE_HWTHREAD}, + {"cur_cpu_freq", "cpu_freq", "Current CPU frequency", cpufreq_intel_pstate_cur_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"min_cpu_freq", "cpu_freq", "Minimal CPU frequency", cpufreq_intel_pstate_min_cpu_freq_getter, cpufreq_intel_pstate_min_cpu_freq_setter, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"max_cpu_freq", "cpu_freq", "Maximal CPU frequency", cpufreq_intel_pstate_max_cpu_freq_getter, cpufreq_intel_pstate_max_cpu_freq_setter, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, {"governor", "cpu_freq", "CPU frequency governor", cpufreq_intel_pstate_governor_getter, cpufreq_intel_pstate_governor_setter, DEVICE_TYPE_HWTHREAD}, {"avail_governors", "cpu_freq", "Available CPU frequency governors", cpufreq_intel_pstate_avail_governors_getter, NULL, DEVICE_TYPE_HWTHREAD}, }; @@ -319,9 +319,9 @@ static int cpufreq_cppc_test(void) } static _SysFeature cpufreq_cppc_features[] = { - {"cur_cpu_freq", "cpu_freq", "Current CPU frequency", cpufreq_intel_pstate_cur_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD}, - {"min_cpu_freq", "cpu_freq", "Minimal CPU frequency", cpufreq_intel_pstate_min_cpu_freq_getter, cpufreq_intel_pstate_min_cpu_freq_setter, DEVICE_TYPE_HWTHREAD}, - {"max_cpu_freq", "cpu_freq", "Maximal CPU frequency", cpufreq_intel_pstate_max_cpu_freq_getter, cpufreq_intel_pstate_max_cpu_freq_setter, DEVICE_TYPE_HWTHREAD}, + {"cur_cpu_freq", "cpu_freq", "Current CPU frequency", cpufreq_intel_pstate_cur_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"min_cpu_freq", "cpu_freq", "Minimal CPU frequency", cpufreq_intel_pstate_min_cpu_freq_getter, cpufreq_intel_pstate_min_cpu_freq_setter, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"max_cpu_freq", "cpu_freq", "Maximal CPU frequency", cpufreq_intel_pstate_max_cpu_freq_getter, cpufreq_intel_pstate_max_cpu_freq_setter, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, {"boost", "cpu_freq", "Turbo boost", cpufreq_cppc_boost_getter, cpufreq_cppc_boost_setter, DEVICE_TYPE_HWTHREAD}, {"governor", "cpu_freq", "CPU frequency governor", cpufreq_intel_pstate_governor_getter, cpufreq_intel_pstate_governor_setter, DEVICE_TYPE_HWTHREAD}, {"avail_governors", "cpu_freq", "Available CPU frequency governors", cpufreq_intel_pstate_avail_governors_getter, NULL, DEVICE_TYPE_HWTHREAD}, @@ -341,9 +341,9 @@ static int cpufreq_apple_cpufreq_test(void) } static _SysFeature cpufreq_apple_cpufreq_features[] = { - {"cur_cpu_freq", "cpu_freq", "Current CPU frequency", cpufreq_intel_pstate_cur_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD}, - {"min_cpu_freq", "cpu_freq", "Minimal CPU frequency", cpufreq_intel_pstate_min_cpu_freq_getter, cpufreq_intel_pstate_min_cpu_freq_setter, DEVICE_TYPE_HWTHREAD}, - {"max_cpu_freq", "cpu_freq", "Maximal CPU frequency", cpufreq_intel_pstate_max_cpu_freq_getter, cpufreq_intel_pstate_max_cpu_freq_setter, DEVICE_TYPE_HWTHREAD}, + {"cur_cpu_freq", "cpu_freq", "Current CPU frequency", cpufreq_intel_pstate_cur_cpu_freq_getter, NULL, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"min_cpu_freq", "cpu_freq", "Minimal CPU frequency", cpufreq_intel_pstate_min_cpu_freq_getter, cpufreq_intel_pstate_min_cpu_freq_setter, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, + {"max_cpu_freq", "cpu_freq", "Maximal CPU frequency", cpufreq_intel_pstate_max_cpu_freq_getter, cpufreq_intel_pstate_max_cpu_freq_setter, DEVICE_TYPE_HWTHREAD, NULL, "kHz"}, {"avail_freqs", "cpu_freq", "Available CPU frequencies", cpufreq_acpi_avail_cpu_freqs_getter, NULL, DEVICE_TYPE_HWTHREAD}, {"governor", "cpu_freq", "CPU frequency governor", cpufreq_intel_pstate_governor_getter, cpufreq_intel_pstate_governor_setter, DEVICE_TYPE_HWTHREAD}, {"avail_governors", "cpu_freq", "Available CPU frequency governors", cpufreq_intel_pstate_avail_governors_getter, NULL, DEVICE_TYPE_HWTHREAD}, @@ -418,7 +418,7 @@ int likwid_sysft_init_cpufreq(_SysFeatureList* out) int err = 0; if (cpufreq_intel_pstate_test()) { - DEBUG_PRINT(DEBUGLEV_DEVELOP, Registering Intel Pstate knobs for cpufreq) + DEBUG_PRINT(DEBUGLEV_INFO, Registering Intel Pstate knobs for cpufreq) err = likwid_sysft_register_features(out, &cpufreq_pstate_feature_list); if (err < 0) { @@ -427,7 +427,7 @@ int likwid_sysft_init_cpufreq(_SysFeatureList* out) } else if (cpufreq_intel_cpufreq_test()) { - DEBUG_PRINT(DEBUGLEV_DEVELOP, Registering Intel Cpufreq knobs for cpufreq) + DEBUG_PRINT(DEBUGLEV_INFO, Registering Intel Cpufreq knobs for cpufreq) err = likwid_sysft_register_features(out, &cpufreq_intel_cpufreq_feature_list); if (err < 0) { @@ -436,7 +436,7 @@ int likwid_sysft_init_cpufreq(_SysFeatureList* out) } else if (cpufreq_acpi_test()) { - DEBUG_PRINT(DEBUGLEV_DEVELOP, Registering ACPI cpufreq knobs for cpufreq) + DEBUG_PRINT(DEBUGLEV_INFO, Registering ACPI cpufreq knobs for cpufreq) likwid_sysft_register_features(out, &cpufreq_acpi_feature_list); if (err < 0) { @@ -445,7 +445,7 @@ int likwid_sysft_init_cpufreq(_SysFeatureList* out) } else if (cpufreq_cppc_test()) { - DEBUG_PRINT(DEBUGLEV_DEVELOP, Registering CPPC cpufreq knobs for cpufreq) + DEBUG_PRINT(DEBUGLEV_INFO, Registering CPPC cpufreq knobs for cpufreq) likwid_sysft_register_features(out, &cpufreq_cppc_feature_list); if (err < 0) { @@ -454,7 +454,7 @@ int likwid_sysft_init_cpufreq(_SysFeatureList* out) } else if (cpufreq_apple_cpufreq_test()) { - DEBUG_PRINT(DEBUGLEV_DEVELOP, Registering Apple cpufreq knobs for cpufreq) + DEBUG_PRINT(DEBUGLEV_INFO, Registering Apple cpufreq knobs for cpufreq) likwid_sysft_register_features(out, &cpufreq_apple_cpufreq_feature_list); if (err < 0) { @@ -464,7 +464,7 @@ int likwid_sysft_init_cpufreq(_SysFeatureList* out) if (cpufreq_epp_test()) { - DEBUG_PRINT(DEBUGLEV_DEVELOP, Registering Energy Performance Preference knobs for cpufreq) + DEBUG_PRINT(DEBUGLEV_INFO, Registering Energy Performance Preference knobs for cpufreq) err = likwid_sysft_register_features(out, &cpufreq_epp_feature_list); if (err < 0) { @@ -473,7 +473,7 @@ int likwid_sysft_init_cpufreq(_SysFeatureList* out) } if (cpufreq_scaling_driver_test()) { - DEBUG_PRINT(DEBUGLEV_DEVELOP, Registering Scaling Driver knobs for cpufreq) + DEBUG_PRINT(DEBUGLEV_INFO, Registering Scaling Driver knobs for cpufreq) err = likwid_sysft_register_features(out, &cpufreq_scaling_driver_feature_list); if (err < 0) { diff --git a/src/sysFeatures_intel_rapl.c b/src/sysFeatures_intel_rapl.c index 2a3f00226..a09154712 100644 --- a/src/sysFeatures_intel_rapl.c +++ b/src/sysFeatures_intel_rapl.c @@ -1041,6 +1041,20 @@ static const _SysFeatureList intel_rapl_pp1_feature_list = { int likwid_sysft_init_intel_rapl(_SysFeatureList* out) { int err = 0; + Configuration_t config = NULL; + err = init_configuration(); + if (err < 0) + { + errno = -err; + ERROR_PRINT(Failed to initialize configuration); + return err; + } + config = get_configuration(); + if (config->daemonMode == ACCESSMODE_PERF) + { + DEBUG_PRINT(DEBUGLEV_INFO, No Intel RAPL support with accessmode=perf_event); + return 0; + } if (intel_rapl_pkg_test()) { DEBUG_PRINT(DEBUGLEV_INFO, Register Intel RAPL PKG domain); @@ -1055,12 +1069,12 @@ int likwid_sysft_init_intel_rapl(_SysFeatureList* out) err = likwid_sysft_register_features(out, &intel_rapl_pkg_feature_list); if (err < 0) { - DEBUG_PRINT(DEBUGLEV_INFO, RAPL domain PKG not supported); + DEBUG_PRINT(DEBUGLEV_INFO, Intel RAPL domain PKG not supported); } } else { - DEBUG_PRINT(DEBUGLEV_INFO, RAPL domain PKG not supported); + DEBUG_PRINT(DEBUGLEV_INFO, Intel RAPL domain PKG not supported); } if (intel_rapl_dram_test()) { @@ -1076,12 +1090,12 @@ int likwid_sysft_init_intel_rapl(_SysFeatureList* out) err = likwid_sysft_register_features(out, &intel_rapl_dram_feature_list); if (err < 0) { - DEBUG_PRINT(DEBUGLEV_INFO, RAPL domain DRAM not supported); + DEBUG_PRINT(DEBUGLEV_INFO, Intel RAPL domain DRAM not supported); } } else { - DEBUG_PRINT(DEBUGLEV_INFO, RAPL domain DRAM not supported); + DEBUG_PRINT(DEBUGLEV_INFO, Intel RAPL domain DRAM not supported); } if (intel_rapl_pp0_test()) { @@ -1097,12 +1111,12 @@ int likwid_sysft_init_intel_rapl(_SysFeatureList* out) err = likwid_sysft_register_features(out, &intel_rapl_pp0_feature_list); if (err < 0) { - DEBUG_PRINT(DEBUGLEV_INFO, RAPL domain PP0 not supported); + DEBUG_PRINT(DEBUGLEV_INFO, Intel RAPL domain PP0 not supported); } } else { - DEBUG_PRINT(DEBUGLEV_INFO, RAPL domain PP0 not supported); + DEBUG_PRINT(DEBUGLEV_INFO, Intel RAPL domain PP0 not supported); } if (intel_rapl_pp1_test()) { @@ -1118,12 +1132,12 @@ int likwid_sysft_init_intel_rapl(_SysFeatureList* out) err = likwid_sysft_register_features(out, &intel_rapl_pp1_feature_list); if (err < 0) { - DEBUG_PRINT(DEBUGLEV_INFO, RAPL domain PP1 not supported); + DEBUG_PRINT(DEBUGLEV_INFO, Intel RAPL domain PP1 not supported); } } else { - DEBUG_PRINT(DEBUGLEV_INFO, RAPL domain PP1 not supported); + DEBUG_PRINT(DEBUGLEV_INFO, Intel RAPL domain PP1 not supported); } if (intel_rapl_psys_test()) { @@ -1139,12 +1153,12 @@ int likwid_sysft_init_intel_rapl(_SysFeatureList* out) err = likwid_sysft_register_features(out, &intel_rapl_psys_feature_list); if (err < 0) { - DEBUG_PRINT(DEBUGLEV_INFO, RAPL domain PSYS not supported); + DEBUG_PRINT(DEBUGLEV_INFO, Intel RAPL domain PSYS not supported); } } else { - DEBUG_PRINT(DEBUGLEV_INFO, RAPL domain PSYS not supported); + DEBUG_PRINT(DEBUGLEV_INFO, Intel RAPL domain PSYS not supported); } return 0; } diff --git a/src/sysFeatures_linux_numa_balancing.c b/src/sysFeatures_linux_numa_balancing.c index efb3895b0..6c1fe7030 100644 --- a/src/sysFeatures_linux_numa_balancing.c +++ b/src/sysFeatures_linux_numa_balancing.c @@ -166,10 +166,10 @@ static int numa_balancing_rate_limit_getter(const LikwidDevice_t device, char** static _SysFeature numa_balancing_features[] = { {"numa_balancing", "os", "Current state of NUMA balancing", numa_balancing_state_getter, NULL, DEVICE_TYPE_NODE}, - {"numa_balancing_scan_delay_ms", "os", "Time between page scans", numa_balancing_scan_delay_getter, NULL, DEVICE_TYPE_NODE, numa_balancing_scan_delay_test}, - {"numa_balancing_scan_period_min_ms", "os", "Minimal time for scan period", numa_balancing_scan_period_min_getter, NULL, DEVICE_TYPE_NODE, numa_balancing_scan_period_min_test}, - {"numa_balancing_scan_period_max_ms", "os", "Maximal time for scan period", numa_balancing_scan_period_max_getter, NULL, DEVICE_TYPE_NODE, numa_balancing_scan_period_max_test}, - {"numa_balancing_scan_size_mb", "os", "Scan size for NUMA balancing", numa_balancing_scan_size_getter, NULL, DEVICE_TYPE_NODE, numa_balancing_scan_size_test}, + {"numa_balancing_scan_delay", "os", "Time between page scans", numa_balancing_scan_delay_getter, NULL, DEVICE_TYPE_NODE, numa_balancing_scan_delay_test, "ms"}, + {"numa_balancing_scan_period_min", "os", "Minimal time for scan period", numa_balancing_scan_period_min_getter, NULL, DEVICE_TYPE_NODE, numa_balancing_scan_period_min_test, "ms"}, + {"numa_balancing_scan_period_max", "os", "Maximal time for scan period", numa_balancing_scan_period_max_getter, NULL, DEVICE_TYPE_NODE, numa_balancing_scan_period_max_test, "ms"}, + {"numa_balancing_scan_size", "os", "Scan size for NUMA balancing", numa_balancing_scan_size_getter, NULL, DEVICE_TYPE_NODE, numa_balancing_scan_size_test, "MB/s"}, {"numa_balancing_promote_rate_limit", "os", "Rate limit for NUMA balancing", numa_balancing_rate_limit_getter, NULL, DEVICE_TYPE_NODE, numa_balancing_rate_limit_test, "MB/s"}, };