Open
Description
- Apparently, this is a typo in xray_profiling.cpp
which causing a bug, and xray-profiling mode is won't initilized correctly. use "xray_profiling" instead of "xray-profiling"

to reproduce, just run:
XRAY_OPTIONS="patch_premain=true xray_mode=xray-profiling ./sample
- other xray_mode, such as xray-basic, will also call
__xray_log_init_mode
automatically, but xray_profiling.cpp doesn't. I'm not sure if this is intentional or just a minor miss. but it is not consistent compare with other mode, which will cause confuse.
to overcome this, I had to call__xray_log_init_mode
in my main function.
extern "C" {
extern int __xray_log_init_mode(const char *Mode, const char *Config);
}
int main() {
if ( // xray_mode is xray-profiling) {
__xray_log_init_mode("xray-profiling", "");
}
}
- with those fix, I can generate the profiling output file, but seems current llvm/tools/llvm-xray is not able to decode the profiling output. I'm not sure is there any branch support it/developing on going. or I need write my own. thanks.