Split retrieving core stats and config info into two functions.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
@@ -16,6 +16,32 @@
|
||||
#include "ocf_io.h"
|
||||
#include "ocf_mngt.h"
|
||||
|
||||
struct ocf_core_info {
|
||||
/** Core size in cache line size unit */
|
||||
uint64_t core_size;
|
||||
|
||||
/** Core size in bytes unit */
|
||||
uint64_t core_size_bytes;
|
||||
|
||||
/** Fields refers ongoing flush operation */
|
||||
struct {
|
||||
/** Number of blocks flushed in ongoing flush operation */
|
||||
uint32_t flushed;
|
||||
|
||||
/** Number of blocks left to flush in ongoing flush operation */
|
||||
uint32_t dirty;
|
||||
};
|
||||
|
||||
/** How long core is dirty in seconds unit */
|
||||
uint32_t dirty_for;
|
||||
|
||||
/** Sequential cutoff threshold (in bytes) */
|
||||
uint32_t seq_cutoff_threshold;
|
||||
|
||||
/** Sequential cutoff policy */
|
||||
ocf_seq_cutoff_policy seq_cutoff_policy;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Get OCF core by name
|
||||
*
|
||||
@@ -202,4 +228,15 @@ typedef int (*ocf_core_visitor_t)(ocf_core_t core, void *cntx);
|
||||
int ocf_core_visit(ocf_cache_t cache, ocf_core_visitor_t visitor, void *cntx,
|
||||
bool only_opened);
|
||||
|
||||
/**
|
||||
* @brief Get info of given core object
|
||||
*
|
||||
* @param[in] core Core object
|
||||
* @param[out] info Core info structure
|
||||
*
|
||||
* @retval 0 Success
|
||||
* @retval Non-zero Fail
|
||||
*/
|
||||
int ocf_core_get_info(ocf_core_t core, struct ocf_core_info *info);
|
||||
|
||||
#endif /* __OCF_CORE_H__ */
|
||||
|
||||
@@ -111,24 +111,12 @@ struct ocf_stats_core_debug {
|
||||
* @brief OCF core statistics
|
||||
*/
|
||||
struct ocf_stats_core {
|
||||
/** Core size in cache line size unit */
|
||||
uint64_t core_size;
|
||||
|
||||
/** Core size in bytes unit */
|
||||
uint64_t core_size_bytes;
|
||||
|
||||
/** Number of cache lines allocated in the cache for this core */
|
||||
uint32_t cache_occupancy;
|
||||
|
||||
/** Number of dirty cache lines allocated in the cache for this core */
|
||||
uint32_t dirty;
|
||||
|
||||
/** Number of block flushed in ongoing flush operation */
|
||||
uint32_t flushed;
|
||||
|
||||
/** How long core is dirty in seconds unit */
|
||||
uint32_t dirty_for;
|
||||
|
||||
/** Read requests statistics */
|
||||
struct ocf_stats_req read_reqs;
|
||||
|
||||
@@ -152,12 +140,6 @@ struct ocf_stats_core {
|
||||
|
||||
/** Debug statistics */
|
||||
struct ocf_stats_core_debug debug_stat;
|
||||
|
||||
/** Sequential cutoff threshold (in bytes) */
|
||||
uint32_t seq_cutoff_threshold;
|
||||
|
||||
/** Sequential cutoff policy */
|
||||
ocf_seq_cutoff_policy seq_cutoff_policy;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user