Page MenuHomeFreeBSD

Add procstat(1) advlocks command
ClosedPublic

Authored by kib on Apr 7 2022, 7:53 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 7, 4:40 PM
Unknown Object (File)
Wed, Dec 4, 7:24 AM
Unknown Object (File)
Tue, Dec 3, 4:27 PM
Unknown Object (File)
Tue, Dec 3, 12:23 AM
Unknown Object (File)
Wed, Nov 20, 1:27 PM
Unknown Object (File)
Tue, Nov 19, 2:23 PM
Unknown Object (File)
Sep 24 2024, 8:57 AM
Unknown Object (File)
Sep 24 2024, 8:51 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Apr 7 2022, 7:53 PM
usr.bin/procstat/procstat.1
157 ↗(On Diff #104745)
162 ↗(On Diff #104745)

or "kinds"

usr.bin/procstat/procstat.h
47

Does this suggest that the functionality really belongs in fstat(1) (which also uses libprocstat) instead?

usr.bin/procstat/procstat_advlock.c
5 ↗(On Diff #104745)

I believe we omit "all rights reserved" now.

kib marked 3 inline comments as done.Apr 8 2022, 12:39 AM
kib added inline comments.
usr.bin/procstat/procstat.h
47

I am not sure. I remembered about fstat(8) when I started this, but quick man page look convinced me that fstat(8) is more single-purpose thing than procstat(1), and it also has filters like 'pid'. This would be completely different list mode for fstat output, because one file might have more than one lock acquired, either non-intersecting, or compatible.

So for me adding slightly non-idiomatic command to procstat(1) sound better then making fstat(8) a bigger mess.

I still think that procstat is the better choice, if not adding completely new command, and I do not see adding a new command good idea.

In principle, per-pid filters can be eventually added to procstat advlock, for POSIX-like locks, it is just that they are 1) not very popular 2) not too useful for me as dev IMO.

kib marked an inline comment as done.

Man page editing.

usr.bin/procstat/procstat.1
162 ↗(On Diff #104760)

Maybe note somewhere that len == 0 means, "from start to EOF".

usr.bin/procstat/procstat.h
47

Ok, fair enough. I agree that it doesn't make sense to add a new utility for this purpose.

usr.bin/procstat/procstat_advlock.c
53 ↗(On Diff #104760)

These offsets seem to be slightly wrong. To me it looks right with the following format string: {T:/%2s %5s %5s %5s %18s %18s %8s %9s %9s %s}

kib marked 3 inline comments as done.

Update format string for title.
Document output fields.

This revision is now accepted and ready to land.Apr 9 2022, 2:45 AM