On Mon, May 03, 2021 at 12:59:27AM +0200, Patrick Wildt wrote:
> > ...
> > But when I do (as root): "sysctl kern.allowdt=1" it returns this error:
> > 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.
> # btrace -e 'BEGIN{ @enq = 0 } tracepoint:sched:enqueue { @enq = @enq + 1; } 
> interval:s:10 { printf("sched_enqueue: %d\n", @enq) ; @enq = 0; }'
> btrace:1:77: syntax error:
> BEGIN{ @enq = 0 } tracepoint:sched:enqueue { @enq = @enq + 1; } interval:s:10 
> { printf("sched_enqueue: %d\n", @enq) ; @enq = 0; }
>                                                                             ^
Doesn't seem to like the interval syntax?

Or this one which does run but then takes an assertion failure:
> # btrace -e 'BEGIN{ @enq = 0 } tracepoint:sched:enqueue { @enq = 
> lhist(retval, 0, 1000, 100); }'
> 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.

Reply via email to