Skip to content

llvm-xray doesn't print logs on apple m1 #66048

Open
@csmoe

Description

@csmoe

llvm version: 17.0.0-rc3

code:

#include <cstdio>

[[clang::xray_always_instrument]] void foo() {
  printf("foo() is always instrumented!");
}

int main() {
  foo();
}

clang++ commands:

 llvm/bin/clang++ -fxray-instrument -fxray-instruction-threshold=1 -std=c++17 -isysroot $(xcrun --show-sdk-path) -L llvm/lib/clang/17/lib/darwin test.cc -o test 

execute with xray options:

 XRAY_OPTIONS="xray_naive_log=true patch_premain=true xray_mode=basic verbosity=1" ./test

expected the output on Linux:

==72477==XRay: Log file in 'xray-log.test.7CSV51'
==72477==Cleaned up log for TID: 72477
foo() is always instrumented!
...

actual output(no xray log):

foo() is always instrumented!

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particularplatform:macosxray

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions