Post not yet marked as solved
Hello,
I'am trying to analyse a hang with our App and asked the customer to do a ktrace artrace ("sudo ktrace artrace") on his system. The problem is that the macOS symbols are missing when I open the trace with Instruments on my system. the customer is running macOS 11.6.1, I'am running macOS 12.0.1.
I asked the customer to do a
sudo ktrace symbolicate
but that does not help.
This is a very important workflow for me to analyse sluggishness and hangs on systems, any help is welcome! :-)
Post not yet marked as solved
Hello,
the following code behaves different in debug and release mode. The debug output is correct while in release mode it seems that there is no integer overflow and instead the value is calculated with a 64 bit value.
@ Apple: can you confirm it?
#include <iostream>
#include <string>
//------------------------------------------------------------------------
int main ()
{
signed long long checkSum {14120563136728876};
int i = 23342251;
std::string theString {"\\"};
// one ch is working, one is not
// compare by using the first one or the second one
// unsigned char ch {0b01011100}; // 92
unsigned char ch = theString[0]; // 92
checkSum += (int)ch * (i + 1); // different result in Debug and Release Mode
std::cout << checkSum << "\n";
return 0;
}
Post not yet marked as solved
Once I symbolicated a trace in Instruments with a dsym file it magically woks forever. Even when I delete the dlsym file new traces are symbolicated. How can I avoid that? Where is the data cached?
Any help is appreciated!
Thanks,
Eric
Post not yet marked as solved
Hello,we use xcodebuild to build our C++ project. It would be so great to log the time needed for each translation unit (cpp file) to compile. When compiling the project in Xcode 10 I can see on the UI how long it took for each translation unit to compile (Report Navigator). Is there a way to output these times with xcodebuild? I know that there is the -showBuildTimingSummary option, but it seems it only reports the total time of the build phases.Have a nice day and thanks,Erich
Hello,perhaps someone can help me with the following question :-)I have set some Points Of Interests in the startup phase of our application:kdebug_signpost_start (0, 0, 0, 0, 0);// some work is donekdebug_signpost_end (0, 0, 0, 0, 0);...kdebug_signpost_start (1, 0, 0, 0, 0);// some other work is donekdebug_signpost_end (1, 0, 0, 0, 0);...What I would like to do is run this special build on some systems without having to install Xcode and Instruments, profile the startup time and get the data back.What would be perfect is if I could import that data into Instruments and analyse it there ;-)I just need the information for our application process, not the whole system. And the profiling should run at least as long as the startup of the application.Any ideas?Thanks!
Post not yet marked as solved
Hello,I have a question regarding NRVO://------------------------------------------------------------------------
Object returnValueOptimization ()
{
Object object;
// . . .
return object; // copy elision
}
//------------------------------------------------------------------------
int main ()
{
auto returnValue = returnValueOptimization (); // copy elision
return 0;
}When I run the code in debug mode in Xcode there is only one constructor call of the class Object - great!Now lets assume there is a bug in the code between the first and the last line of the returnValueOptimization () method. It’s a quick fix and the developer did not recognize that this method was written with NRVO in mind. After his fix the code looks like this://------------------------------------------------------------------------
Object returnValueOptimization ()
{
Object object;
// . . .
if (!isProjectValid)
return Object ();
// . . .
return object;
}
//------------------------------------------------------------------------
int main ()
{
auto returnValue = returnValueOptimization (); // copy elision
return 0;
}Now I have a constructor and a copy constructor call when isProjectValid == false! When no automated performance tests are written for this code area the chances are high that the problem will occur one day during beta testing (or even worse, the customer will recognize it) when reports come in that a particular area of the software is no longer responsive when lots of data is processed.So my questions is: is there any chance to check if clang is using NRVO? It would be even better if developers can „tag“ their methods as „NRVO method“ and will get a compiler warning if NRVO is not possible.Any ideas? Tips? Tricks? What are the exact rules for clang with NRVO?Thanks!Erich