<div dir="ltr"><div>OK,I find the reason.<br></div><div>ktrace must be config in kernel</div><div>I will build the custom kernel and try again.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-14 15:06 GMT+08:00 lhmwzy <span dir="ltr"><<a href="mailto:lhmwzy@gmail.com" target="_blank">lhmwzy@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I'd like to provide,but how to<br></div><div><br></div><div>#cd cd LuaJIT-2.0.2.patch/src<br>#ktrace luajit<br>
ktrace: ktrace.out: Function not implemented<br></div><div><br></div><div><br></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-14 14:50 GMT+08:00 Alex Hornung <span dir="ltr"><<a href="mailto:alex@alexhornung.com" target="_blank">alex@alexhornung.com</a>></span>:<div><div class="h5">
<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Can you provide a ktrace(1) output? Just ktrace luajit, and then
    kdump and get the output.<br>
    <br>
    Cheers,<br>
    Alex<div><div><br>
    <br>
    <div>On 14/02/14 01:22, lhmwzy wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">I have tried as fllowing<br>
        <br>
        diff -Nur LuaJIT-2.0.2/src/lj_alloc.c
        LuaJIT-2.0.2.patch/src/lj_alloc.c<br>
        --- LuaJIT-2.0.2/src/lj_alloc.c 2013-06-03 19:00:00.000000000
        +0000<br>
        +++ LuaJIT-2.0.2.patch/src/lj_alloc.c 2014-02-14
        07:19:53.948397000 +0000<br>
        @@ -188,7 +188,7 @@<br>
        return ptr;<br>
        }<br>
        <br>
        -#elif LJ_TARGET_OSX || defined(__FreeBSD__) ||
        defined(__FreeBSD_kernel__) || defined(__OpenBSD__) ||
        defined(__sun__)<br>
        +#elif LJ_TARGET_OSX || defined(__FreeBSD__) ||
        defined(__FreeBSD_kernel__) || defined(__OpenBSD__) ||
        defined(__sun__)||defined(__DragonFly__)<br>
        <br>
        /* OSX and FreeBSD mmap() use a naive first-fit linear search.<br>
        ** That's perfect for us. Except that -pagezero_size must be set
        for OSX,<br>
        @@ -202,7 +202,7 @@<br>
        #endif<br>
        #define MMAP_REGION_END ((uintptr_t)0x80000000)<br>
        <br>
        -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)<br>
        +#if defined(__FreeBSD__) ||
        defined(__FreeBSD_kernel__)||defined(__DragonFly__)<br>
        #include <sys/resource.h><br>
        #endif<br>
        <br>
        @@ -212,7 +212,7 @@<br>
        /* Hint for next allocation. Doesn't need to be thread-safe. */<br>
        static uintptr_t alloc_hint = MMAP_REGION_START;<br>
        int retry = 0;<br>
        -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)<br>
        +#if defined(__FreeBSD__) ||
        defined(__FreeBSD_kernel__)||defined(__DragonFly__)<br>
        static int rlimit_modified = 0;<br>
        if (LJ_UNLIKELY(rlimit_modified == 0)) {<br>
        struct rlimit rlim;<br>
        diff -Nur LuaJIT-2.0.2/src/lj_arch.h
        LuaJIT-2.0.2.patch/src/lj_arch.h<br>
        --- LuaJIT-2.0.2/src/lj_arch.h 2013-06-03 19:00:00.000000000
        +0000<br>
        +++ LuaJIT-2.0.2.patch/src/lj_arch.h 2014-02-14
        07:21:18.628483000 +0000<br>
        @@ -67,7 +67,7 @@<br>
        #elif defined(__MACH__) && defined(__APPLE__)<br>
        #define LUAJIT_OS LUAJIT_OS_OSX<br>
        #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \<br>
        - defined(__NetBSD__) || defined(__OpenBSD__)<br>
        + defined(__NetBSD__) ||
        defined(__OpenBSD__)||defined(__DragonFly__)<br>
        #define LUAJIT_OS LUAJIT_OS_BSD<br>
        #elif (defined(__sun__) && defined(__svr4__)) ||
        defined(__CYGWIN__)<br>
        #define LUAJIT_OS LUAJIT_OS_POSIX<br>
        <br>
        >cd LuaJIT-2.0.2.patch/<br>
        > cd src<br>
        > /usr/local/bin/make<br>
        HOSTCC host/minilua.o<br>
        HOSTLINK host/minilua<br>
        DYNASM host/buildvm_arch.h<br>
        HOSTCC host/buildvm.o<br>
        HOSTCC host/buildvm_asm.o<br>
        HOSTCC host/buildvm_peobj.o<br>
        HOSTCC host/buildvm_lib.o<br>
        HOSTCC host/buildvm_fold.o<br>
        HOSTLINK host/buildvm<br>
        BUILDVM lj_vm.s<br>
        ASM lj_vm.o<br>
        CC lj_gc.o<br>
        BUILDVM lj_ffdef.h<br>
        CC lj_err.o<br>
        CC lj_char.o<br>
        BUILDVM lj_bcdef.h<br>
        CC lj_bc.o<br>
        CC lj_obj.o<br>
        CC lj_str.o<br>
        CC lj_tab.o<br>
        CC lj_func.o<br>
        CC lj_udata.o<br>
        CC lj_meta.o<br>
        CC lj_debug.o<br>
        CC lj_state.o<br>
        CC lj_dispatch.o<br>
        CC lj_vmevent.o<br>
        CC lj_vmmath.o<br>
        CC lj_strscan.o<br>
        CC lj_api.o<br>
        CC lj_lex.o<br>
        CC lj_parse.o<br>
        CC lj_bcread.o<br>
        CC lj_bcwrite.o<br>
        CC lj_load.o<br>
        CC lj_ir.o<br>
        CC lj_opt_mem.o<br>
        BUILDVM lj_folddef.h<br>
        CC lj_opt_fold.o<br>
        CC lj_opt_narrow.o<br>
        CC lj_opt_dce.o<br>
        CC lj_opt_loop.o<br>
        CC lj_opt_split.o<br>
        CC lj_opt_sink.o<br>
        CC lj_mcode.o<br>
        CC lj_snap.o<br>
        CC lj_record.o<br>
        CC lj_crecord.o<br>
        BUILDVM lj_recdef.h<br>
        CC lj_ffrecord.o<br>
        CC lj_asm.o<br>
        CC lj_trace.o<br>
        CC lj_gdbjit.o<br>
        CC lj_ctype.o<br>
        CC lj_cdata.o<br>
        CC lj_cconv.o<br>
        CC lj_ccall.o<br>
        CC lj_ccallback.o<br>
        CC lj_carith.o<br>
        CC lj_clib.o<br>
        CC lj_cparse.o<br>
        CC lj_lib.o<br>
        CC lj_alloc.o<br>
        CC lib_aux.o<br>
        BUILDVM lj_libdef.h<br>
        CC lib_base.o<br>
        CC lib_math.o<br>
        CC lib_bit.o<br>
        CC lib_string.o<br>
        CC lib_table.o<br>
        CC lib_io.o<br>
        CC lib_os.o<br>
        CC lib_package.o<br>
        CC lib_debug.o<br>
        CC lib_jit.o<br>
        CC lib_ffi.o<br>
        CC lib_init.o<br>
        AR libluajit.a<br>
        CC luajit.o<br>
        BUILDVM jit/vmdef.lua<br>
        DYNLINK libluajit.so<br>
        LINK luajit<br>
        OK Successfully built LuaJIT<br>
        <br>
        All seems good,but when run<br>
        > ./luajit<br>
        ./luajit: cannot create state: not enough memory<br>
        <div class="gmail_extra">
          <br>
          <br>
          <div class="gmail_quote">2014-02-14 9:19 GMT+08:00 Justin
            Sherrill <span dir="ltr"><<a href="mailto:justin@shiningsilence.com" target="_blank">justin@shiningsilence.com</a>></span>:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">It looks like it's trying something
                specific; assuming it's really not supported on
                DragonFly, you could look in the file and see if it has
                a fallback for other operating systems that don't
                support this feature and add DragonFly to that fallback.</div>
              <div>
                <div>
                  <div class="gmail_extra"><br>
                    <br>
                    <div class="gmail_quote">On Thu, Feb 13, 2014 at
                      4:01 AM, lhmwzy <span dir="ltr"><<a href="mailto:lhmwzy@gmail.com" target="_blank">lhmwzy@gmail.com</a>></span>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                        <div dir="ltr"><br>
                          LuaJIT-2.1-20140109<br>
                          <br>
                          use GNU make to make<br>
                          <br>
                          the error info:<br>
                          lj_mcode.c:123:2: error: #error "Missing OS
                          support for explicit placement of executable
                          memory"<br>
                          lj_mcode.c: In function 'mcode_protect':<br>
                          lj_mcode.c:197:5: warning: implicit
                          declaration of function 'mcode_setprot'
                          [-Wimplicit-function-declaration]<br>
                          lj_mcode.c: In function 'mcode_alloc':<br>
                          lj_mcode.c:235:7: warning: implicit
                          declaration of function 'mcode_alloc_at'
                          [-Wimplicit-function-declaration]<br>
                          lj_mcode.c:235:45: error: 'MCPROT_RW'
                          undeclared (first use in this function)<br>
                          lj_mcode.c:235:45: note: each undeclared
                          identifier is reported only once for each
                          function it appears in<br>
                          lj_mcode.c:240:7: warning: implicit
                          declaration of function 'mcode_free'
                          [-Wimplicit-function-declaration]<br>
                          lj_mcode.c: In function 'mcode_allocarea':<br>
                          lj_mcode.c:275:15: error: 'MCPROT_RW'
                          undeclared (first use in this function)<br>
                          lj_mcode.c: In function 'lj_mcode_reserve':<br>
                          lj_mcode.c:304:22: error: 'MCPROT_RW'
                          undeclared (first use in this function)<br>
                          lj_mcode.c: In function 'lj_mcode_commit':<br>
                          lj_mcode.c:313:20: error: 'MCPROT_RX'
                          undeclared (first use in this function)<br>
                          lj_mcode.c: In function 'lj_mcode_abort':<br>
                          lj_mcode.c:320:22: error: 'MCPROT_RX'
                          undeclared (first use in this function)<br>
                          lj_mcode.c: In function 'lj_mcode_patch':<br>
                          lj_mcode.c:332:24: error: 'MCPROT_RX'
                          undeclared (first use in this function)<br>
                          lj_mcode.c:340:24: error: 'MCPROT_RW'
                          undeclared (first use in this function)<br>
                          Makefile:642: recipe for target 'lj_mcode.o'
                          failed<br>
                          <br>
                          try LuaJIT-2.0.2<br>
                          the error info :<br>
                          lj_mcode.c:122:2: error: #error "Missing OS
                          support for explicit placement of executable
                          memory"<br>
                          lj_mcode.c: In function 'mcode_protect':<br>
                          lj_mcode.c:187:5: warning: implicit
                          declaration of function 'mcode_setprot'
                          [-Wimplicit-function-declaration]<br>
                          lj_mcode.c: In function 'mcode_alloc':<br>
                          lj_mcode.c:224:7: warning: implicit
                          declaration of function 'mcode_alloc_at'
                          [-Wimplicit-function-declaration]<br>
                          lj_mcode.c:224:45: error: 'MCPROT_RW'
                          undeclared (first use in this function)<br>
                          lj_mcode.c:224:45: note: each undeclared
                          identifier is reported only once for each
                          function it appears in<br>
                          lj_mcode.c:229:7: warning: implicit
                          declaration of function 'mcode_free'
                          [-Wimplicit-function-declaration]<br>
                          lj_mcode.c: In function 'mcode_allocarea':<br>
                          lj_mcode.c:264:15: error: 'MCPROT_RW'
                          undeclared (first use in this function)<br>
                          lj_mcode.c: In function 'lj_mcode_reserve':<br>
                          lj_mcode.c:293:22: error: 'MCPROT_RW'
                          undeclared (first use in this function)<br>
                          lj_mcode.c: In function 'lj_mcode_commit':<br>
                          lj_mcode.c:302:20: error: 'MCPROT_RX'
                          undeclared (first use in this function)<br>
                          lj_mcode.c: In function 'lj_mcode_abort':<br>
                          lj_mcode.c:308:20: error: 'MCPROT_RX'
                          undeclared (first use in this function)<br>
                          lj_mcode.c: In function 'lj_mcode_patch':<br>
                          lj_mcode.c:320:24: error: 'MCPROT_RX'
                          undeclared (first use in this function)<br>
                          lj_mcode.c:328:24: error: 'MCPROT_RW'
                          undeclared (first use in this function)<br>
                          <br>
                          My os:<br>
                          uname -a:<br>
                          DragonFly . 3.6-RELEASE DragonFly
                          v3.6.0.24.gf2d5f-RELEASE #4: Tue Feb 11
                          14:22:27 UTC 2014 <a href="mailto:lhm@.:/usr/obj/usr/src/sys/" target="_blank">lhm@.:/usr/obj/usr/src/sys/</a><br>
                          <div> lhmwzy x86_64</div>
                          <div><br>
                          </div>
                          <div>Any suggestion?</div>
                        </div>
                      </blockquote>
                    </div>
                    <br>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div></div></div><br></div>
</blockquote></div><br></div>