Skip to content

__xray_log_select_mode typo and deserialize tool #88761

Open
@yunhuali

Description

@yunhuali
  1. 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"
Screen Shot 2024-04-15 at 9 22 39 AM

to reproduce, just run:
XRAY_OPTIONS="patch_premain=true xray_mode=xray-profiling ./sample

  1. 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", "");
   }
}
  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions