0

gperftools-2.0 をインストールしましたが、CPU プロファイル統計を取得できません

以下は、統計を取得するための私の手順です。

  1. gperftools tar -xzvfj gperftools-2.0.tar.gz をインストールします。

2.cppファイルtest.cppを編集

#include <stdio.h>
#include <gperftools/profiler.h>

int main()
{
        ProfilerStart("test.prof");

        for (int i = 0; i<100; i++)
        {
                printf("hello world!");
        }

        ProfilerStop();

        return 0;
}
  1. g++ test.cpp をコンパイル -o テスト -O0 -I/usr/local/include/ -L/usr/local/lib/ -lprofiler

  2. 実行./テスト

  3. レポート pprof ./test --text test.prof

その出力は: Using local file ./test. ローカル ファイル test.prof を使用します。

私の手順で何が問題になっていますか?

4

1 に答える 1