#ifndef __CONFIG_H_
#define __CONFIG_H_
+#define APP_ID_REGEX_MAX_LEN 255
+
/**
* @brief Config scope options.
*/
APPS,
/**
- * @brief Observe one ore more CPU core usage.
+ * @brief Observe top usage of memory or cpu.
*/
- CORES
+ TOP,
+
+ /**
+ * @brief Observe load average of the system.
+ */
+ LOAD_AVG,
} config_scope_e;
/**
} config_options_e;
/**
- * @brief Config structure.
- * @remarks
- * If scope is set to system field config_data is ignored.
- * If scope is set to apps or cores, config_data must contains list of apps or core numbers accordingly.
+ * @brief Config app data structure.
*/
-typedef struct config
+typedef struct config_data_app
{
/**
- * @brief Config scope.
+ * @brief Config options.
*/
- config_scope_e scope;
+ config_options_e options;
+
+ /**
+ * @brief String containing regular expression with app id.
+ */
+ char app_id[APP_ID_REGEX_MAX_LEN+1];
+} config_data_app_t;
+/**
+ * @brief Config top data structure.
+ */
+typedef struct config_data_top
+{
/**
- * @brief Null-terminated array of strings with config data.
- * @remarks It can contain list of applications or cores number.
+ * @brief Config options.
*/
- char **config_data;
+ config_options_e options;
/**
- * @brief Size of config_data array.
+ * @brief Length of top.
*/
- size_t config_data_size;
+ long top;
+} config_data_top_t;
+/**
+ * @brief Config system data structure.
+ */
+typedef struct config_data_system
+{
/**
* @brief Config options.
*/
config_options_e options;
+} config_data_system_t;
+
+/**
+ * @brief Config structure.
+ * @remarks
+ * If scope is set to system field config_data is ignored.
+ * If scope is set to apps or cores, config_data must contains list of apps or core numbers accordingly.
+ */
+typedef struct config
+{
+ /**
+ * @brief Config scope.
+ */
+ config_scope_e scope;
/**
* @brief Task frequency in seconds.
*/
- int frequency;
+ long frequency;
+
+ /**
+ * Config data.
+ */
+ union _data
+ {
+ config_data_app_t apps;
+ config_data_top_t top;
+ config_data_system_t system;
+ } data;
} config_t;
#endif
\ No newline at end of file