<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/66048>66048</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            llvm-xray doesn't print logs on apple m1
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          csmoe
      </td>
    </tr>
</table>

<pre>
    llvm version: 17.0.0-rc3

code:
```cpp
#include <cstdio>

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

int main() {
 foo();
}
```
clang++ commands:
```shell
 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:
```shell
 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):
```shell
foo() is always instrumented!
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVEGPozgT_TXFpQQCO4RwyKHTfJFGan2zmhmtZk-RMUXwrmMjbDqdf7-yYTq96p7dkaLIlF3Pr149l3BOnQ3RHsoDlE0iZj_YaS_dxVLS2u621_r5gs80OWUN8AcsqizP8nSSHPIG8oflX9qOgK8fsM2XnxzHNcK4MlLPHSHwR-l8pyzw_71FiAQOUgtzDkD84WUSt5PQV3FzJ2Wcn-YLGQ9lA2WDz1Z12FsLbAesRqgOCwqOkzK-j2F231cOFyS8I1EHrADGgNXA13SomreclPF4Ecq8u-UV-YPMH8WvwsSC2AHYAaW9XITp3Huh3EBar9hBcGDHNlx7fJue9kGS9F7BPyPSK2tSP0zkBqs74E2BqfNhIReEosJUuZubrPUIbANs9yKn2WCausFeU9f9lY7CD6HW9OkHEa3aO5FjUb2GOjFdlUFPzmdSYmrjEj-UgV5Izp7wqvyAgTTaMfD9Dy2-f3n44_T5t2-fPv__K_AGGIuuMEI900nbM_DGTzPhKLwcTuNEsVtrMB69RGM2rXBKBhu31il_C-IAY5gBOwbSP-E8kvTUoR8I7ezH2aM1-KTM_PKe9vrJG-BNxTZVtSy_fxG38Gye7Bl7pQmVQWBV7Ju25yyqVz1-_b0sgFU_AXnUJAx1OI-oA46d8NunJsAuh2LWr7g9Hsyy7EPuQvpZ6LVSYDtjl04FnYPT_6VRv3z3a3LS7XlX81oktC-29abM8y3fJcO-L6ti21aS6ryTXMg65z3fEfVyw0S9KxK1ZznjeV2wfMuroshKkiIv-2rTF3ldlS1s8uADnQUDZ3Y6J8q5mfbbbb7ZJVq0pF2cd4wZumLcDHOgbJIpjru0nc8ONrlWzrs7ilde03Ig6tJZcgZY5ZehE3RywSBiHDXhpUjmSe8H78docnYEdjwrP8xtJm18WOv7CoDjZP8k6YEdIx0H7Bjp_h0AAP__MNqpqg">