void __cyg_profile_func_enter (void *this_fn, void *call_site); void __cyg_profile_func_exit (void *this_fn, void *call_site);
先來個 example 試試看:
#includevoid __attribute__((__no_instrument_function__)) __cyg_profile_func_enter(void *this_func, void *call_site) { printf("Enter &%s:%p, called by %p \n", __FUNCTION__, this_func, call_site); } void __attribute__((__no_instrument_function__)) __cyg_profile_func_exit(void *this_func, void *call_site) { printf("Enter &%s:%p, called by %p \n", __FUNCTION__, this_func, call_site); } void a(void); void b(void); void b() { } void a() { b(); } int main(int argc, const char *argv[]) { a(); return 0; }
利用 j 的 Dot 語法,可以簡單的畫出 directed graph 語言感覺很像以前讀研究所時,寫 network simulation的腳本
digraph G { node1; node2; node3; node1 -> node2 [label="edge_1_2"]; node1 -> node3 [label="edge_1_3"]; node2 -> node3 [label="edge_2_3"]; }
Conver to JPG:
dot -Tjpg graph.dot -o graph.jpg產生出來的圖
reference:
http://tarot.freeshell.org/leafpad/
http://blog.linux.org.tw/~jserv/archives/001870.html
http://www.ibm.com/developerworks/cn/linux/l-graphvis/
http://blog.linux.org.tw/~jserv/archives/001723.html
No comments:
Post a Comment