{"action":"created","issue":{"url":"https://api.github.com/repos/namhyung/uftrace/issues/36","repository_url":"https://api.github.com/repos/namhyung/uftrace","labels_url":"https://api.github.com/repos/namhyung/uftrace/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/namhyung/uftrace/issues/36/comments","events_url":"https://api.github.com/repos/namhyung/uftrace/issues/36/events","html_url":"https://github.com/namhyung/uftrace/issues/36","id":192733312,"number":36,"title":"Getting source line number with --symbol-with-addr option","user":{"login":"honggyukim","id":19642328,"avatar_url":"https://avatars.githubusercontent.com/u/19642328?v=3","gravatar_id":"","url":"https://api.github.com/users/honggyukim","html_url":"https://github.com/honggyukim","followers_url":"https://api.github.com/users/honggyukim/followers","following_url":"https://api.github.com/users/honggyukim/following{/other_user}","gists_url":"https://api.github.com/users/honggyukim/gists{/gist_id}","starred_url":"https://api.github.com/users/honggyukim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honggyukim/subscriptions","organizations_url":"https://api.github.com/users/honggyukim/orgs","repos_url":"https://api.github.com/users/honggyukim/repos","events_url":"https://api.github.com/users/honggyukim/events{/privacy}","received_events_url":"https://api.github.com/users/honggyukim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-12-01T01:47:39Z","updated_at":"2016-12-12T04:19:07Z","closed_at":null,"body":"Sometimes it'd be better to see information of source line numbers to understand the exact locations of the functions during replay, report, and graph commands.  To clearly address this issue, we may have to support libdwarf but I think we can go to a simpler way by just showing address with each symbol.\r\n\r\nSo why don't we add an option named `--symbol-with-addr` to show address with symbol. For example, the replay output looks like this.\r\n```\r\n$ uftrace replay --symbol-with-addr\r\n# DURATION    TID     FUNCTION\r\n   0.587 us [12264] | <400a90> __cxa_atexit();\r\n            [12264] | <400e15> main() {\r\n  30.911 us [12264] |   <400dd7> __static_initialization_and_destruction_0();\r\n  31.037 us [12264] | } /* <400e15> main */\r\n            [12264] | <400ca2> main() {\r\n   0.627 us [12264] |   <400e4e> std::vector::vector();\r\n   0.030 us [12264] |   <400ed8> __gnu_cxx::__normal_iterator::__normal_iterator();\r\n   7.651 us [12264] |   <400ef6> std::vector::push_back();\r\n    ...\r\n```\r\n\r\nIn this case, we can see the source line number by using addr2line with the address above. If we want to see the location of `std::vector::push_back`, we can find it as follows.\r\n```\r\n$ addr2line -e a.out 400ef6\r\n/usr/include/c++/4.8/bits/stl_vector.h:901\r\n```"},"comment":{"url":"https://api.github.com/repos/namhyung/uftrace/issues/comments/266339987","html_url":"https://github.com/namhyung/uftrace/issues/36#issuecomment-266339987","issue_url":"https://api.github.com/repos/namhyung/uftrace/issues/36","id":266339987,"user":{"login":"honggyukim","id":19642328,"avatar_url":"https://avatars.githubusercontent.com/u/19642328?v=3","gravatar_id":"","url":"https://api.github.com/users/honggyukim","html_url":"https://github.com/honggyukim","followers_url":"https://api.github.com/users/honggyukim/followers","following_url":"https://api.github.com/users/honggyukim/following{/other_user}","gists_url":"https://api.github.com/users/honggyukim/gists{/gist_id}","starred_url":"https://api.github.com/users/honggyukim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honggyukim/subscriptions","organizations_url":"https://api.github.com/users/honggyukim/orgs","repos_url":"https://api.github.com/users/honggyukim/repos","events_url":"https://api.github.com/users/honggyukim/events{/privacy}","received_events_url":"https://api.github.com/users/honggyukim/received_events","type":"User","site_admin":false},"created_at":"2016-12-12T04:19:07Z","updated_at":"2016-12-12T04:19:07Z","body":"As I mentioned, the graph output is a bit broken.\r\n```\r\ncalling functions\r\n================================\r\n178.338 ms : (1) main\r\n 96.008 us :  +-(1) v8::Shell::SetOptions\r\n            :  |\r\n450.341 us :  +-(1) v8::platform::CreateDefaultPlatform\r\n            :  |\r\n300.587 us :  +-(1) v8::V8::Initialize\r\n            :  |\r\n404.112 us :  +-(1) v8::internal::_GLOBAL__N_1::LoadFromFiles\r\n402.737 us :  | (2) v8::internal::_GLOBAL__N_1::Load\r\n```"}}
{"actor":{"display_login":"honggyukim"}}