Discussion:
Q: dmesg: dt: 443 probes
Why 42? The lists account.
2021-05-02 21:49:10 UTC
Permalink
Actually I do notice one thing, having just upgraded to:
kern.version=OpenBSD 6.9-current (GENERIC.MP) #492: Sat May 1 17:37:28 MDT 2021

I checked the output from dmesg and I have a new boot time message:
dt: 443 probes

man dt tells me that dt is dynamic tracing and that I can enable it by
setting kern.allowdt.

But when I do (as root): "sysctl kern.allowdt=1" it returns this error:
sysctl: kern.allowdt: Operation not permitted

What am I missing?

Cheers,
Robb.

FYI: This is on an Intel NUC:
bios0 at mainbus0: SMBIOS rev. 3.2 @ 0x7a9a4000 (77 entries)
bios0: vendor Intel Corp. version "BECFL357.86A.0087.2020.1209.1115" date 12/09/2020
bios0: Intel(R) Client Systems NUC8i5BEH
Patrick Wildt
2021-05-02 22:59:27 UTC
Permalink
Post by Why 42? The lists account.
kern.version=OpenBSD 6.9-current (GENERIC.MP) #492: Sat May 1 17:37:28 MDT 2021
dt: 443 probes
man dt tells me that dt is dynamic tracing and that I can enable it by
setting kern.allowdt.
sysctl: kern.allowdt: Operation not permitted
Similarly to kern.allowkmem, you can only set it when the securelevel is
still 'low'. That's for security. You need to add kern.allowdt=1 to
sysctl.conf, and then reboot. Then it'll be enabled after reboot.
Post by Why 42? The lists account.
What am I missing?
Cheers,
Robb.
bios0: vendor Intel Corp. version "BECFL357.86A.0087.2020.1209.1115" date 12/09/2020
bios0: Intel(R) Client Systems NUC8i5BEH
Why 42? The lists account.
2021-05-04 15:16:34 UTC
Permalink
Post by Patrick Wildt
Post by Why 42? The lists account.
...
sysctl: kern.allowdt: Operation not permitted
Similarly to kern.allowkmem, you can only set it when the securelevel is
still 'low'. That's for security. You need to add kern.allowdt=1 to
sysctl.conf, and then reboot. Then it'll be enabled after reboot.
Thanks Patrick! After the reboot I was able to experiment with btrace.

Do you use it, do you have any examples that might help to get started?

Using the bfptrace reference guide:
https://github.com/iovisor/bpftrace/blob/master/docs/reference_guide.md
I was able to get a simple "Hello World" to run, but more than that
seemed to cause me some problems e.g.
Post by Patrick Wildt
^
Doesn't seem to like the interval syntax?
Post by Patrick Wildt
assertion "hist->hstep == step" failed: file "/usr/src/usr.sbin/btrace/map.c", line 246, function "hist_increment"
zsh: abort (core dumped) btrace -e
Thanks again in any case!

Cheers,
Robb.
Stuart Henderson
2021-05-04 15:38:14 UTC
Permalink
Post by Why 42? The lists account.
Post by Patrick Wildt
Post by Why 42? The lists account.
...
sysctl: kern.allowdt: Operation not permitted
Similarly to kern.allowkmem, you can only set it when the securelevel is
still 'low'. That's for security. You need to add kern.allowdt=1 to
sysctl.conf, and then reboot. Then it'll be enabled after reboot.
Thanks Patrick! After the reboot I was able to experiment with btrace.
Do you use it, do you have any examples that might help to get started?
Here's one example:
https://marc.info/?l=openbsd-bugs&m=158583371404603&w=2
Patrick Wildt
2021-05-04 19:19:05 UTC
Permalink
Post by Stuart Henderson
Post by Why 42? The lists account.
Post by Patrick Wildt
Post by Why 42? The lists account.
...
sysctl: kern.allowdt: Operation not permitted
Similarly to kern.allowkmem, you can only set it when the securelevel is
still 'low'. That's for security. You need to add kern.allowdt=1 to
sysctl.conf, and then reboot. Then it'll be enabled after reboot.
Thanks Patrick! After the reboot I was able to experiment with btrace.
Do you use it, do you have any examples that might help to get started?
https://marc.info/?l=openbsd-bugs&m=158583371404603&w=2
That's exactly the one I use. Though with varying hz (1-60)

Loading...