こんなソフト無いですか? in Linux板 (8th)at LINUX
こんなソフト無いですか? in Linux板 (8th) - 暇つぶし2ch552:login:Penguin
07/09/10 22:48:15 5JM4Hlqf
>> 546
再コンパイルなら以下。再コンパイルしたくないならしらん。
--- preload.c ---
#include <stdio.h>

void __attribute__((no_instrument_function)) __cyg_profile_func_enter(void *this, void *callsite)
{
printf("+ [%p]\n", this);
}

void __attribute__((no_instrument_function)) __cyg_profile_func_exit(void *this, void *callsite)
{
printf("- [%p]\n", this);
}
--------------
(1) LD_PRELOAD用の共有ファイル作る。
$ gcc -shared -fPIC -Wall -o libpreload.so preload.c
(2)トレースしたいバイナリを-finstrument-functionsつきでコンパイルしとく。
(3)トレースとる。
$ LD_PRELOAD=./preload.so target_binary


次ページ
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch