What does the suffix "f" mean in the C ++ library name and how to load it?

I am using gperftools v2.3rc and would like to use the improved thread profiling feature. The release notes indicate:

Linux's new cpu profiling mode is now implemented. It sets separate profiling timers for individual threads .... [It] is enabled if both librt.f and the environment variable CPUPROFILE_PER_THREAD_TIMERS are loaded ....

My C ++ application is linked to librt.so (-lrt is the Realtime Extensions POSIX.1b library), but I haven't heard about the library with the .f extension yet. What does .f mean, where can I find this library and how to load it in my application?

+5
source share
1 answer

I suspect that temporary arthritis is caused by a lack of coffee (this is a typo). It's about librt.so. From the middle of src/profile-handler.cc :

 // We use weak alias to timer_create to avoid runtime dependency on // -lrt and in turn -lpthread. // // At runtime we detect if timer_create is available and if so we // can enable linux-sigev-thread mode of profiling 

and further in the code:

 #if HAVE_LINUX_SIGEV_THREAD_ID if (getenv("CPUPROFILE_PER_THREAD_TIMERS")) { if (timer_create && pthread_once) { // <-- note this bit here. timer_sharing_ = TIMERS_SEPARATE; CreateThreadTimerKey(&thread_timer_key); per_thread_timer_enabled_ = true; } else { RAW_LOG(INFO, "Not enabling linux-per-thread-timers mode due to lack of timer_create." " Preload or link to librt.so for this to work"); } } #endif 

It checks if envvar is installed and librite is loaded. This is about librt.so.

+5
source

Source: https://habr.com/ru/post/1208367/


All Articles