Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jan 2013 18:37:45 +0000
From:      "Robert N. M. Watson" <rwatson@freebsd.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Mikolaj Golub <trociny@freebsd.org>, Stanislav Sedov <stas@freebsd.org>, freebsd-hackers@freebsd.org
Subject:   Re: libprocstat(3): retrieve process command line args and environment
Message-ID:  <CA642C26-98E1-40CC-A415-8C53F47E2281@freebsd.org>
In-Reply-To: <201301241120.52054.jhb@freebsd.org>
References:  <20130119151253.GB88025@gmail.com> <201301231131.43972.jhb@freebsd.org> <20130123214949.GA3120@gmail.com> <201301241120.52054.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 24 Jan 2013, at 16:20, John Baldwin wrote:

>>> Hmm, are you going to rewrite ps(1) to use libprocstat?  Or rather, =
is that a
>>> goal someday?  That is one current consumer of kvm_getargv/envv.  =
That might
>>> be fine if we want to make more tools use libprocstat instead of =
using libkvm
>>> directly.
>>=20
>> I didn't have any plans for ps(1) :-) That is why I wrote about "new
>> code". But if you think it is good to do I might look at it one =
day...
>=20
> I'm mostly hoping Robert chimes in to see if that was his intention =
for
> libprocstat. :)  If we can ultimately replace all uses of kvm_get*v() =
with
> calls to procstat_get*v*() then I'm fine with some code duplication in =
the
> interim.


Originally there was just proctstat(1), but it made sense to begin =
re-encapsulating it in a libprocstat(3) because the code there is =
potentially extremely reusable. This conflicts a bit with libkvm(3), =
which mysteriously knows about sysctlbyname(3) despite a name suggesting =
otherwise. You can imagine various approaches to fixing this, but =
indeed, making libprocstat(3) the first-class citizen and preferring it =
for both kvm and sysctl methods sounds like the way to go. I actually =
want to make libprocstat also support snmp, but I've never actually =
found the time to investigate doing that. One of my main unmet goals for =
procstat(1) was to introduce an extremely machine-readable output format =
for it -- e.g., something XML-based or similar. I'd still love to see =
that happen.

Robert=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA642C26-98E1-40CC-A415-8C53F47E2281>