That's pretty terrible, given that all flavors of xo_emit* turn into the same codepath (xo_do_emit). Can you isolate this into something I can debug, or send me your current patch (phil@freebsd.org) and I'll see if I can do it?
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Wed, Nov 1
$ sudo dtrace -n 'BEGIN { mod(0xffffffff8261a000); exit(0); }'
dtrace: description 'BEGIN ' matched 1 probe
CPU ID FUNCTION:NAME6 1 :BEGIN opensolaris.ko
@phil I've tried to do a basic implementation using xo_create_to_file and then implementing dt_emit() by redirecting buffered output and sprintf output to the regular printf output (it becomes dt_vprintf since i have a va_list instead of variadic arguments). However, I've noticed that if I do regular text output using
Sun, Oct 29
Oct 23 2023
Oct 20 2023
Oct 19 2023
Update the diff. This diff should address the following:
Oct 18 2023
In D41745#951971, @domagoj.stolfa_gmail.com wrote:In D41745#951858, @stephane.rochoy_stormshield.eu wrote:I suggest to think about adding --libxo foo as an alias to -x oformat=foo to make things more inline with what is actually done for, e.g., netstat(1).
Thanks for the feedback! I don't take a strong view on whether or not xo_parse_args() should be called at the start, though it might require some finessing to make it work happily with libdtrace because xo_parse_args() sets a number of flags for libxo that I don't with -x oformat (such as colored output in some cases). Another thing worth pondering is that this is also an argument to libdtrace rather than dtrace(1), so one would inevitably need to still call dtrace_setopt(). Now, however libxo configuration would be performed twice: once in dtrace(1), and once in libdtrace. dtrace(1) itself would explicitly need to include libxo and link against it, but this isn't a big issue IMO, it just "feels" cleaner to me for it to only link against libdtrace and for libdtrace to provide all the libxo handling and configuration and for any consumer code (including dtrace(1)) to simply request it.
However I do agree with the general point that there is an inconsistency with the rest of the base system when it comes to libxo integration (though it's inconsistent in a fair bit of other ways too). One way to work around the issue without xo_parse_args() would be perhaps to add a - flag and manually parse out the -libxo ... that follows? I'm not sure what the best approach would be that doesn't get slightly messy.
Oct 16 2023
In D41745#951971, @domagoj.stolfa_gmail.com wrote:In D41745#951858, @stephane.rochoy_stormshield.eu wrote:I suggest to think about adding --libxo foo as an alias to -x oformat=foo to make things more inline with what is actually done for, e.g., netstat(1).
Thanks for the feedback! I don't take a strong view on whether or not xo_parse_args() should be called at the start, though it might require some finessing to make it work happily with libdtrace because xo_parse_args() sets a number of flags for libxo that I don't with -x oformat (such as colored output in some cases).
Sep 23 2023
Fix off->val type causing a build failure.
Sep 15 2023
Fix struct indentation.
Sep 8 2023
Add missing information to the man page and fix some bits in it (e.g. using .Fn for action names).
Updated the diff with documentation in the dtrace(1) man page, as well as a bug fix when it comes to naming aggregations. Namely, min, max, sum and count were all called count in the final output due to missing checks. These are now addressed.
Sep 7 2023
Please address the comments from markj@ but otherwise this looks good, and more extensive than what we came up with on CADETS.
In D41745#951858, @stephane.rochoy_stormshield.eu wrote:I suggest to think about adding --libxo foo as an alias to -x oformat=foo to make things more inline with what is actually done for, e.g., netstat(1).
I suggest to think about adding --libxo foo as an alias to -x oformat=foo to make things more inline with what is actually done for, e.g., netstat(1).
Sep 6 2023
Attempt #2 at addressing @markj's comments... Forgot one gettimeofday
Address some comments by @markj. The man page comment is still true, as I will be updating that when all the documentation comes in.
I don't see a reason to avoid adding it to dtrace.1?
Perhaps its own man page is warranted in order to avoid polluting dtrace(1)?
Sep 5 2023
Aug 27 2023
Fix return offset handling.
Aug 25 2023
Jul 19 2023
Jul 16 2023
Address comments, fix stuff that was also fixed in riscv.
Jul 14 2023
Jul 13 2023
Update
Address Mark's comments. Depends on D40962.
Jul 12 2023
Disable adr/adrp emulation.
Jul 10 2023
Use per-probe trampolines. Depends on D40962
Jul 7 2023
Updated description, still some unsolved bugs, but mostly done.
Jul 4 2023
In D39884#930242, @jrtc27 wrote:In D39884#930234, @christos wrote:In D39884#930225, @mhorne wrote:In D39884#928340, @markj wrote:This provider can trigger what appears to be a QEMU/TCG bug. The test case:
- boot a riscv VM with more than one vCPU
- run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()
Seems I was a bit slow to report my findings, but I did observe some of the same kinds of panics on real hardware that I saw in QEMU. I will update to the committed version and provide a more detailed answer of what is still not working.
Can you recompile kinst with this patch applied? https://reviews.freebsd.org/P592
If we run it with a single trampoline per page, the crashes seem to go away.Is it just a case of needing to smp_rendezvous a fence_i since it's not broadcast by the hardware like on arm64?
In D39884#930242, @jrtc27 wrote:Is it just a case of needing to smp_rendezvous a fence_i since it's not broadcast by the hardware like on arm64?
In D39884#930234, @christos wrote:In D39884#930225, @mhorne wrote:In D39884#928340, @markj wrote:This provider can trigger what appears to be a QEMU/TCG bug. The test case:
- boot a riscv VM with more than one vCPU
- run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()
Seems I was a bit slow to report my findings, but I did observe some of the same kinds of panics on real hardware that I saw in QEMU. I will update to the committed version and provide a more detailed answer of what is still not working.
Can you recompile kinst with this patch applied? https://reviews.freebsd.org/P592
If we run it with a single trampoline per page, the crashes seem to go away.
In D39884#930225, @mhorne wrote:In D39884#928340, @markj wrote:This provider can trigger what appears to be a QEMU/TCG bug. The test case:
- boot a riscv VM with more than one vCPU
- run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()
Seems I was a bit slow to report my findings, but I did observe some of the same kinds of panics on real hardware that I saw in QEMU. I will update to the committed version and provide a more detailed answer of what is still not working.
Updates.
In D39884#930225, @mhorne wrote:In D39884#928340, @markj wrote:This provider can trigger what appears to be a QEMU/TCG bug. The test case:
- boot a riscv VM with more than one vCPU
- run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()
Seems I was a bit slow to report my findings, but I did observe some of the same kinds of panics on real hardware that I saw in QEMU. I will update to the committed version and provide a more detailed answer of what is still not working.
In D39884#928340, @markj wrote:This provider can trigger what appears to be a QEMU/TCG bug. The test case:
- boot a riscv VM with more than one vCPU
- run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()
Retain CDDL license.
Restore original trampoline size.
Address comments, update LICENSE headers, split some changes to other PRs.
Jun 28 2023
This provider can trigger what appears to be a QEMU/TCG bug. The test case:
- boot a riscv VM with more than one vCPU
- run dtrace -q -n 'kinst::riscv_cpu_intr:', i.e., trace all instructions in riscv_cpu_intr()
Jun 27 2023
Address comments, fix undefined behavior when working with potentially unaligned pointers.
Jun 25 2023
May 31 2023
Address comments.
Address comments.
In D39884#918563, @markj wrote:I've been doing some testing in QEMU again. I'm occasionally able to trigger random "impossible" panics by running dtrace -n 'kinst::vm_fault:' -q & and running various programs in the foreground. top(1), running tests, etc.. It's rather difficult to reproduce though. :(
I've been doing some testing in QEMU again. I'm occasionally able to trigger random "impossible" panics by running dtrace -n 'kinst::vm_fault:' -q & and running various programs in the foreground. top(1), running tests, etc.. It's rather difficult to reproduce though. :(
May 30 2023
Check for the function prologue.
May 26 2023
Do not use kinst_memcpy outside of probe context.
Use kinst_memcpy() and also add kinst_md_excluded().
Closed by commit 9c80ad6839cd30ecfeff2fb946d86888815da600, but had to do it manually because the commit message ate up the 'D' from 'Differential Revision'...
Remove cpu_switch() from kinst_excluded().
Add kinst_md_excluded() as well.
Remove amd64 exception handlers.
Get rid of the 'push rbp' removal in this patch.
May 25 2023
Address comments.
In D39229#916822, @markj wrote:The "push %rbp" check isn't sufficient though. Today you can do this: dtrace -n 'kinst::dtrace_probe:0'. This doesn't work very well.
I would like to at least fix that problem before reconsidering the push %rbp check.