Re: install btrace scripts

2022-04-30 Thread Alexander Bluhm
On Sat, Apr 30, 2022 at 02:03:28PM -0600, Theo de Raadt wrote:
> >On 2022-04-30, Alexander Bluhm wrote:
> >> Hi,
> >> 
> >> Can we install the btrace scripts to /usr/share/btrace/ ?  The
> >> directory already exists, only the Makefile is not linked to the
> >> build.
> >> 
> >> And I would like to use #! to make them executable.
> >
> >It's weird to have exec files in share?
> 
> yes, it is weird.  i am not convinced that btrace is a natural
> interpreter, nor that anyone would put this into your $PATH, at
> which point you are using an absolute path, and it seems unlikely
> anyone would even notice these are executable, so they would the
> pattern:
> 
> >I think it's not very hard to type "btrace script" vs script.

Now without #! and with man page.

Index: share/Makefile
===
RCS file: /data/mirror/openbsd/cvs/src/share/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- share/Makefile  9 Oct 2014 03:46:15 -   1.18
+++ share/Makefile  30 Apr 2022 19:22:32 -
@@ -1,5 +1,5 @@
 #  $OpenBSD: Makefile,v 1.18 2014/10/09 03:46:15 tedu Exp $
 
-SUBDIR=dict locale man misc mk snmp tabset termtypes zoneinfo
+SUBDIR=btrace dict locale man misc mk snmp tabset termtypes zoneinfo
 
 .include 
Index: share/btrace/kprofile.bt
===
RCS file: /data/mirror/openbsd/cvs/src/share/btrace/kprofile.bt,v
retrieving revision 1.1
diff -u -p -r1.1 kprofile.bt
--- share/btrace/kprofile.bt23 Oct 2021 19:37:35 -  1.1
+++ share/btrace/kprofile.bt30 Apr 2022 21:32:03 -
@@ -1,3 +1,5 @@
+/* $OpenBSD$   */
+
 /*
  * kprofile.bt Kernel profiling (stack sampling) at 100Hz.
  *
Index: share/btrace/runqlat.bt
===
RCS file: /data/mirror/openbsd/cvs/src/share/btrace/runqlat.bt,v
retrieving revision 1.2
diff -u -p -r1.2 runqlat.bt
--- share/btrace/runqlat.bt 24 Oct 2021 08:42:38 -  1.2
+++ share/btrace/runqlat.bt 30 Apr 2022 21:32:06 -
@@ -1,3 +1,5 @@
+/* $OpenBSD$   */
+
 /*
  * runqlat.bt  Measure run queue latency (aka scheduler latency). OpenBSD.
  *
Index: usr.sbin/btrace/btrace.8
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/btrace/btrace.8,v
retrieving revision 1.6
diff -u -p -r1.6 btrace.8
--- usr.sbin/btrace/btrace.88 Sep 2021 13:29:51 -   1.6
+++ usr.sbin/btrace/btrace.830 Apr 2022 21:38:41 -
@@ -59,6 +59,13 @@ Multiple
 options increase the verbosity.
 The maximum is 2.
 .El
+.Sh FILES
+.Bl -tag -width "/usr/share/btrace/" -compact
+.It Pa /usr/share/btrace/*
+collection of useful
+.Nm
+programs
+.El
 .Sh EXIT STATUS
 .Ex -std 
 .Sh SEE ALSO



Re: install btrace scripts

2022-04-30 Thread Theo de Raadt
>On 2022-04-30, Alexander Bluhm wrote:
>> Hi,
>> 
>> Can we install the btrace scripts to /usr/share/btrace/ ?  The
>> directory already exists, only the Makefile is not linked to the
>> build.
>> 
>> And I would like to use #! to make them executable.
>
>It's weird to have exec files in share?

yes, it is weird.  i am not convinced that btrace is a natural
interpreter, nor that anyone would put this into your $PATH, at
which point you are using an absolute path, and it seems unlikely
anyone would even notice these are executable, so they would the
pattern:

>I think it's not very hard to type "btrace script" vs script.



Re: install btrace scripts

2022-04-30 Thread Ted Unangst
On 2022-04-30, Alexander Bluhm wrote:
> Hi,
> 
> Can we install the btrace scripts to /usr/share/btrace/ ?  The
> directory already exists, only the Makefile is not linked to the
> build.
> 
> And I would like to use #! to make them executable.

It's weird to have exec files in share?

I think it's not very hard to type "btrace script" vs script.
Or have you added this directory to your PATH too?

Either way, it would be helpful for the man page to mention this directory.



install btrace scripts

2022-04-30 Thread Alexander Bluhm
Hi,

Can we install the btrace scripts to /usr/share/btrace/ ?  The
directory already exists, only the Makefile is not linked to the
build.

And I would like to use #! to make them executable.

ok?

bluhm

Index: share/Makefile
===
RCS file: /data/mirror/openbsd/cvs/src/share/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- share/Makefile  9 Oct 2014 03:46:15 -   1.18
+++ share/Makefile  30 Apr 2022 19:22:32 -
@@ -1,5 +1,5 @@
 #  $OpenBSD: Makefile,v 1.18 2014/10/09 03:46:15 tedu Exp $
 
-SUBDIR=dict locale man misc mk snmp tabset termtypes zoneinfo
+SUBDIR=btrace dict locale man misc mk snmp tabset termtypes zoneinfo
 
 .include 
Index: share/btrace/Makefile
===
RCS file: /data/mirror/openbsd/cvs/src/share/btrace/Makefile,v
retrieving revision 1.1
diff -u -p -r1.1 Makefile
--- share/btrace/Makefile   23 Oct 2021 19:37:35 -  1.1
+++ share/btrace/Makefile   30 Apr 2022 19:18:25 -
@@ -4,7 +4,7 @@ FILES=  kprofile.bt runqlat.bt
 NOOBJ= noobj
 
 install:
-   ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \
+   ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 555 ${FILES} \
${DESTDIR}${BINDIR}/btrace
 
 .include 
Index: share/btrace/kprofile.bt
===
RCS file: /data/mirror/openbsd/cvs/src/share/btrace/kprofile.bt,v
retrieving revision 1.1
diff -u -p -r1.1 kprofile.bt
--- share/btrace/kprofile.bt23 Oct 2021 19:37:35 -  1.1
+++ share/btrace/kprofile.bt30 Apr 2022 19:20:32 -
@@ -1,3 +1,6 @@
+#!/usr/sbin/btrace
+/* $OpenBSD$   */
+
 /*
  * kprofile.bt Kernel profiling (stack sampling) at 100Hz.
  *
Index: share/btrace/runqlat.bt
===
RCS file: /data/mirror/openbsd/cvs/src/share/btrace/runqlat.bt,v
retrieving revision 1.2
diff -u -p -r1.2 runqlat.bt
--- share/btrace/runqlat.bt 24 Oct 2021 08:42:38 -  1.2
+++ share/btrace/runqlat.bt 30 Apr 2022 19:20:38 -
@@ -1,3 +1,6 @@
+#!/usr/sbin/btrace
+/* $OpenBSD$   */
+
 /*
  * runqlat.bt  Measure run queue latency (aka scheduler latency). OpenBSD.
  *