Bug 180970 - [request] No manpage for ps_strings
Summary: [request] No manpage for ps_strings
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Books & Articles (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Warren Block
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-31 14:40 UTC by Carlos J Puga Medina
Modified: 2014-08-08 22:32 UTC (History)
3 users (show)

See Also:


Attachments
ps_strings.3 (2.61 KB, text/troff)
2014-07-14 18:06 UTC, Carlos J Puga Medina
no flags Details
update comments in <sys/exec.h> (1.11 KB, patch)
2014-07-27 20:15 UTC, Jilles Tjoelker
no flags Details | Diff
update comments in <sys/exec.h> (1.24 KB, patch)
2014-08-06 20:26 UTC, Jilles Tjoelker
no flags Details | Diff
updated exec.h (1.60 KB, patch)
2014-08-08 14:09 UTC, Warren Block
no flags Details | Diff
update exec.h, second revision (1.59 KB, patch)
2014-08-08 22:21 UTC, Warren Block
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos J Puga Medina 2013-07-31 14:40:02 UTC
Currently there is not a section 5 manpage for the ps_strings structure. 
The ps_strings(5) from BSDi's man pages could be used as base.

Reference: http://forums.freebsd.org/showthread.php?t=40913.
Comment 1 Carlos J Puga Medina 2014-07-14 18:06:54 UTC
Created attachment 144666 [details]
ps_strings.3

Added initial ps_string.3
Comment 2 Jilles Tjoelker freebsd_committer freebsd_triage 2014-07-21 16:56:06 UTC
I think there are only very few or no applications that should be using
ps_strings. To alter ps(1) output, applications should call
setproctitle(3); in fact, writing to ps_strings will usually not work
because the kernel preferably returns a cached version of the arguments
which can be modified by setproctitle(3) (see sysctl
kern.ps_arg_cache_limit).

Current uses of ps_strings, mostly by debuggers, are to find the
auxiliary vector and the signal trampoline on older kernels that lack
the KERN_PROC_AUXV and KERN_PROC_SIGTRAMP sysctls.

Internal use of ps_strings, such as by setproctitle(3) and libprocstat,
need not be documented in a man page.

Therefore, I think a ps_strings(3) man page is inappropriate. The
comments in <sys/exec.h> say things similar to the proposed man page and
should be updated.
Comment 3 Carlos J Puga Medina 2014-07-21 21:12:15 UTC
For me rewrite from scratch the man page isn't a problem, but I need some guidance. I opened this PR because a user requested it and disappeared since them. Furthermore, Chris Torek didn't review it despite he should be interested in the documentation of ps_strings()

If you consider that it's best to close this PR instead wait other feedbacks, please just do it. Everything is in your hands :)
Comment 4 Warren Block freebsd_committer freebsd_triage 2014-07-25 16:56:08 UTC
Do the comments in sys/exec.h need to be revised?  If they are complete, I think we can close this issue.
Comment 5 Carlos J Puga Medina 2014-07-25 17:07:41 UTC
Definitely I agree that it's more appropriate or preferible modify sys/exec.h according to the current use of ps_strings.
Comment 6 Jilles Tjoelker freebsd_committer freebsd_triage 2014-07-27 20:15:40 UTC
Created attachment 145049 [details]
update comments in <sys/exec.h>

I was thinking of changing the comments like this.
Comment 7 Carlos J Puga Medina 2014-07-30 18:24:14 UTC
Do you think we can add something useful of the discussion [1] as a comment or point out to it?

I think it clarifies the matter, if Warren is agree, commit it and close this PR.

[1] https://lists.freebsd.org/pipermail/freebsd-hackers/2013-August/043279.html
Comment 8 Warren Block freebsd_committer freebsd_triage 2014-08-04 23:03:05 UTC
I'm a little reluctant to remove most of the existing notes.  How about adding the new line about preferring the other sysctls first, but leaving the existing comment after it?
Comment 9 Jilles Tjoelker freebsd_committer freebsd_triage 2014-08-06 20:26:28 UTC
Created attachment 145426 [details]
update comments in <sys/exec.h>

This patch retains more text from the original comment. I do think the text encouraging programs to write to ps_strings should go away.
Comment 10 Carlos J Puga Medina 2014-08-06 20:56:23 UTC
I think we could add the following comment (written by kib@):

"setproctitle() always informs the kernel with sysctl and sets the pointers in ps_strings. kern.proc.args sysctl first tries the p_args, and falls back to reading ps_strings and following the pointers if p_args is NULL."
Comment 11 Warren Block freebsd_committer freebsd_triage 2014-08-08 14:09:21 UTC
Created attachment 145522 [details]
updated exec.h
Comment 12 Carlos J Puga Medina 2014-08-08 19:56:13 UTC
(In reply to Warren Block from comment #11)
> Created attachment 145522 [details]
> updated exec.h

Warren,

I like your last review. As far as I'm concerned, this request can  be marked as resolved.

Thanks for work on this :)
Comment 13 Warren Block freebsd_committer freebsd_triage 2014-08-08 22:21:47 UTC
Created attachment 145540 [details]
update exec.h, second revision

Latest revision.
Comment 14 commit-hook freebsd_committer freebsd_triage 2014-08-08 22:31:25 UTC
A commit references this bug:

Author: wblock
Date: Fri Aug  8 22:30:42 UTC 2014
New revision: 269743
URL: http://svnweb.freebsd.org/changeset/base/269743

Log:
  Update the comments in exec.h with help from jilles.

  PR:		180970
  Submitted by:	Carlos Jacobo Puga Medina <cjpugmed@gmail.com>
  Reviewed by:	jilles
  MFC after:	1 week

Changes:
  head/sys/sys/exec.h
Comment 15 Warren Block freebsd_committer freebsd_triage 2014-08-08 22:32:31 UTC
Comments in exec.h updated instead of adding a man page.  Thanks!