Current code uses array index to store the numa number, which may sort the numanr to a wrong value after the qsort() funtion in generic_samp().
Fix this by re-adding the 'numanr' member for struct mempernuma and cpupernuma to store the correct numa number. The permanent 'numanr' member can guarantee the numa number from adjusting after qsort(), while the qsort() function can continue working by sorting NUM from small to large according to free memory, and sorting NUC from small to large according to idle cpu.
Current code uses array index to store the numa number, which may sort the numanr to a wrong value after the qsort() funtion in generic_samp().
Fix this by re-adding the 'numanr' member for struct mempernuma and cpupernuma to store the correct numa number. The permanent 'numanr' member can guarantee the numa number from adjusting after qsort(), while the qsort() function can continue working by sorting NUM from small to large according to free memory, and sorting NUC from small to large according to idle cpu.
Besides, add NUC for JSON output.
Fixes: 1fbda3f1081a ("Additions to NUMA counters") Reported-by: Qi Zheng zhengqi.arch@bytedance.com Signed-off-by: Fei Li lifei.shirley@bytedance.com