Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Add function calls for request lifecycle tracing #316

Merged
merged 2 commits into from
Oct 6, 2022

Conversation

cole-miller
Copy link
Contributor

@cole-miller cole-miller commented Oct 4, 2022

This introduces two trivial functions, lifecycleRequestStart and lifecycleRequestEnd, that are called when a request is put onto and taken off of the main request queue, respectively. By attaching bpftrace probes to these function calls, we can gather information about how long requests typically spend sitting on this queue. The function definitions are confined to a separate compilation unit to prevent inlining.

@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Merging #316 (6049dfc) into master (e1e6fc7) will decrease coverage by 0.53%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #316      +/-   ##
==========================================
- Coverage   83.49%   82.95%   -0.54%     
==========================================
  Files          49       50       +1     
  Lines        9280     8829     -451     
  Branches     2481     2215     -266     
==========================================
- Hits         7748     7324     -424     
+ Misses        974      857     -117     
- Partials      558      648      +90     
Impacted Files Coverage Δ
src/client.c 70.30% <100.00%> (-3.01%) ⬇️
src/lifecycle.c 100.00% <100.00%> (ø)
src/replication.c 77.02% <100.00%> (+0.32%) ⬆️
src/tracing.c 23.52% <0.00%> (-5.89%) ⬇️
src/uv_fs.c 67.97% <0.00%> (-4.17%) ⬇️
src/byte.h 96.25% <0.00%> (-3.75%) ⬇️
src/recv_install_snapshot.c 40.00% <0.00%> (-3.64%) ⬇️
src/raft.c 83.84% <0.00%> (-2.92%) ⬇️
src/election.c 81.94% <0.00%> (-2.73%) ⬇️
... and 39 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@MathieuBordere
Copy link
Contributor

We have to watch out a bit, e.g. struct raft_apply contains a RAFT__REQUEST and that's embedded here in dqlite. We would break dqlite libraries compiled against older versions of libraft, I think it needs to be taken into account in the raft API PR too.

@cole-miller
Copy link
Contributor Author

cole-miller commented Oct 4, 2022

Thanks, that's a good point about the ABI. I'll try removing the ID field and keying the bpftrace map on the other data that's already in the request struct; hopefully that should give enough uniqueness to work with until we're ready to implement real request IDs.

Signed-off-by: Cole Miller <cole.miller@canonical.com>
This helps bpftrace generate stack traces.

Signed-off-by: Cole Miller <cole.miller@canonical.com>
@MathieuBordere MathieuBordere merged commit c3eb718 into canonical:master Oct 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants