We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following does not get profiled correctly, only one of the two functions are getting reported.
#include <vector> #include <thread> #include <unistd.h> void myfunctionA() { int a = 0; for (int i = 0; i < 100000000; i++) for (int j = 0; j < 20; j++) a = a * 2 / 5 * 10; } void myfunctionB() { int a = 0; for (int i = 0; i < 100000000; i++) for (int j = 0; j < 20; j++) a = a * 2 / 5 * 10; } int main() { std::vector<std::thread> threads; int num_threads = 2; for (int i = 0; i < num_threads; ++i) { auto f = [](int j) { if (j==0) { printf("A\n"); myfunctionA(); } else { printf("B\n"); myfunctionB(); } }; threads.emplace_back(f,i); } for(auto& thread: threads) { thread.join(); } return 0; }
This is just a placeholder for further discussion if anyone has time to look into this (I don't at the moment). @dpiparo
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following does not get profiled correctly, only one of the two functions are getting reported.
This is just a placeholder for further discussion if anyone has time to look into this (I don't at the moment).
@dpiparo
The text was updated successfully, but these errors were encountered: