[英]What does 'f' suffix mean on a C++ library name and how do I load it?
我正在使用gperftools v2.3rc,並希望使用改進的線程分析功能。 發行說明部分說明:
現在在Linux上實現了新的cpu分析模式。 它為單獨的線程設置了單獨的配置計時器。 ... [它]是如果兩個librt.f被加載並CPUPROFILE_PER_THREAD_TIMERS環境變量設置為啟用。 ...
我的C ++應用程序與librt.so(-lrt-POSIX.1b實時擴展庫)鏈接,但是我之前從未聽說過帶有.f后綴的庫。 .f是什么意思,在哪里可以找到該庫,以及如何在應用程序中加載它?
我懷疑由於喝咖啡而引起的暫時性關節炎(這是錯字)。 意思是librt.so。 從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
在代碼中進一步:
#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
它正在檢查是否設置了envvar並已加載librt。 關於librt.so。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.