问题:内核统计计数器的最大值是多少,如何在 python 代码中处理它?
上下文:我根据内核统计数据计算了一些统计数据(例如 /proc/partitions - 它将是定制的 python iostat 版本)。但我有溢出值的问题 - 负值。iostat 原代码https://github.com/sysstat/sysstat/blob/master/iostat.c评论:
* Counters overflows are possible, but don't need to be handled in
* a special way: The difference is still properly calculated if the
* result is of the same type as the two values.
我的语言是 python,在我的情况下我需要关心溢出。可能它也取决于架构(32/64)。我试过 2^64-1(64 位系统),但没有成功。