mirror of
https://github.com/KjellKod/g3log.git
synced 2024-12-12 18:30:25 +01:00
removed warnings, a performance compilation error (erroneous comment)
This commit is contained in:
parent
121f8d0e2d
commit
92d45631de
@ -31,26 +31,13 @@ void crashHandler(int signal_number, siginfo_t *info, void *unused_context)
|
||||
const size_t max_dump_size = 50;
|
||||
void* dump[max_dump_size];
|
||||
size_t size = backtrace(dump, max_dump_size);
|
||||
// overwrite sigaction with caller's address
|
||||
char** messages = backtrace_symbols(dump, size);
|
||||
char** messages = backtrace_symbols(dump, size); // overwrite sigaction with caller's address
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << "Received fatal signal: " << g2::internal::signalName(signal_number);
|
||||
oss << "(" << signal_number << ")" << std::endl;
|
||||
oss << "\tPID: " << getpid() << std::endl;
|
||||
|
||||
// Below is gcc specific demangling done. Just dumping the stack could be done with
|
||||
//for(size_t idx = 1; idx < size && messages != nullptr; ++idx) // skip first frame, since that is here
|
||||
//{
|
||||
// oss << "\tstack dump [" << idx << "] " << messages[idx] << std::endl;
|
||||
//}
|
||||
// HOWEVER - thiw would give mangled symbols in the dump:
|
||||
//./g2log-example(_ZN5__jss5__X469__invokerIvMN8kjellkod6ActiveEFvvEIPS3_EEclEv+0x24) [0x80630e0]
|
||||
//
|
||||
// Using the GCC abi demangle the mangled symbols will be 'demangled':
|
||||
// ./g2log-example : g2::internal::LogMessage::messageSave(char const*, ...)+0x3a [0x805f3dc]
|
||||
//
|
||||
//
|
||||
// dump stack: skip first frame, since that is here
|
||||
for(size_t idx = 1; idx < size && messages != nullptr; ++idx)
|
||||
{
|
||||
@ -97,9 +84,9 @@ void crashHandler(int signal_number, siginfo_t *info, void *unused_context)
|
||||
}
|
||||
free(real_name); // mallocated by abi::__cxa_demangle(...)
|
||||
}
|
||||
// no demangling done -- just dump the whole line
|
||||
else
|
||||
{
|
||||
// no demangling done -- just dump the whole line
|
||||
oss << "\tstack dump [" << idx << "] " << messages[idx] << std::endl;
|
||||
}
|
||||
} // END: for(size_t idx = 1; idx < size && messages != nullptr; ++idx)
|
||||
|
@ -137,7 +137,7 @@ int main(int argc, char** argv)
|
||||
delete [] threads_result; // finally get rid of them
|
||||
|
||||
std::sort (all_measurements.begin(), all_measurements.end());
|
||||
std::map<size_t, size_t> value_amounts;
|
||||
std::map<long long, long long> value_amounts;
|
||||
// for(long long& idx : all_measurements) --- didn't work?!
|
||||
for(auto iter = all_measurements.begin(); iter != all_measurements.end(); ++iter)
|
||||
{
|
||||
|
@ -3,8 +3,6 @@
|
||||
* with no warranties. This code is yours to share, use and modify with no
|
||||
* strings attached and no restrictions or obligations.
|
||||
* ============================================================================*/
|
||||
* ********************************************* */
|
||||
|
||||
#ifndef PERFORMANCE_G2_TEST_H_
|
||||
#define PERFORMANCE_G2_TEST_H_
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user