History

KVM: stats: Support linear and logarithmic histogram statistics

Add new types of KVM stats, linear and logarithmic histogram. Histogram are very useful for observing the value distribution of time or size related stats.

Jing Zhang committed 5 years ago

Commit f95937c1 parent 73143038 files · +82 −43Browse files

Showing the changes to include/uapi (1 of 8 files). Show all

Unified · Split

include/uapi/linux/kvm.h+7−4
@@ -1965,7 +1965,9 @@ struct kvm_stats_header { · 1964 unmodified lines
1965#define KVM_STATS_TYPE_CUMULATIVE (0x0 << KVM_STATS_TYPE_SHIFT)1965#define KVM_STATS_TYPE_CUMULATIVE (0x0 << KVM_STATS_TYPE_SHIFT)
1966#define KVM_STATS_TYPE_INSTANT (0x1 << KVM_STATS_TYPE_SHIFT)1966#define KVM_STATS_TYPE_INSTANT (0x1 << KVM_STATS_TYPE_SHIFT)
1967#define KVM_STATS_TYPE_PEAK (0x2 << KVM_STATS_TYPE_SHIFT)1967#define KVM_STATS_TYPE_PEAK (0x2 << KVM_STATS_TYPE_SHIFT)
1968#define KVM_STATS_TYPE_MAX KVM_STATS_TYPE_PEAK1968#define KVM_STATS_TYPE_LINEAR_HIST (0x3 << KVM_STATS_TYPE_SHIFT)
1969#define KVM_STATS_TYPE_LOG_HIST (0x4 << KVM_STATS_TYPE_SHIFT)
1970#define KVM_STATS_TYPE_MAX KVM_STATS_TYPE_LOG_HIST
1969 1971
1970#define KVM_STATS_UNIT_SHIFT 41972#define KVM_STATS_UNIT_SHIFT 4
1971#define KVM_STATS_UNIT_MASK (0xF << KVM_STATS_UNIT_SHIFT)1973#define KVM_STATS_UNIT_MASK (0xF << KVM_STATS_UNIT_SHIFT)
@@ -1988,8 +1990,9 @@ struct kvm_stats_header { · 16 unmodified lines
1988 * @size: The number of data items for this stats.1990 * @size: The number of data items for this stats.
1989 * Every data item is of type __u64.1991 * Every data item is of type __u64.
1990 * @offset: The offset of the stats to the start of stat structure in1992 * @offset: The offset of the stats to the start of stat structure in
1991 * struture kvm or kvm_vcpu.1993 * structure kvm or kvm_vcpu.
1992 * @unused: Unused field for future usage. Always 0 for now.1994 * @bucket_size: A parameter value used for histogram stats. It is only used
1995 * for linear histogram stats, specifying the size of the bucket;
1993 * @name: The name string for the stats. Its size is indicated by the1996 * @name: The name string for the stats. Its size is indicated by the
1994 * &kvm_stats_header->name_size.1997 * &kvm_stats_header->name_size.
1995 */1998 */
@@ -1998,7 +2001,7 @@ struct kvm_stats_desc { · 2 unmodified lines
1998 __s16 exponent;2001 __s16 exponent;
1999 __u16 size;2002 __u16 size;
2000 __u32 offset;2003 __u32 offset;
2001 __u32 unused;2004 __u32 bucket_size;
2002 char name[];2005 char name[];
2003};2006};
2004 2007