1

stapプログラムが呼び出すすべての関数を出力するために使用しようとしています。私はオンラインでいくつかの調査を行い、このスクリプト(と呼ばれるpara-callgraph.stp)を見つけました:

#! /usr/bin/env stap

function trace(entry_p, extra) {
  printf("%s%s%s %s\n",
         thread_indent (entry_p),
         (entry_p>0?"->":"<-"),
         ppfunc (),
         extra)
}

probe $1.call   { trace(1, $$parms) }
probe $1.return { trace(-1, $$return) }

これは次のように実行することを意図しています:

sudo stap para-callgraph.stp 'process.function("*")' -c `pwd`/my-program

これを実行すると、問題が発生します。最初はすべて正常に動作しますが、すぐにsystemtapこれを stderr に出力して終了します。

ERROR: probe overhead exceeded threshold
WARNING: Number of errors: 1, skipped probes: 0
WARNING: There were 62469 transport failures.
WARNING: /usr/bin/staprun exited with status: 1
Pass 5: run failed.  [man error::pass5]
Tip: /usr/share/doc/systemtap/README.Debian should help you get started.

オンラインでいくつかの調査を行ったところ、stapヒューリスティックがトリガーされてシャットダウンされていることがわかりました.2つのフラグ-g--suppress-time-limits. (この提案は私のシステムでバックアップされman stapています。)ただし、その解決策は単に機能せず、コマンドは次のとおりです。

sudo stap -g --suppress-time-limits para-callgraph.stp 'process.function("*")' -c `pwd`/core-cpu1

非常によく似たエラー メッセージを出力し、終了します。

ERROR: probe overhead exceeded threshold
WARNING: Number of errors: 1, skipped probes: 0
WARNING: There were 67287 transport failures.
WARNING: /usr/bin/staprun exited with status: 1
Pass 5: run failed.  [man error::pass5]
Tip: /usr/share/doc/systemtap/README.Debian should help you get started.

このフラグが私の問題に対する適切な解決策ではないのはなぜですか? また、この問題は別の方法で解決できますか?それとも、systemtap はこの種のユースケースには適していませんか?

問題があれば、これを 32 ビットの Ubuntu VM で実行しています。

注意: systemtap がここで失敗する理由に最も関心があります。他のソフトウェアを使用して同じことを達成する他の方法ではありません。(実際、私の使用例では、上記のコードsystemtap の悪用であることが判明しました。)

4

1 に答える 1