Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2013 21:58:02 +0200
From:      Mikolaj Golub <trociny@FreeBSD.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Stanislav Sedov <stas@freebsd.org>, Kostik Belousov <kib@freebsd.org>, "Robert N. M. Watson" <rwatson@freebsd.org>, Attilio Rao <attilio@freebsd.org>, freebsd-hackers@freebsd.org
Subject:   Re: libprocstat(3): retrieve process command line args and environment
Message-ID:  <20130220195801.GA8679@gmail.com>
In-Reply-To: <201302200904.15324.jhb@freebsd.org>
References:  <20130119151253.GB88025@gmail.com> <201301251531.43540.jhb@freebsd.org> <20130212215054.GA9839@gmail.com> <201302200904.15324.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 20, 2013 at 09:04:14AM -0500, John Baldwin wrote:

> The process should be stopped by the time we dump a core, so running it
> multiple times should be ok in that the sizes should not change.  I would
> say that you should try to implement a "determine sizes" pass that doesn't
> allocate anything, but others should comment on that.

I had a little talk with kib about this recently. Kib's main concern
looked to be that a process with many threads/open files might require
considerable amount of kernel memory if the procstat notes are
prepared in memory before writing. So currently I am working on
another approach, when on the first pass the sizes are found, and on
the second pass procstat notes are written to coredump without
preliminarily storing all notes in memory buffer. Hope, the code won't
look very ugly...

> One other thing to consider is if gcore needs to be updated to output these
> records as well.  It could use the sysctls to fetch the data and then write
> out appropriate notes I think, so perhaps it wouldn't be too difficult to add
> this as a followup commit once the kernel version has settled and the file
> format is set?

Looks like very interesting idea!

Thank you for all your comments and suggestions.

-- 
Mikolaj Golub



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130220195801.GA8679>