Download raw body.
btrace(1): fix -e and filename args
On Sat, May 17, 2025 at 01:12:38PM +0200, Rafael Sadowski wrote:
> On Sat May 17, 2025 at 06:44:53AM +0100, Jason McIntyre wrote:
> > On Sat, May 17, 2025 at 05:00:50AM +0200, Rafael Sadowski wrote:
> > > btrace(1) does not accept "-e file" Instead, it depends on filename as
> > > the last parameter if no -b inline-script is specified. I also improved
> > > the definition of "program".
> > >
> >
> > hi!
> >
> > - is there a reason for changing "file" to "filename"? "file" is
> > probably more common - if you keep it you can simply do "Op Ar".
>
> No special reason. It was so named in the source code. "file" is fine. Thanks.
> "Op Ar" translates to "[file ...]". The current implantation expects
> only one file.
>
> >
> > - you need to sync usage()
> >
>
> Thanks.
>
> > - what does "argument ..." represent? i mean, what arguments can be
> > passed? i know its not part of your diff, but i want to make sure that
> > it's not also meant to represent "file".
>
> I have no clue what "argument ..." expects and what it does. I haven't
> look to deeply in bt_parse.c.
>
>
> diff --git a/usr.sbin/btrace/btrace.8 b/usr.sbin/btrace/btrace.8
> index b233465185a..8a6532ba682 100644
> --- a/usr.sbin/btrace/btrace.8
> +++ b/usr.sbin/btrace/btrace.8
> @@ -23,8 +23,9 @@
> .Sh SYNOPSIS
> .Nm btrace
> .Op Fl lnv
> -.Op Fl e Ar program | Ar file
> +.Op Fl e Ar program
> .Op Fl p Ar file
> +.Op Ar file
> .Op Ar argument ...
> .Sh DESCRIPTION
> The
> @@ -33,7 +34,8 @@ utility provides an interface to inspect the internals of the system and
> programs.
> It interprets the
> .Xr bt 5
> -program in
> +.Ar program
> +or
> .Ar file
> and communicates with the dynamic tracer device using the interface described in
> .Xr dt 4 .
> @@ -41,7 +43,8 @@ and communicates with the dynamic tracer device using the interface described in
> The options are as follows:
> .Bl -tag -width Ds
> .It Fl e Ar program
> -Execute
> +Execute inline
> +.Xr bt 5
> .Ar program .
> .It Fl l
> List all available probes.
> diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c
> index 977c9ed5162..f8556ca26aa 100644
> --- a/usr.sbin/btrace/btrace.c
> +++ b/usr.sbin/btrace/btrace.c
> @@ -231,7 +231,7 @@ main(int argc, char *argv[])
> __dead void
> usage(void)
> {
> - fprintf(stderr, "usage: %s [-lnv] [-e program | file] [-p file] "
> + fprintf(stderr, "usage: %s [-lnv] [-e program] [-p file] [ file ] "
> "[argument ...]\n", getprogname());
> exit(1);
> }
>
in usage: [ file ] -> [file ...]
jmc
btrace(1): fix -e and filename args