Skip to content
Snippets Groups Projects
README 2.35 KiB
Newer Older
  • Learn to ignore specific revisions
  • Dor Laor's avatar
    Dor Laor committed
    0) Install perquisite packages:
       yum install boost-static genromfs
    
    1) make sure all git submodules are uptodate
    
    Christoph Hellwig's avatar
    Christoph Hellwig committed
       -----------------------------------------
    
    
        git submodule update --init
    
    Christoph Hellwig's avatar
    Christoph Hellwig committed
    
    
    Dor Laor's avatar
    Dor Laor committed
    2) build the specially patched libunwind
    
       -------------------------------------
    
    
    Christoph Hellwig's avatar
    Christoph Hellwig committed
        cd external/libunwind
    
    Dor Laor's avatar
    Dor Laor committed
        autoreconf -i
    
    Christoph Hellwig's avatar
    Christoph Hellwig committed
        cp ./src/.libs/libunwind.a ../..
        cd ../..
    
    Dor Laor's avatar
    Dor Laor committed
    4) build the glibc test suite
    
       cd external/glibc-testsuite
       make
       cd ../..
    
    
    Dor Laor's avatar
    Dor Laor committed
    5) build osv
    
    Debugging
    =========
    
    To build with debugging symbols, and preemption off (to not confuse gdb),
    	make -j mode=debug conf-preempt=0
    
    To clean debugging build's results, use
    	make clean mode=debug
    
    To run the debugging build:
    	sh scripts/run.sh debug
    
    To connect a debugger to this run:
    	$ gdb build/debug/loader.elf
    	(gdb) connect
    	(gdb) osv syms
    	(gdb) bt
    
    To put a breakpoint early in the osv run, a useful trick is tell the vm to
    reboot after setting the breakpoint:
    	(gdb) hbreak function_name
    	(gdb) monitor system_reset
    	(gdb) c
    
    Avi Kivity's avatar
    Avi Kivity committed
    
     Tracing
     =======
    
    Avi Kivity's avatar
    Avi Kivity committed
     To add a static tracepoint, use the following code:
     
       tracepoint<u64, int> trace_foo("foo", "x=%x y=%d");
       
       ...
       
       
       void foo(u64 x, int y)
       {
           trace_foo(x, y);
           ...
       }
     
     Where
     
       trace_foo: an internal identifier
       "foo": a name for the tracepoint as will be visible in the log
       <u64, int>: parameters for the tracepoint
       "x=%x y=%d": format string for the tracepoint; size modifiers unneeded
     
     To enable tracepoints at runtime, use the --trace= switch:
     
       scripts/imgedit.py setargs  build/release/loader.img --trace=sched\* testrunner.so
     
     you can use multiple --trace= switches, or a single one with commas.  Shell-style wildcards
     allow enabling multiple tracepoints (as in the example). 
     
     To trace all function entries/returns in the program, build with conf-tracing=1 (clean build
     needed), and enable "function*" tracepoints, with --trace=.
     
     To view a trace, connect with gdb, and:
     
       (gdb) osv syms
       (gdb) set pagination off
       (gdb) set logging on
       (gdb) osv trace
    
     gdb.txt will contain the the trace.
    
    
    Running java benchmarks
    =======================
    
    After running "make", do
        scripts/imgedit.py setargs build/debug/loader.img java.so -jar bench.jar
    
    and then run normally (sh scripts/run.sh).