harvard-acc / LLVM-Tracer

An LLVM pass to profile dynamic LLVM IR instructions and runtime values
Other
135 stars 35 forks source link

Supports mangled name as workload string #3

Closed rgly closed 9 years ago

rgly commented 9 years ago

Hi, I make some minor patches. Most of patches are just for legibility and the following description is for the "Supports mangled name as workload string" patch.

Overview

In C++, every function has it's original name and mangled name. The original design prefer using original names. Using original names may lead name collision when two functions use the same name in different classes/namespaces.

I try to make LLVM-Tracer works with mangled names. Using mangled names can avoid function name collisions. Users can choose to input either pre-mangled or mangled names as workload string.

The Original Design

mangled names -> original names

  1. makes a mangled to pre-mangled name table
  2. try to translate every function name to original names
  3. dump dynamic_trace.gz using original names

    The New Design

original names -> mangled names

  1. convert user-given workload to mangled names

    if user gives "process", both A::process and B::process hits
    if mangled names not exist, use original ones(for C code)
  2. dump dyn_trace.gz using mangled names

    if mangled names not exist, use original ones(for C code)