On Wed, Nov 18, 2009 at 04:14:31PM +0000, Darren J Moffat wrote:
> Garrett D'Amore wrote:
> >>All the other non filename fields in the pfiles(1) output
> >>are on a different line to the filename.  So I'd highly recommend
> >>that offset go on the same line as mode: or on its own line.
> >>If that is done then an offset of 0 should be printed for
> >>things that are seekable.
> >
> >If you put it on the same line as the mode:, then you wind up
> >having to line wrap.  This makes the content less usable for
> >*human* consumers.
>
> But putting offset: on the filename line will make that wrap quicker
> too, especially for pfiles run on an editor running against an deep
> file tree eg:
>
>   5: S_IFREG mode:0644 dev:182,65547 ino:377482 uid:101 gid:10 size:16384
>       O_RDWR|O_CREAT|O_EXCL
>       /builds/onnv-bugfixes/usr/src/cmd/cmd-crypto/elfsign/.elfsign.c.swp
>
> Thats a vim process editing a file not that deep in ON.
>
> >It seems like folks writing *software* should probably not be
> >consuming pfiles output, but possibly using procfs directly.
>
> Indeed but that should imply we deliberately make the output worse
> than it is just now, so putting offset on a new line by its own would
> be my preference.
>

i realize that psarc isn't a democratic form, but regardless i'll put in
a vote for not having "offset:" on the same line as the filename.  i do
have a couple scripts that do:

        pfiles ... | grep " /" | ...

and i guess i could update them todo:

        pfiles ... | grep " /" | sed 's/ offset:[0-9][0-9]*$//'

but that seems like a pain.  ;)  i'd actually be ok with putting the
offset before or after the fd flags.  (where it wouldn't add an extra
line of output.)

ed

Reply via email to