Analysis on execution trace

Hi list,

I am trying to make an analysis for one execution trace (not whole program) based on LLVM. I am very new to LLVM, so it would be appreciated if I get some comments from you.
Given a program (whole source code) and a crashing input, what I want to do is
1) run the program with the input
2) extract the buggy trace
3) do simple analysis on the trace

Is there any tool to extract such a trace (e.g., a list of LLVM instructions) so that I could write a LLVM bit code analyzer?

Thanks,
Kihong