From: Aleksinski, MichalX Date: Fri, 22 Feb 2019 07:10:00 +0000 (+0000) Subject: intel_rdt: updated pqos mocks for pqos version 3.0 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e23e9faba01477042e2b039e135c119c8e74d32a;p=collectd.git intel_rdt: updated pqos mocks for pqos version 3.0 Change-Id: Ibcf8c2fd6d1b490cbeeef7480c49da84389104f4 --- diff --git a/src/intel_rdt_test.c b/src/intel_rdt_test.c index 13407387..af5672b9 100644 --- a/src/intel_rdt_test.c +++ b/src/intel_rdt_test.c @@ -4,27 +4,6 @@ /*************************************************************************** * PQOS mocks */ -#if PQOS_VERSION >= 30000 -int pqos_alloc_reset(const enum pqos_cdp_config l3_cdp_cfg, - const enum pqos_cdp_config l2_cdp_cfg, - const enum pqos_mba_config mba_cfg) { - return 0; -} -#elif PQOS_VERSION >= 2000 -int pqos_alloc_reset(const enum pqos_cdp_config l3_cdp_cfg, - const enum pqos_cdp_config l2_cdp_cfg) { - return 0; -} -#else -int pqos_alloc_reset(const enum pqos_cdp_config l3_cdp_cfg) { - return 0; -} -#endif - -#ifdef LIBPQOS2 -/*************************************************************************** - * PQOS v2.0 mocks - */ int pqos_mon_reset(void) { return 0; } int pqos_mon_assoc_get(const unsigned lcore, pqos_rmid_t *rmid) { return 0; } int pqos_mon_start(const unsigned num_cores, const unsigned *cores, @@ -32,6 +11,7 @@ int pqos_mon_start(const unsigned num_cores, const unsigned *cores, struct pqos_mon_data *group) { return 0; } +#if PQOS_VERSION >= 30000 int pqos_mon_start_pids(const unsigned num_pids, const pid_t *pids, const enum pqos_mon_event event, void *context, struct pqos_mon_data *group) { @@ -45,10 +25,32 @@ int pqos_mon_remove_pids(const unsigned num_pids, const pid_t *pids, struct pqos_mon_data *group) { return 0; } + +#else +int pqos_mon_start_pid(const pid_t pids, const enum pqos_mon_event event, + void *context, struct pqos_mon_data *group) { + return 0; +} +#endif int pqos_mon_stop(struct pqos_mon_data *group) { return 0; } int pqos_mon_poll(struct pqos_mon_data **groups, const unsigned num_groups) { return 0; } + +#if PQOS_VERSION >= 30000 +int pqos_alloc_reset(const enum pqos_cdp_config l3_cdp_cfg, + const enum pqos_cdp_config l2_cdp_cfg, + const enum pqos_mba_config mba_cfg) { + return 0; +} +#elif PQOS_VERSION >= 20000 +int pqos_alloc_reset(const enum pqos_cdp_config l3_cdp_cfg, + const enum pqos_cdp_config l2_cdp_cfg) { + return 0; +} +#else +int pqos_alloc_reset(const enum pqos_cdp_config l3_cdp_cfg) { return 0; } +#endif int pqos_alloc_assoc_set(const unsigned lcore, const unsigned class_id) { return 0; } @@ -81,6 +83,7 @@ int pqos_cap_get(const struct pqos_cap **cap, const struct pqos_cpuinfo **cpu) { return 0; } +#ifdef LIBPQOS2 /*************************************************************************** * helper functions */ @@ -287,56 +290,6 @@ int main(void) { } #else -/*************************************************************************** - * PQOS v1.2 mocks - */ -int pqos_mon_reset(void) { return 0; } -int pqos_mon_assoc_get(const unsigned lcore, pqos_rmid_t *rmid) { return 0; } -int pqos_mon_start(const unsigned num_cores, const unsigned *cores, - const enum pqos_mon_event event, void *context, - struct pqos_mon_data *group) { - return 0; -} -int pqos_mon_start_pid(const pid_t pids, const enum pqos_mon_event event, - void *context, struct pqos_mon_data *group) { - return 0; -} -int pqos_mon_stop(struct pqos_mon_data *group) { return 0; } -int pqos_mon_poll(struct pqos_mon_data **groups, const unsigned num_groups) { - return 0; -} -int pqos_alloc_assoc_set(const unsigned lcore, const unsigned class_id) { - return 0; -} -int pqos_alloc_assoc_get(const unsigned lcore, unsigned *class_id) { return 0; } -int pqos_alloc_assoc_set_pid(const pid_t task, const unsigned class_id) { - return 0; -} -int pqos_alloc_assoc_get_pid(const pid_t task, unsigned *class_id) { return 0; } -int pqos_alloc_assign(const unsigned technology, const unsigned *core_array, - const unsigned core_num, unsigned *class_id) { - return 0; -} -int pqos_alloc_release(const unsigned *core_array, const unsigned core_num) { - return 0; -} -int pqos_alloc_assign_pid(const unsigned technology, const pid_t *task_array, - const unsigned task_num, unsigned *class_id) { - return 0; -} -int pqos_alloc_release_pid(const pid_t *task_array, const unsigned task_num) { - return 0; -} -int pqos_init(const struct pqos_config *config) { return 0; } -int pqos_fini(void) { return 0; } -int pqos_cap_get_type(const struct pqos_cap *cap, const enum pqos_cap_type type, - const struct pqos_capability **cap_item) { - return 0; -} -int pqos_cap_get(const struct pqos_cap **cap, const struct pqos_cpuinfo **cpu) { - return 0; -} - DEF_TEST(pqos12_test_stub) { EXPECT_EQ_INT(0, 0); return 0;