ocf/src/ocf_stats_priv.h
Robert Baldyga a8e1ce8cc5 Initial commit
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2018-11-29 15:14:21 +01:00

62 lines
1.2 KiB
C

/*
* Copyright(c) 2012-2018 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#ifndef __OCF_STATS_PRIV_H__
#define __OCF_STATS_PRIV_H__
struct ocf_counters_block {
env_atomic64 read_bytes;
env_atomic64 write_bytes;
};
struct ocf_counters_error {
env_atomic read;
env_atomic write;
};
struct ocf_counters_req {
env_atomic64 partial_miss;
env_atomic64 full_miss;
env_atomic64 total;
env_atomic64 pass_through;
};
/**
* statistics appropriate for given io class.
*/
struct ocf_counters_part {
struct ocf_counters_req read_reqs;
struct ocf_counters_req write_reqs;
struct ocf_counters_block blocks;
};
#ifdef OCF_DEBUG_STATS
struct ocf_counters_debug {
env_atomic64 write_size[IO_PACKET_NO];
env_atomic64 read_size[IO_PACKET_NO];
env_atomic64 read_align[IO_ALIGN_NO];
env_atomic64 write_align[IO_ALIGN_NO];
};
#endif
struct ocf_counters_core {
struct ocf_counters_block core_blocks;
struct ocf_counters_block cache_blocks;
struct ocf_counters_error core_errors;
struct ocf_counters_error cache_errors;
struct ocf_counters_part part_counters[OCF_IO_CLASS_MAX];
#ifdef OCF_DEBUG_STATS
struct ocf_counters_debug debug_stats;
#endif
};
void ocf_stats_init(ocf_core_t core);
#endif