Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Porting DTrace to ARM

(2014/01/27 19:57), Ryota Ozaki wrote:

(2014/01/27 14:43), Ryota Ozaki wrote:
Hi Matt,

Thank you very much for your kind reviewing.

(2014/01/24 23:03), Matt Thomas wrote:

On Jan 24, 2014, at 2:34 AM, Ryota Ozaki <> wrote:

Updated as I planned, there is no curious update though.

Use of curcpu() or cpu_number() without having done kpreempt_disable()
is unsafe.

All the functions that I added and calls cpu_number() are
called from an interrupt handler, xc_unicast(XC_HIGHPRI, ...)
or dtrace_probe() that calls interrupt_disable() prior to
calling the functions.

In these cases, we don't need kpreempt_disable(), right?

dtrace_asm.S doesn't "assym.h"

Do you mean dtrace_asm.S doesn't need "assym.h"?

assembly routines should have a END(name) as well.
Use of =foo is frowned upon.

    #ldr    r0, dtrace_invop_start
    ldr    r1, .Ldtrace_invop
    ldr    r2, .Ldtrace_invop_jump_addr
    str    r1, [r2]
    .align    0
    .word    dtrace_invop
    .word    dtrace_invop_jump_addr

    mov    r0, #0
    ldr    r1, .Ldtrace_invop_jump_addr
    str    r0, [r1]

Thanks, it works. The code is what I wanted to
do initially.


Don't use u_int{8,16,32}_t

OK. Will fix.


Use include <>, then use

.if exists(${.CURDIR}/${MACHINE})
.elif exists(${.CURDIR}/${MACHINE_CPU})
.error ${MACHINE} or ${MACHINE_CPU} not supported.

Followed you suggestion, I changed Makefile like this:


.if exists(${OSNETDIR}/dev/cyclic/${MACHINE:S/amd64/i386/})
.elif exists(${OSNETDIR}/dev/cyclic/${MACHINE_CPU})
.error ${MACHINE} or ${MACHINE_CPU} not supported.

Two notes; .CURDIR is changed to the corresponding directory
and ARCHDIR is changed to ARCH because for arm ARCHDIR
is already defined in share/mk/

Updated the patch at,
which reflects the above comments.

Now the patch can run some simple D scripts (by fixing
dtrace_cas32), although there still remain some (many?)
problems, for example, dtrace -n fbt::: cannot be handled

The patch is getting in good shape. The version of arm works
as well as that of i386/arm64. At least the sample scripts(*)
now work fine on it.


Major changes since the previous version:
- move the instruction emulation code to fbt.c from undefined.c
  - to make easy to debug
  - to use definitions of dtrace.h under external/cddl/osnet/
- reject some functions from probing
  - dtrace doesn't work for the functions
  - see fbt.c
- don't enable interrupts before running dtrace_trapper
  in undefinedinstruction()
  - dtrace requires it
  - the patch is dirty :-(
- correct instruction emulations


Home | Main Index | Thread Index | Old Index