On 12/03/21 23:27, Jing Zhang wrote:
4 bytes flags (always zero)
Could you give some potential use for this flag?
No idea, honestly. It probably would signal the presence of more fields
after "offset of the first stat value". In general it's better to leave
some room for extension.
4 bytes number of statistics
4 bytes offset of the first stat description
4 bytes offset of the first stat value
stat descriptions:
- 4 bytes for the type (for now always zero: uint64_t)
Potential use for this type? Should we move this outside descriptor? Since
all stats probably have the same size.
Yes, all stats should be 8 bytes. But for example:
- 0 = uint64_t
- 1 = int64_t
- 0x80000000 | n: enum with n different values, which are stored after
the name
- 4 bytes for the flags (for now always zero)
Potential use for this flag?
Looking back at Emanuele's statsfs, it could be:
- bit 0: can be cleared (by writing eight zero bytes in the statistics'
offset)
- bit 1: cumulative value (count of events, can only grow) vs.
instantaneous value (can go up or down)
This is currently stored in the debugfs mode, so we can already use
these flags.
Paolo