Skip to content

Commit

Permalink
numastat: Better diagnostic when find unknown string in meminfo
Browse files Browse the repository at this point in the history
From time to time the kernel adds new statistics to the meminfo
file. These currently result in messages like this:

	Token Node not in hash table.

it would be more helpful to print the actual token that was found,
rather than the word "Node".  E.g.

	Token KReclaimable not in hash table.
  • Loading branch information
aegl authored and andikleen committed Jan 27, 2019
1 parent 0b26cbc commit ec4fa9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numastat.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ void show_info_from_system_file(char *file, meminfo_p meminfo, int meminfo_rows,
// example line from meminfo file: "Node 3 Inactive: 210680 kB"
int index = hash_lookup(tok[0 + tok_offset]);
if (index < 0) {
printf("Token %s not in hash table.\n", tok[0]);
printf("Token %s not in hash table.\n", tok[0 + tok_offset]);
} else {
double value = (double)atol(tok[1 + tok_offset]);
if (!compatibility_mode) {
Expand Down

0 comments on commit ec4fa9f

Please sign in to comment.