Hi Christian,

Christian Weisgerber wrote on Thu, Sep 28, 2023 at 07:01:29PM +0200:

> It's always the same:
> * foobar doesn't behave as expected
> * I ktrace foobar
> * I run kdump... too much information.
> * I check the kdump(1) man page, since I can't remember which letter
>   represents which tracepoint.
> * "See the -t option of ktrace(1) for the meaning of the letters."
> 
> Sigh.  Yes, duplication is evil, yada, yada, but would it really
> be so bad to also list the tracepoints directly in kdump.1 instead
> of pointing to ktrace.1?

occasionally, small amounts of duplication are tolerable if they really
make life easier for users.  This may be such a case, in particular
considering that the -t option is likely more commonly used with kdump(1)
than with ktrace(1), except in the rare case that the dump becomes so big
that you already have to limit output at ktrace(1) time.

The file /usr/src/usr.bin/ktrace/subr.c already contains a comment
instructing developers to keep ktrace(1), kdump(1), and ltrace(1)
up to date when changing option letters.

Maybe you want to include comments in ktrace.1, kdump.1, and ltrace.1
too, for example like this - your call:

  .Bl -tag -width flag -offset indent -compact
  .\" Keep this list in sync with ktrace(1) and ltrace(1).
  .It Cm c

It doesn't guarantee that we will stay in sync, but maybe it improves
our chances further, in particular when people make editorial changes
to the manuals without changing the code.

Either way, OK schwarze@ if no developer objects in a reasonable
timeframe.

Yours,
  Ingo


> -----------------------------------------------
> commit 6537a30531732808760afdc5dcd7331aeb9d7618 (local)
> from: Christian Weisgerber <na...@mips.inka.de>
> date: Thu Sep 28 16:46:15 2023 UTC
>  
>  list tracepoints directly in kdump.1 instead of pointing to ktrace.1
>  
> diff 1cd585e18a4dcd40dd8e9c339b74dc79fd0856e2 
> 6537a30531732808760afdc5dcd7331aeb9d7618
> commit - 1cd585e18a4dcd40dd8e9c339b74dc79fd0856e2
> commit + 6537a30531732808760afdc5dcd7331aeb9d7618
> blob - 936c630a1096cec78204ac075c6df83a2744e8e2
> blob + 5f073e48510388f26cf5c0c1b66d360dc3332364
> --- usr.bin/kdump/kdump.1
> +++ usr.bin/kdump/kdump.1
> @@ -100,13 +100,38 @@ Display absolute timestamps for each entry (seconds si
>  If both options are specified, display timestamps relative to trace start.
>  .It Fl t Ar trstr
>  Select which tracepoints to display.
> -The argument can contain one or more of the letters
> -.Cm cinpstuxX+ .
> -See the
> -.Fl t
> -option of
> -.Xr ktrace 1
> -for the meaning of the letters.
> +The argument can contain one or more of the following letters.
> +By default all trace points except for
> +.Cm X
> +are enabled.
> +.Pp
> +.Bl -tag -width flag -offset indent -compact
> +.It Cm c
> +trace system calls
> +.It Cm i
> +trace I/O
> +.It Cm n
> +trace namei translations
> +.It Cm p
> +trace violation of
> +.Xr pledge 2
> +restrictions
> +.It Cm s
> +trace signal processing
> +.It Cm t
> +trace various structures
> +.It Cm u
> +trace user data coming from
> +.Xr utrace 2
> +.It Cm x
> +trace argument vector in
> +.Xr execve 2
> +.It Cm X
> +trace environment in
> +.Xr execve 2
> +.It Cm +
> +trace the default points
> +.El
>  .It Fl u Ar label
>  Display
>  .Xr utrace 2

Reply via email to