Skip to contentSkip to conversation

tools/vm/page_owner: filter out pid and timestamp

PATCH New Muchun Song 1 participant 1 message Feb 15, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/vm/page_owner: filter out pid and timestamp

Commit 9cc7e96aa846 ("mm/page_owner: record timestamp and pid") introduces timestamp and pid for page owner. However, it is hard to aggregate the stack since those are specific (especially timestamp). Filter out those information when aggregating.

---
 tools/vm/page_owner_sort.c | 6 ++++++
 1 file changed, 6 insertions(+)
tools/vm/page_owner_sort.c +6 -0
index 9ebb84a9c731..fc231749e0a9 100644
@@ -45,6 +45,12 @@ int read_block(char *buf, int buf_size, FILE *fin)
 			return curr - buf;
 		if (!strncmp(curr, "PFN", 3))
 			continue;
+		if (!strncmp(curr, "Page allocated via order", 24)) {
+			char *end = strstr(curr, ", pid ");
+
+			if (end)
+				memcpy(end, "\n", 2);
+		}
 		curr += strlen(curr);
 	}
 
Signature · 1 line
2.11.0