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

Reset stats at detach time when linked statically #2964

Closed
mtrofin opened this issue Apr 25, 2018 · 2 comments
Closed

Reset stats at detach time when linked statically #2964

mtrofin opened this issue Apr 25, 2018 · 2 comments
Assignees

Comments

@mtrofin
Copy link
Contributor

mtrofin commented Apr 25, 2018

Otherwise, we continue from where we left off at re-attach time.

@derekbruening
Copy link
Contributor

To clarify, this is for use of DR as a static library: for the shared library a detach would unload the library and not need to explicitly reset anything. #2157 is the master issue for static-DR re-attach.

@derekbruening derekbruening changed the title Reset stats at detach time Reset stats at detach time when linked statically Nov 9, 2018
@derekbruening derekbruening self-assigned this Nov 9, 2018
derekbruening added a commit that referenced this issue Nov 9, 2018
For re-attach, DR's statistics were accumulating each time.  We now
zero them out at exit time, but only when detaching to avoid an
unnecessary performance hit from zeroing out this large structure.

Fixes #2964
@derekbruening
Copy link
Contributor

Measuring cost on 100-iter start;stop_and_cleanup loop:
Debug:

no memset:
$ for ((i=0; i<7; i++)); do DYNAMORIO_OPTIONS="-stderr_mask 0" /usr/bin/time suite/tests/bin/api.static_startstop; done
2.86user 1.33system 0:04.21elapsed 99%CPU (0avgtext+0avgdata 5492maxresident)k
2.98user 1.31system 0:04.31elapsed 99%CPU (0avgtext+0avgdata 5676maxresident)k
2.83user 1.36system 0:04.20elapsed 99%CPU (0avgtext+0avgdata 5508maxresident)k
2.81user 1.35system 0:04.17elapsed 99%CPU (0avgtext+0avgdata 5476maxresident)k
2.83user 1.36system 0:04.20elapsed 99%CPU (0avgtext+0avgdata 5520maxresident)k
2.81user 1.42system 0:04.24elapsed 99%CPU (0avgtext+0avgdata 5692maxresident)k
2.76user 1.42system 0:04.18elapsed 99%CPU (0avgtext+0avgdata 5636maxresident)k
memset:
$ for ((i=0; i<7; i++)); do DYNAMORIO_OPTIONS="-stderr_mask 0" /usr/bin/time suite/tests/bin/api.static_startstop; done
2.86user 1.42system 0:04.30elapsed 99%CPU (0avgtext+0avgdata 5604maxresident)k
2.88user 1.37system 0:04.26elapsed 99%CPU (0avgtext+0avgdata 5620maxresident)k
2.92user 1.29system 0:04.22elapsed 99%CPU (0avgtext+0avgdata 5468maxresident)k
2.90user 1.33system 0:04.23elapsed 99%CPU (0avgtext+0avgdata 5400maxresident)k
2.86user 1.33system 0:04.20elapsed 99%CPU (0avgtext+0avgdata 5552maxresident)k
2.75user 1.38system 0:04.13elapsed 99%CPU (0avgtext+0avgdata 5576maxresident)k
2.80user 1.36system 0:04.16elapsed 100%CPU (0avgtext+0avgdata 5476maxresident)k

Release:

no memset:
$ for ((i=0; i<7; i++)); do DYNAMORIO_OPTIONS="-stderr_mask 0" /usr/bin/time suite/tests/bin/api.static_startstop; done
0.73user 0.35system 0:01.11elapsed 98%CPU (0avgtext+0avgdata 3572maxresident)k
0.75user 0.32system 0:01.08elapsed 99%CPU (0avgtext+0avgdata 3496maxresident)k
0.73user 0.36system 0:01.09elapsed 100%CPU (0avgtext+0avgdata 3504maxresident)k
0.74user 0.34system 0:01.08elapsed 99%CPU (0avgtext+0avgdata 3472maxresident)k
0.77user 0.31system 0:01.08elapsed 100%CPU (0avgtext+0avgdata 3544maxresident)k
0.78user 0.30system 0:01.08elapsed 99%CPU (0avgtext+0avgdata 3500maxresident)k
0.73user 0.35system 0:01.09elapsed 99%CPU (0avgtext+0avgdata 3532maxresident)k
memset:
$ for ((i=0; i<7; i++)); do DYNAMORIO_OPTIONS="-stderr_mask 0" /usr/bin/time suite/tests/bin/api.static_startstop; done
0.77user 0.31system 0:01.10elapsed 98%CPU (0avgtext+0avgdata 3460maxresident)k
0.77user 0.31system 0:01.08elapsed 99%CPU (0avgtext+0avgdata 3480maxresident)k
0.78user 0.30system 0:01.08elapsed 100%CPU (0avgtext+0avgdata 3552maxresident)k
0.75user 0.38system 0:01.13elapsed 99%CPU (0avgtext+0avgdata 3532maxresident)k
0.81user 0.31system 0:01.13elapsed 99%CPU (0avgtext+0avgdata 3536maxresident)k
0.77user 0.31system 0:01.09elapsed 99%CPU (0avgtext+0avgdata 3532maxresident)k
0.80user 0.33system 0:01.13elapsed 99%CPU (0avgtext+0avgdata 3560maxresident)k

Maybe there is a measurable slowdown. But there's a bunch of noise (didn't exactly put a lot of effort into this measurement: didn't disable freq scaling; there's background stuff on the machine; etc.). I can live with it.

derekbruening added a commit that referenced this issue Nov 9, 2018
For re-attach, DR's statistics were accumulating each time.  We now
zero them out at exit time, but only when detaching to avoid an
unnecessary performance hit from zeroing out this large structure.

Fixes #2964
derekbruening added a commit that referenced this issue Mar 10, 2022
Adds diagnostics and fixes related to running out of memory with
drmemtrace now using drbbdup:

Augments the beyond-vmm diagnostics to dump the rstats and print the
allocation type.

Makes a beyond-vmm event non-fatal for -satisfy_w_xor_x for vmheap.

Resets a global drbbdup variable for reattach.

Removes a conditional for static_prepop that is not needed now that
stats are reset on reattach (#2964).

Issue: #2964
derekbruening added a commit that referenced this issue Mar 10, 2022
Adds diagnostics and fixes related to running out of memory with
drmemtrace now using drbbdup:

Augments the beyond-vmm diagnostics to dump the rstats and print the
allocation type.

Makes a beyond-vmm event non-fatal for -satisfy_w_xor_x for vmheap.

Resets a global drbbdup variable for reattach.

Removes a conditional for static_prepop that is not needed now that
stats are reset on reattach (#2964).

Issue: #2964
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

No branches or pull requests

2 participants