aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/procstat/procstat_bin.c
diff options
context:
space:
mode:
authorAllan Jude <allanjude@FreeBSD.org>2015-09-05 17:02:01 +0000
committerAllan Jude <allanjude@FreeBSD.org>2015-09-05 17:02:01 +0000
commit474b62b876718890adf24759cc7c15fa5cb7778e (patch)
tree4806bed030076ad0f4a32b484130a17d3ddf5b58 /usr.bin/procstat/procstat_bin.c
parent4569e7cfe25b562e09629471fc645262bc726f8c (diff)
downloadsrc-474b62b876718890adf24759cc7c15fa5cb7778e.tar.gz
src-474b62b876718890adf24759cc7c15fa5cb7778e.zip
Notes
Diffstat (limited to 'usr.bin/procstat/procstat_bin.c')
-rw-r--r--usr.bin/procstat/procstat_bin.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/procstat/procstat_bin.c b/usr.bin/procstat/procstat_bin.c
index dc88c38c5124..8b2b8a14be8b 100644
--- a/usr.bin/procstat/procstat_bin.c
+++ b/usr.bin/procstat/procstat_bin.c
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2007 Robert N. M. Watson
+ * Copyright (c) 2015 Allan Jude <allanjude@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +47,8 @@ procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp)
static char pathname[PATH_MAX];
if (!hflag)
- printf("%5s %-16s %8s %s\n", "PID", "COMM", "OSREL", "PATH");
+ xo_emit("{T:/%5s %-16s %8s %s}\n", "PID", "COMM", "OSREL",
+ "PATH");
if (procstat_getpathname(prstat, kipp, pathname, sizeof(pathname)) != 0)
return;
@@ -55,8 +57,8 @@ procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp)
if (procstat_getosrel(prstat, kipp, &osrel) != 0)
return;
- printf("%5d ", kipp->ki_pid);
- printf("%-16s ", kipp->ki_comm);
- printf("%8d ", osrel);
- printf("%s\n", pathname);
+ xo_emit("{k:process_id/%5d/%d} ", kipp->ki_pid);
+ xo_emit("{:command/%-16s/%s} ", kipp->ki_comm);
+ xo_emit("{:osrel/%8d/%d} ", osrel);
+ xo_emit("{:pathname/%s}\n", pathname);
}