@@ -993,7 +993,8 @@ static void json_print_PRG(char *hp, struct sstat *ss, struct tstat *ps, int nac
993
993
"\"egid\": %d, "
994
994
"\"elaps\": \"%ld\", "
995
995
"\"isproc\": %d, "
996
- "\"cid\": \"%.19s\"}" ,
996
+ "\"cid\": \"%.19s\", "
997
+ "\"cgroup\": \"%s\"}" ,
997
998
ps -> gen .pid ,
998
999
ps -> gen .name ,
999
1000
ps -> gen .state ,
@@ -1014,7 +1015,8 @@ static void json_print_PRG(char *hp, struct sstat *ss, struct tstat *ps, int nac
1014
1015
ps -> gen .egid ,
1015
1016
ps -> gen .elaps ,
1016
1017
!!ps -> gen .isproc , /* convert to boolean */
1017
- ps -> gen .utsname [0 ] ? ps -> gen .utsname :"-" );
1018
+ ps -> gen .utsname [0 ] ? ps -> gen .utsname :"-" ,
1019
+ ps -> gen .cgpath [0 ] ? ps -> gen .cgpath :"-" );
1018
1020
}
1019
1021
1020
1022
printf ("]" );
@@ -1044,7 +1046,8 @@ static void json_print_PRC(char *hp, struct sstat *ss, struct tstat *ps, int nac
1044
1046
"\"blkdelay\": %lld, "
1045
1047
"\"nvcsw\": %llu, "
1046
1048
"\"nivcsw\": %llu, "
1047
- "\"sleepavg\": %d}" ,
1049
+ "\"sleepavg\": %d, "
1050
+ "\"cgroup\": \"%s\"}" ,
1048
1051
ps -> gen .pid ,
1049
1052
ps -> cpu .utime ,
1050
1053
ps -> cpu .stime ,
@@ -1057,7 +1060,8 @@ static void json_print_PRC(char *hp, struct sstat *ss, struct tstat *ps, int nac
1057
1060
ps -> cpu .blkdelay * 1000 /hertz ,
1058
1061
ps -> cpu .nvcsw ,
1059
1062
ps -> cpu .nivcsw ,
1060
- ps -> cpu .sleepavg );
1063
+ ps -> cpu .sleepavg ,
1064
+ ps -> gen .cgpath [0 ] ? ps -> gen .cgpath :"-" );
1061
1065
}
1062
1066
1063
1067
printf ("]" );
@@ -1088,7 +1092,8 @@ static void json_print_PRM(char *hp, struct sstat *ss, struct tstat *ps, int nac
1088
1092
"\"vstack\": %lld, "
1089
1093
"\"vlock\": %lld, "
1090
1094
"\"vswap\": %lld, "
1091
- "\"pmem\": %lld}" ,
1095
+ "\"pmem\": %lld, "
1096
+ "\"cgroup\": \"%s\"}" ,
1092
1097
ps -> gen .pid ,
1093
1098
ps -> mem .vmem ,
1094
1099
ps -> mem .rmem ,
@@ -1103,7 +1108,8 @@ static void json_print_PRM(char *hp, struct sstat *ss, struct tstat *ps, int nac
1103
1108
ps -> mem .vlock ,
1104
1109
ps -> mem .vswap ,
1105
1110
ps -> mem .pmem == (unsigned long long )-1LL ?
1106
- 0 :ps -> mem .pmem );
1111
+ 0 :ps -> mem .pmem ,
1112
+ ps -> gen .cgpath [0 ] ? ps -> gen .cgpath :"-" );
1107
1113
}
1108
1114
1109
1115
printf ("]" );
0 commit comments