Page MenuHomeFreeBSD

Add ts(1) command
ClosedPublic

Authored by otis on Jul 2 2022, 3:34 PM.
Tags
None
Referenced Files
F120921862: D35694.id107752.diff
Sun, Jun 22, 4:21 AM
Unknown Object (File)
Fri, Jun 20, 7:18 PM
Unknown Object (File)
Fri, Jun 20, 5:32 PM
Unknown Object (File)
Fri, Jun 20, 1:06 PM
Unknown Object (File)
Fri, Jun 20, 12:16 PM
Unknown Object (File)
Fri, Jun 20, 3:09 AM
Unknown Object (File)
Wed, Jun 18, 6:45 AM
Unknown Object (File)
Wed, Jun 18, 12:56 AM

Details

Summary

Add /usr/bin/ts, a command that timestamps each line of its stdin
before it is being printed to stdout.

A typical use case is to profile shell scripts.

Obtained from: OpenBSD

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46286
Build 43175: arc lint + arc unit

Event Timeline

otis requested review of this revision.Jul 2 2022, 3:34 PM
  • Add ts to usr.sbin Makefile

I cant immediately spot any other nits with the mdoc, but perhaps you should add a note about when ts(1) was added to FreeBSD in the history section header?

Also, I can't wait for this one to land, it's super handy and I can't believe I didn't know about it until now. :)

contrib/ts/ts.1
18

I'm not quite sure about this one; it doesn't really follow existing syntax with the CVS expansion, and the date doesn't follow the "Month Day, Year" way that we usually designate the document date with.

25

.Nm has already been defined above, so I believe our convention is to shorten other instances of the document name.

I will note that this is done elsewhere in the mdoc file, so perhaps it's a change that should go upstream instead? That's up to you and upstream.

Address some manpage nits.

otis marked 2 inline comments as done.Jul 2 2022, 4:52 PM

mandoc -Tlint ts.1 did not show any warnings/errors.

Include sys/types.h instead of sys/cdefs.h

mdoc(7) looks good to me.

This revision is now accepted and ready to land.Jul 4 2022, 6:04 AM

Can you add a "relnotes: yes" line to the commit message? Thanks!

Move Imported to HISTORY manpage section

This revision now requires review to proceed.Jul 4 2022, 1:49 PM
jrtc27 added inline comments.
usr.bin/ts/Makefile
2

Don't add these to new files

Do not add $FreeBSD$ RCS tag.

otis marked an inline comment as done.Jul 4 2022, 4:50 PM

Other than the question, I'm still happy with the mdoc, so will accept once that's been answered.

contrib/ts/ts.1
105–106

Shouldn't this be .An -nosplit Juraj Lutter Aq Mt otis@FreeBSD.org .

otis marked an inline comment as done.Jul 6 2022, 6:13 AM
otis added inline comments.
contrib/ts/ts.1
105–106

Shouldn't this be .An -nosplit Juraj Lutter Aq Mt otis@FreeBSD.org .

No, as mandoc would throw an error (yes, I've consulted it with man mdoc) that says:

An -split | -nosplit | first_name ... last_name

That means: An with EITHER -split or -nosplit or first_name ... last_name

otis marked an inline comment as done.

Update to latest OpenBSD revision.

The TR for TS typo can be fixed on commit.

contrib/ts/ts.1
18
This revision is now accepted and ready to land.Jul 7 2022, 3:49 PM

The TR for TS typo can be fixed on commit.

Is there a reason this was never merged?

Could we, please, rejuvenate this review?

IMHO, that's a neat tool that perfectly fits original UNIX concepts. I'd vote for adding it.

@otis , you got commit bit, right? If you are concerned about possible objections, and want attract more attention to this review, maybe send a note to current@?

This revision now requires review to proceed.May 21 2025, 5:25 PM

Would it be better to import this through a vendor branch?

In D35694#1153370, @cy wrote:

Would it be better to import this through a vendor branch?

This seems to me too small to deserve its own vendor branch. Moreover, there are some local changes (subtle ones) to manual page.

In D35694#1153370, @cy wrote:

Would it be better to import this through a vendor branch?

This seems to me too small to deserve its own vendor branch. Moreover, there are some local changes (subtle ones) to manual page.

Vendor branches are how we manage the changes to upstreams so they don't get lost. But at 180 lines, 3 of which are added, it's hard to argue for using it.

Importing this via a vendor branch would indeed be the "correct" way to do it, but it doesn't much matter as the upstream is unlikely to see significant change from this point. I imagine this program is essentially complete.

This (not using a vendor branch) is the way we've handled makefs(8) -- OpenBSD, NetBSD and FreeBSD all have copies with independent development and at this point OpenBSD and NetBSD are not really upstreams that we could use for contrib/.

Do note in the commit message the OpenBSD version that it came from, though.

contrib/ts/ts.c
32

If we're not taking this as contrib software just use __dead2 in place

51–54

Our version will probably diverge anyway.

otis marked an inline comment as done.Mon, May 26, 7:03 PM
otis marked 2 inline comments as done.
This revision is now accepted and ready to land.Mon, May 26, 9:31 PM
This revision was automatically updated to reflect the committed changes.