This makes the "ps -g xxx" give us more information.
It is very useful when the "xxx" has many threads,
and the threads are in different NUMA nodes.
Signed-off-by: Huang Shijie <huangsj(a)hygon.cn>
---
task.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/task.c b/task.c
index d7f3c12..8d95bf4 100644
--- a/task.c
+++ b/task.c
@@ -6102,8 +6102,9 @@ task_mm(ulong task, int fill)
char *
task_cpu(int processor, char *buf, int verbose)
{
+ int nid = cpu_to_nid(processor);
if (processor < NR_CPUS)
- sprintf(buf, "%d", processor);
+ sprintf(buf, "%4d/%d", processor, nid);
else
sprintf(buf, verbose ? "(unknown)" : "?");
--
2.53.0