Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#4083 func trace: Add func_view tool #4150

Merged
merged 5 commits into from
Mar 4, 2020
Merged

Conversation

derekbruening
Copy link
Contributor

Adds a new func_view tool for visualizing and analyzing function calls
recorded in a drcachesim trace. It does two things in its initial
form: it reports the summary count of calls and returns for every
function traced, and if a new option op_show_func_trace is set (on by
default), it prints a linear sequence of every call and return with
return addresses, argument values, and return values. Each is
indented to enable a clear picture of the call sequence.

Adds a new option op_funclist_file to specify the file's path, though
normally it will be auto-found.

Adds raw2trace_directory_t support for parsing the funclist file.

Adds example output for the new tool to the docs. Adds a brief
section to the docs on function tracing in general, which was
previously missing.

Adds a func_view test which runs fib(5) and ensures we get the nested
function trace correct.

Fixes #4083

Adds a new func_view tool for visualizing and analyzing function calls
recorded in a drcachesim trace.  It does two things in its initial
form: it reports the summary count of calls and returns for every
function traced, and if a new option op_show_func_trace is set (on by
default), it prints a linear sequence of every call and return with
return addresses, argument values, and return values.  Each is
indented to enable a clear picture of the call sequence.

Adds a new option op_funclist_file to specify the file's path, though
normally it will be auto-found.

Adds raw2trace_directory_t support for parsing the funclist file.

Adds example output for the new tool to the docs.  Adds a brief
section to the docs on function tracing in general, which was
previously missing.

Adds a func_view test which runs fib(5) and ensures we get the nested
function trace correct.

Fixes #4083
@derekbruening derekbruening requested a review from s-kanev March 3, 2020 01:32
clients/drcachesim/tools/func_view.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tools/func_view.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tools/func_view.h Show resolved Hide resolved
clients/drcachesim/tools/func_view.cpp Outdated Show resolved Hide resolved
@derekbruening
Copy link
Contributor Author

Well I got the test to pass on my local Windows machine, but on Appveyor it is hitting a mysterious crash with no further information:

[00:24:03] 205: Running postcmd |C:/projects/dynamorio/build/build_debug-internal-64/clients/bin64/drcachesim.exe;-indir;C:/projects/dynamorio/build/build_debug-internal-64/suite/tests/tool.drcacheoff.func_view.common.fib.exe.07132.7209.dir;-simulator_type;func_view|
[00:24:03] 205: CMake Error at C:/projects/dynamorio/suite/tests/runmulti.cmake:106 (message):
[00:24:03] 205:   *** postcmd failed (Access violation): ***
[00:24:03] 205: 
[00:24:03] 205: Call Stack (most recent call first):
[00:24:03] 205:   C:/projects/dynamorio/suite/tests/runmulti.cmake:118 (process_cmdline)
[00:24:03] 205: 
[00:24:03] 205: 
[00:24:03] 205/239 Test #205: code_api|tool.drcacheoff.func_view ...........................***Failed   14.80 sec

A crash is disturbing. But If I can't reproduce I will probably have to disable the test on Windows and put this PR in and consider the crash separately.

@derekbruening
Copy link
Contributor Author

Hmm, Mac is starting to have strange results. Twice now the log is truncated, but there's no timeout message, and the time is not some even number.

@derekbruening
Copy link
Contributor Author

A64 is #3742 threadexit2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add drcachesim function trace viewing tool
2 participants