Handle separate functons for retrieving core stats and info.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
1abb1e7c72
commit
39a3d04c93
@ -2683,11 +2683,11 @@ int list_caches(unsigned int list_format)
|
|||||||
curr_core = &curr_cache->cores[j];
|
curr_core = &curr_cache->cores[j];
|
||||||
core_path = curr_core->path;
|
core_path = curr_core->path;
|
||||||
|
|
||||||
core_flush_prog = calculate_flush_progress(curr_core->info.stats.dirty,
|
core_flush_prog = calculate_flush_progress(curr_core->info.info.dirty,
|
||||||
curr_core->info.stats.flushed);
|
curr_core->info.info.flushed);
|
||||||
|
|
||||||
if (!core_flush_prog && cache_flush_prog) {
|
if (!core_flush_prog && cache_flush_prog) {
|
||||||
core_flush_prog = curr_core->info.stats.dirty ? 0 : 100;
|
core_flush_prog = curr_core->info.info.dirty ? 0 : 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (core_flush_prog || cache_flush_prog) {
|
if (core_flush_prog || cache_flush_prog) {
|
||||||
|
@ -295,8 +295,8 @@ void get_core_flush_progress(int fd, int cache_id, int core_id, float *prog)
|
|||||||
cmd_info.core_id = core_id;
|
cmd_info.core_id = core_id;
|
||||||
|
|
||||||
if (0 == ioctl(fd, KCAS_IOCTL_CORE_INFO, &cmd_info)) {
|
if (0 == ioctl(fd, KCAS_IOCTL_CORE_INFO, &cmd_info)) {
|
||||||
*prog = calculate_flush_progress(cmd_info.stats.dirty,
|
*prog = calculate_flush_progress(cmd_info.info.dirty,
|
||||||
cmd_info.stats.flushed);
|
cmd_info.info.flushed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ static void print_core_conf(const struct kcas_core_info *info, FILE *outfile)
|
|||||||
uint64_t core_size;
|
uint64_t core_size;
|
||||||
float core_size_gb;
|
float core_size_gb;
|
||||||
|
|
||||||
core_size = info->stats.core_size_bytes / KiB / 4;
|
core_size = info->info.core_size_bytes / KiB / 4;
|
||||||
core_size_gb = calc_gb(core_size);
|
core_size_gb = calc_gb(core_size);
|
||||||
|
|
||||||
print_kv_pair(outfile, "Core Id", "%i", info->core_id);
|
print_kv_pair(outfile, "Core Id", "%i", info->core_id);
|
||||||
@ -199,16 +199,16 @@ static void print_core_conf(const struct kcas_core_info *info, FILE *outfile)
|
|||||||
info->cache_id, info->core_id);
|
info->cache_id, info->core_id);
|
||||||
print_kv_pair(outfile, "Core Size", "%lu, [4KiB Blocks], %.2f, [GiB]",
|
print_kv_pair(outfile, "Core Size", "%lu, [4KiB Blocks], %.2f, [GiB]",
|
||||||
core_size, core_size_gb);
|
core_size, core_size_gb);
|
||||||
print_kv_pair_time(outfile, "Dirty for", info->stats.dirty_for);
|
print_kv_pair_time(outfile, "Dirty for", info->info.dirty_for);
|
||||||
|
|
||||||
print_kv_pair(outfile, "Status", "%s",
|
print_kv_pair(outfile, "Status", "%s",
|
||||||
get_core_state_name(info->state));
|
get_core_state_name(info->state));
|
||||||
|
|
||||||
print_kv_pair(outfile, "Seq cutoff threshold", "%llu, [KiB]",
|
print_kv_pair(outfile, "Seq cutoff threshold", "%llu, [KiB]",
|
||||||
info->stats.seq_cutoff_threshold / KiB);
|
info->info.seq_cutoff_threshold / KiB);
|
||||||
|
|
||||||
print_kv_pair(outfile, "Seq cutoff policy", "%s",
|
print_kv_pair(outfile, "Seq cutoff policy", "%s",
|
||||||
seq_cutoff_policy_to_name(info->stats.seq_cutoff_policy));
|
seq_cutoff_policy_to_name(info->info.seq_cutoff_policy));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_usage_header(FILE* outfile)
|
static void print_usage_header(FILE* outfile)
|
||||||
|
@ -1909,7 +1909,7 @@ int cache_mngt_get_core_info(struct kcas_core_info *info)
|
|||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ocf_core_get_stats(core, &info->stats);
|
result = ocf_core_get_info(core, &info->info);
|
||||||
if (result)
|
if (result)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
|
|
||||||
|
@ -208,8 +208,7 @@ struct kcas_core_info {
|
|||||||
/** Core id */
|
/** Core id */
|
||||||
uint16_t core_id;
|
uint16_t core_id;
|
||||||
|
|
||||||
/** CAS statistics of core */
|
struct ocf_core_info info;
|
||||||
struct ocf_stats_core stats;
|
|
||||||
|
|
||||||
ocf_core_state_t state;
|
ocf_core_state_t state;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user