繁体   English   中英

C ++库名称上的“ f”后缀是什么意思,如何加载?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM