Comments (10)
It's easy to collect counts of the number of syscalls by reading the rr trace files, especially for non-wrapped syscalls which are recorded in ASCII.
from rr.
- futex
As a note for posterity, glibc directly invokes futex; there's no unresolved symbol we can preload on top of. So we can't buffer it with our current approach. Shame.
from rr.
Any idea which symbols/how many symbols we'd need to override via LD_PRELOAD to catch most futex traffic?
from rr.
I would guess that pthread_mutex_{lock, unlock} and cond_wait would get us the vast vast majority. Doing that is a little scary and nontrivial though. But it's relatively easy to quantify how worth doing it would be once we have the structure in place.
from rr.
There are two measures that are interesting here: first is raw syscall count, which is easy to measure. The second is syscalls that "break the chain". For example, if gettimeofday
is one of the top syscalls, we should buffer it, but if 1/3 of the time it's followed by stat
say, then the buffering won't be as effective. We'd want to buffer stat
too.
from rr.
On a small representative Firefox workflow, histogram-trace says the top 10 are
syscall count ------- ----- 78 145704 (gettimeofday) 265 128062 (clock_gettime) 240 31596 (futex) 102 28834 (socketcall) 168 19642 (poll) 3 18464 (read) 219 9700 (madvise???) 4 7446 (write) 221 7016 (fcntl64) 5 6694 (open) ...
This pretty much matches historical data. Unfortunately futex
and socketcall
are giant pains in the butt to support, but looks like we'll want to. The rest are trivial though.
from rr.
219 9700 (madvise???)
This seems to be coming from a *Monkey [1] JIT. So not so surprising.
[1] I just realized I don't know what monkey FF is on anymore! sniffle
from rr.
The desched event, which was working so well in early testing, ain't doing so well with FF. I added wrappers for the easy syscalls above (futex, socketcall, and fcntl are hard), and FF blows up. However, when I was able to get a run that avoided the landmines, FF recorded about 10% faster just from wrapping poll
(loading the start page). That's good news.
The wrapper for open
also doesn't seem to be working all the time. rr ends up processing a significant number of open
syscalls, even though we do sometimes hit the open
wrapper, and the buffer isn't full. Needs investigation. However, even without wrapping all the open calls, FF is about 5% faster with the wrapper. That's also great news.
from rr.
The desched event turned out to still be working just fine, only a recent commit regressed it embarrassingly. I guess that's what happens when effectively dead code is committed. The basic syscalls above, sans poll
too now, are working. Just needs some cleanup before commit. poll
is proving to be a bit of a pain, and the work here is starting to pile up, so splitting that out into a followup.
from rr.
Testing shows that close
and writev
might be worth buffering. The latter is used by xlib, IIRC.
from rr.
Related Issues (20)
- Divergence with tcmalloc on arm64 HOT 2
- Assertion 'stopped_or_unexpected_exit()' failed to hold. HOT 7
- x86/x87env failures HOT 3
- rr replay segfaults during a first (and only) command `continue` HOT 17
- [FATAL src/PerfCounters.cc:332:start_counter() errno: ESRCH] Failed to initialize counter HOT 3
- Please tag/ship a new release HOT 2
- Improve non-interactive debugging HOT 1
- [RFE] Print tracee's stack when `ASSERT()` fails HOT 1
- can rr detect the nullptr dereference at int z=*g ? HOT 1
- Zen CPU Detection regression HOT 1
- Intel CPU type 0xa06a0 unknown HOT 11
- replaying backwards into an executable mmaped region causes rr to crash HOT 1
- Cannot set watchpoint on numerically entered address HOT 4
- "delete checkpoint x" can crash rr replay
- Extract a ptrace framework HOT 3
- How to debug python extensions HOT 4
- rr crashes intermittently in `alternate_thread_diversion-no-syscallbuf`
- Intel CPU type 0x60f10 unknown (AMD Ryzen 9 7950X3D 16-Core Processor) HOT 1
- Support fchmodat2 (or break glibc detection of it?)
- Assertion failure when rr compiled with -flto=auto HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rr.