Lines Matching +full:local +full:- +full:pid
1 // SPDX-License-Identifier: GPL-2.0
10 * The TGID together with the PID and the AGROUP flag allow
11 * identification of threads in a process and single-threaded processes.
12 * The ac_tgetime field gives proper whole-process walltime.
18 * Utility to get per-pid and per-tgid delay accounting statistics
50 #define GENLMSG_PAYLOAD(glh) (NLMSG_PAYLOAD(glh, 0) - GENL_HDRLEN)
52 #define NLA_PAYLOAD(len) (len - NLA_HDRLEN)
88 fprintf(stderr, "procacct [-v] [-w logfile] [-r bufsize] [-m cpumask]\n"); in usage()
89 fprintf(stderr, " -v: debug on\n"); in usage()
98 struct sockaddr_nl local; in create_nl_socket() local
102 return -1; in create_nl_socket()
112 memset(&local, 0, sizeof(local)); in create_nl_socket()
113 local.nl_family = AF_NETLINK; in create_nl_socket()
115 if (bind(fd, (struct sockaddr *) &local, sizeof(local)) < 0) in create_nl_socket()
121 return -1; in create_nl_socket()
144 na->nla_type = nla_type; in send_cmd()
145 na->nla_len = nla_len + 1 + NLA_HDRLEN; in send_cmd()
147 msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len); in send_cmd()
157 buflen -= r; in send_cmd()
159 return -1; in send_cmd()
194 na = (struct nlattr *) ((char *) na + NLA_ALIGN(na->nla_len)); in get_family_id()
195 if (na->nla_type == CTRL_ATTR_FAMILY_ID) in get_family_id()
207 …"%c pid=%lu tgid=%lu uid=%lu wall=%llu gwall=%llu cpu=%llu vmpeak=%llu rsspeak=%llu dev=%lu:%lu in… in print_procacct()
208 , t->version >= 12 ? (t->ac_flag & AGROUP ? 'P' : 'T') : '?' in print_procacct()
209 , (unsigned long)t->ac_pid in print_procacct()
210 , (unsigned long)(t->version >= 12 ? t->ac_tgid : 0) in print_procacct()
211 , (unsigned long)t->ac_uid in print_procacct()
212 , (unsigned long long)t->ac_etime in print_procacct()
213 , (unsigned long long)(t->version >= 12 ? t->ac_tgetime : 0) in print_procacct()
214 , (unsigned long long)(t->ac_utime+t->ac_stime) in print_procacct()
215 , (unsigned long long)t->hiwater_vm in print_procacct()
216 , (unsigned long long)t->hiwater_rss in print_procacct()
217 , (unsigned long)(t->version >= 12 ? MAJOR(t->ac_exe_dev) : 0) in print_procacct()
218 , (unsigned long)(t->version >= 12 ? MINOR(t->ac_exe_dev) : 0) in print_procacct()
219 , (unsigned long long)(t->version >= 12 ? t->ac_exe_inode : 0) in print_procacct()
220 , t->ac_comm in print_procacct()
226 int aggr_len = NLA_PAYLOAD(na->nla_len); in handle_aggr()
232 switch (na->nla_type) { in handle_aggr()
235 PRINTF("PID\t%d\n", rtid); in handle_aggr()
245 if (write(fd, NLA_DATA(na), na->nla_len) < 0) in handle_aggr()
253 na->nla_type); in handle_aggr()
256 len2 += NLA_ALIGN(na->nla_len); in handle_aggr()
258 NLA_ALIGN(na->nla_len)); in handle_aggr()
270 int nl_sd = -1; in main()
305 cpumask[sizeof(cpumask) - 1] = '\0'; in main()
314 exit(-1); in main()
320 cpumask[sizeof(cpumask) - 1] = '\0'; in main()
326 if (fd == -1) { in main()
369 err->error); in main()
382 len += NLA_ALIGN(na->nla_len); in main()
383 int mother = na->nla_type; in main()
386 switch (na->nla_type) { in main()
394 na->nla_type); in main()