Unify inactive cores stats.
Inactive core stats should be caluculated and returned to adapter in unified from, just like all stats are. Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
494a1ccc79
commit
f226f978f0
@ -16,6 +16,7 @@
|
||||
#include "ocf_volume.h"
|
||||
#include "ocf_ctx.h"
|
||||
#include "ocf_def.h"
|
||||
#include "ocf_stats.h"
|
||||
|
||||
/**
|
||||
* @brief Cache info: configuration, status
|
||||
@ -32,10 +33,13 @@ struct ocf_cache_info {
|
||||
|
||||
/* Statistics of inactive cores */
|
||||
struct {
|
||||
uint32_t occupancy;
|
||||
struct ocf_stat occupancy;
|
||||
/*!< Cache occupancy (in cache lines) */
|
||||
|
||||
uint32_t dirty;
|
||||
struct ocf_stat clean;
|
||||
/*!< Clean blocks within cache (in cache lines) */
|
||||
|
||||
struct ocf_stat dirty;
|
||||
/*!< Dirty blocks within cache (in cache lines) */
|
||||
} inactive;
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "utils/utils_part.h"
|
||||
#include "ocf_priv.h"
|
||||
#include "ocf_cache_priv.h"
|
||||
#include "utils/utils_stats.h"
|
||||
|
||||
ocf_volume_t ocf_cache_get_volume(ocf_cache_t cache)
|
||||
{
|
||||
@ -84,6 +85,8 @@ int ocf_cache_get_info(ocf_cache_t cache, struct ocf_cache_info *info)
|
||||
|
||||
ENV_BUG_ON(env_memset(info, sizeof(*info), 0));
|
||||
|
||||
_ocf_stats_zero(&info->inactive);
|
||||
|
||||
info->attached = ocf_cache_is_device_attached(cache);
|
||||
if (info->attached) {
|
||||
info->volume_type = ocf_ctx_get_volume_type_id(cache->owner,
|
||||
@ -145,8 +148,20 @@ int ocf_cache_get_info(ocf_cache_t cache, struct ocf_cache_info *info)
|
||||
cache->device->metadata_offset / PAGE_SIZE : 0;
|
||||
|
||||
info->state = cache->cache_state;
|
||||
info->inactive.occupancy = cache_occupancy_inactive;
|
||||
info->inactive.dirty = dirty_blocks_inactive;
|
||||
|
||||
if (info->attached) {
|
||||
_set(&info->inactive.occupancy,
|
||||
_lines4k(cache_occupancy_inactive, ocf_line_size(cache)),
|
||||
_lines4k(info->size, ocf_line_size(cache)));
|
||||
_set(&info->inactive.clean,
|
||||
_lines4k(cache_occupancy_inactive - dirty_blocks_inactive,
|
||||
ocf_line_size(cache)),
|
||||
_lines4k(cache_occupancy_total, ocf_line_size(cache)));
|
||||
_set(&info->inactive.dirty,
|
||||
_lines4k(dirty_blocks_inactive, ocf_line_size(cache)),
|
||||
_lines4k(cache_occupancy_total, ocf_line_size(cache)));
|
||||
}
|
||||
|
||||
info->flushed = (env_atomic_read(&cache->flush_in_progress)) ?
|
||||
flushed_total : 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user