-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ctx_profile] Integration test #92456
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
Compile with clang a program that's instrumented for contextual profiling and verify a profile can be collected.
} | ||
} | ||
|
||
// CHECK: Guid: 11065787667334760794 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A dump drive-by question, I wonder if contextual profile contain block counters? If yes maybe check them as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! And the test is then more interesting, too. Ptal.
// CHECK: check 2 | ||
// CHECK: check 2 | ||
// CHECK: check odd | ||
// CHECK: check even |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if there is another check odd
line (corresponding to the 2nd iteration in the loop)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, tightened it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
||
// block inlining because the pre-inliner otherwise will inline this - it's | ||
// too small. | ||
__attribute__((noinline)) void the_root() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theRoot
to be consistent with someFunction
.
Hi @mtrofin, the test you added seems to be failing on a build bot: https://lab.llvm.org/buildbot/#/builders/247/builds/18559 Can you take a look? |
Sorry - was afk. Reverting. |
This reverts commit 487d5af. This was causing failures on some buildbots. https://lab.llvm.org/buildbot/#/builders/247/builds/18559
This reverts commit 881f20e. Passing -ldl -lpthread explicitly
This test fails for me, at least when doing a standalone build:
The library's at:
So I guess it's missing the suffix and/or |
Can you give more context - is this on a bot, or can you give me the cmake invocation - for example, if I do Thanks! |
This is a standalone build against installed LLVM + Clang. Once you install these two, the absolute minimum is roughly:
To get tests working, you'd also have to install the libraries onto the system. However, this is enough to reproduce the immediate problem. |
Using -DCOMPILER_RT_BUILD_CTX_PROFILE=OFF seems like the correct solution. That's working for me.
|
@mgorny on a clean debian bookworm docker image, with cmake 3.25.1, I did this: (monorepo)
this installed Could you share more details on how you build and install, they appear to be essential to being able to repro? Thanks! |
We are seeing the same cmake errors in our internal build where we set -DCOMPILER_RT_BUILD_SANITIZERS=OFF. Should we now be setting -DCOMPILER_RT_BUILD_CTX_PROFILE=OFF, or can the change be updated to work correctly when -DCOMPILER_RT_BUILD_SANITIZERS=OFF is defined? |
I guess you may need a proper multilib system (
I'm using Gentoo Linux amd64. It's literally |
I'm going to try to find a simpler reproducer. |
Thanks - I want to make sure I understand what substitutions to add (likely that's what I need to do in the lit.config.py) But! picking up from @dyung and @sscalpone's comments: if you are already doing |
Thanks for confirming. I can add the define to our build, but would greatly prefer if the build would check whether all of the required components are being built and only then enable it. |
Ok, could you try if you can reproduce if you do a monorepo build with:
( |
`__sanitizer_siginfo` has been introduced in D142117. (llvmorg-16-init-17950-ged9ef9b4f248) It is incompatible to -pedantic. `clang_rt.ctx_profile` has been introduced in #92456.
|
…3d19bf0f1 Local branch amd-gfx cbb3d19 Merged main:fe2ff54590c313551e7968179b48988ff0916290 into amd-gfx:57c0f5e83155 Remote branch main 881f20e Revert "[ctx_profile] Integration test (llvm#92456)"
…ld sanitizers are disabled llvm/llvm-project#92456 (comment) Fixes NixOS#329838
Compile with clang a program that's instrumented for contextual profiling and verify a profile can be collected.