Skip to content

Commit

Permalink
LLVM-Tracer v1.0 Public Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophia Shao committed Feb 7, 2015
1 parent 1765c6d commit e230444
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 32 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright (c) 2013-2014 President and Fellows of Harvard College. All rights
reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

Expand All @@ -11,7 +11,7 @@ following disclaimer in the documentation and/or other materials provided with
the distribution. Neither the name "Harvard" nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOTLIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down
64 changes: 34 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
LLVM IR Trace Profiler (LLVM-Tracer) 0.1 Pre-release
LLVM IR Trace Profiler (LLVM-Tracer) 1.0 Public Release
============================================
LLVM-Tracer is an LLVM instrumentation pass to print out a dynamic LLVM IR
trace, including dynamic register values and memory addresses.
trace, including dynamic register values and memory addresses.

If you use LLVM-Tracer in your research, please cite:

ISA-Independent Workload Characterization and its Implications for Specialized
Architectures,
Yakun Sophia Shao and David Brooks,
Architectures,
Yakun Sophia Shao and David Brooks,
International Symposium on Performance Analysis of Systems and Software
(ISPASS), April 2013

Expand All @@ -20,15 +20,15 @@ Build:
------
1. Set `LLVM_HOME` to where you installed LLVM
Add LLVM and Clang binary to your PATH:

```
export $LLVM_HOME=/path/to/your/llvm/installation
export $PATH=$LLVM_HOME/bin:$PATH
export $LD_LIBRARY_PATH=$LLVM_HOME/lib/:$LD_LIBRARY_PATH
```
2. Go to where you put LLVM-Tracer source code
```
cd /path/to/LLVM-Tracer/full-trace/
make
Expand All @@ -39,52 +39,56 @@ Build:
Run:
------
After you build LLVM-Tracer, you can use example triad programs in the example
directory to test LLVM-Tracer.
directory to test LLVM-Tracer.
Example program: triad
----------------------
1. Go to /your/path/to/LLVM-Tracer/example/triad
2. Run LLVM-Tracer to generate a dynamic LLVM IR trace
a. LLVM-Tracer tracks regions of interest inside a program.
a. LLVM-Tracer tracks regions of interest inside a program.
In the triad example, we want to analyze the triad kernel instead of the setup
and initialization work done in main.
and initialization work done in main.
To tell LLVM-Tracer the functions we are
interested, set enviroment variable WORKLOAD to be the function names (if you
interested, set enviroment variable WORKLOAD to be the function names (if you
have multiple functions interested, separated by comma):
export WORKLOAD=triad
export WORKLOAD=md,md_kernel
b. Generate LLVM IR:
clang -g -O1 -S -fno-slp-vectorize -fno-vectorize -fno-unroll-loops -fno-inline -emit-llvm -o triad.llvm triad.c
c. Run LLVM-Tracer pass:
Before you run, make sure you already built LLVM-Tracer.
Before you run, make sure you already built LLVM-Tracer.
Set `$TRACER_HOME` to where you put LLVM-Tracer code.
export TRACER_HOME=/your/path/to/LLVM-Tracer
opt -S -load=$TRACER_HOME/full-trace/full_trace.so -full trace triad.llvm -o triad-opt.llvm
llvm-link -o full.llvm triad-opt.llvm $TRACER_HOME/profile-func/tracer_logger.llvm
d. Generate machine code:
llc -filetype=asm -o ful.s full.llvm
gcc -fno-inline -o triad-instrumented full.s
e. Run binary. It will generate a file called `dynamic_trace` under current directory.
./triad-instrumented
f. We provide a python script to run the above steps automatically for SHOC.
f. We provide a python script to run the above steps automatically for SHOC.
cd /your/path/to/LLVM-Tracer/triad
export TRACER_HOME=/your/path/to/LLVM-Tracer
python llvm_compile.py $TRACER_HOME/example/triad triad
---------------------------------------------------------------------------------
Emma Wang and Sophia Shao
Harvard University, 2014

0 comments on commit e230444

Please sign in to comment.