1 /* 2 * Arm SCP/MCP Software 3 * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 * 7 * Description: 8 * Metrics Analyzer 9 */ 10 11 #ifndef MOD_METRICS_ANALYZER_H 12 #define MOD_METRICS_ANALYZER_H 13 14 #include <fwk_id.h> 15 16 /*! 17 * \addtogroup GroupModules Modules 18 * \{ 19 */ 20 21 /*! 22 * \defgroup GroupMetricsAnalyzer System Metrics Analyzer 23 * \{ 24 */ 25 26 /*! 27 * \brief API indices 28 */ 29 enum mod_metrics_analyzer_api_idx { 30 /*! Metrics_Analyzer API analyze idx */ 31 MOD_METRICS_ANALYZER_API_IDX_ANALYZE, 32 /*! Metrics_Analyzer API count */ 33 MOD_METRICS_ANALYZER_API_IDX_COUNT, 34 }; 35 36 /*! 37 * \brief Metrics analyzer interactor, which can be a provider or a consumer. 38 * The interactor is defined by the API ID and the corresponding domain 39 * ID from the interactor perspective. 40 */ 41 struct mod_metrics_analyzer_interactor { 42 /*! 43 * ID of the API which information is transfered through. 44 */ 45 const fwk_id_t api_id; 46 /*! 47 * The ID to be used when calling the API with. 48 The domain under interaction. 49 */ 50 const fwk_id_t domain_id; 51 }; 52 53 /*! 54 * \brief Metrics Analyzer module domain configuration data. 55 */ 56 struct mod_metrics_analyzer_domain_config { 57 /*! 58 * List of the power limit providers for the metrics analyzer domain. 59 */ 60 const struct mod_metrics_analyzer_interactor *limit_providers; 61 /*! 62 * The power limit consumer for the metrics analyzer domain. 63 */ 64 const struct mod_metrics_analyzer_interactor limit_consumer; 65 }; 66 67 /*! 68 * \brief Metrics Analyzer Analyze API 69 * 70 * \details Interface implemented Metrics Analyzer to run analysis on 71 * Metrics limits for all domains. 72 */ 73 struct mod_metrics_analyzer_analyze_api { 74 /*! 75 * \brief Analyze Metrics Limits 76 * 77 * \retval ::FWK_SUCCESS The operation succeeded. 78 * \retval ::One of the standard framework status codes. 79 */ 80 int (*analyze)(void); 81 }; 82 83 /*! 84 * \} 85 */ 86 87 /*! 88 * \} 89 */ 90 91 #endif /* MOD_METRICS_ANALYZER_H */ 92