Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Documentation: kvm: clarify histogram units

In the case of histogram statistics, the values are always sample
counts; the unit instead applies to the bucket range. For example,
halt_poll_success_hist is a nanosecond statistic because the buckets are
for 0ns, 1ns, 2-3ns, 4-7ns etc. There isn't really any other sensible
interpretation, but clarify this anyway in the Documentation.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

+7 -4
+7 -4
Documentation/virt/kvm/api.rst
··· 5703 5703 by the ``hist_param`` field. The range of the Nth bucket (1 <= N < ``size``) 5704 5704 is [``hist_param``*(N-1), ``hist_param``*N), while the range of the last 5705 5705 bucket is [``hist_param``*(``size``-1), +INF). (+INF means positive infinity 5706 - value.) The bucket value indicates how many samples fell in the bucket's range. 5706 + value.) 5707 5707 * ``KVM_STATS_TYPE_LOG_HIST`` 5708 5708 The statistic is reported as a logarithmic histogram. The number of 5709 5709 buckets is specified by the ``size`` field. The range of the first bucket is 5710 5710 [0, 1), while the range of the last bucket is [pow(2, ``size``-2), +INF). 5711 5711 Otherwise, The Nth bucket (1 < N < ``size``) covers 5712 - [pow(2, N-2), pow(2, N-1)). The bucket value indicates how many samples fell 5713 - in the bucket's range. 5712 + [pow(2, N-2), pow(2, N-1)). 5714 5713 5715 5714 Bits 4-7 of ``flags`` encode the unit: 5716 5715 ··· 5729 5730 statistics of "peak" type will never go back from 1 to 0. Boolean 5730 5731 statistics can be linear histograms (with two buckets) but not logarithmic 5731 5732 histograms. 5733 + 5734 + Note that, in the case of histograms, the unit applies to the bucket 5735 + ranges, while the bucket value indicates how many samples fell in the 5736 + bucket's range. 5732 5737 5733 5738 Bits 8-11 of ``flags``, together with ``exponent``, encode the scale of the 5734 5739 unit: ··· 5755 5752 5756 5753 The ``bucket_size`` field is used as a parameter for histogram statistics data. 5757 5754 It is only used by linear histogram statistics data, specifying the size of a 5758 - bucket. 5755 + bucket in the unit expressed by bits 4-11 of ``flags`` together with ``exponent``. 5759 5756 5760 5757 The ``name`` field is the name string of the statistics data. The name string 5761 5758 starts at the end of ``struct kvm_stats_desc``. The maximum length including