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
19651965 #define KVM_STATS_TYPE_CUMULATIVE (0x0 << KVM_STATS_TYPE_SHIFT)
19661966 #define KVM_STATS_TYPE_INSTANT (0x1 << KVM_STATS_TYPE_SHIFT)
19671967 #define KVM_STATS_TYPE_PEAK (0x2 << KVM_STATS_TYPE_SHIFT)
1968−#define KVM_STATS_TYPE_MAX KVM_STATS_TYPE_PEAK
1968+#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
19691971
19701972 #define KVM_STATS_UNIT_SHIFT 4
19711973 #define KVM_STATS_UNIT_MASK (0xF << KVM_STATS_UNIT_SHIFT)
@@ -1988,8 +1990,9 @@ struct kvm_stats_header { · 16 unmodified lines
19881990 * @size: The number of data items for this stats.
19891991 * Every data item is of type __u64.
19901992 * @offset: The offset of the stats to the start of stat structure in
1991− * struture kvm or kvm_vcpu.
1992− * @unused: Unused field for future usage. Always 0 for now.
1993+ * structure kvm or kvm_vcpu.
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;
19931996 * @name: The name string for the stats. Its size is indicated by the
19941997 * &kvm_stats_header->name_size.
19951998 */
@@ -1998,7 +2001,7 @@ struct kvm_stats_desc { · 2 unmodified lines
19982001 __s16 exponent;
19992002 __u16 size;
20002003 __u32 offset;
2001− __u32 unused;
2004+ __u32 bucket_size;
20022005 char name[];
20032006 };
20042007