-
Notifications
You must be signed in to change notification settings - Fork 838
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
Add DTRACE points to measure request timings. #11245
Conversation
So far, we are doing HttpCommTask and H2CommTask. This is optional use -DUSE_DTRACE=1 to activate.
…nto feature/dtrace
@@ -0,0 +1,425 @@ | |||
/* <sys/sdt.h> - Systemtap static probe definition macros. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we bring our own instead of testing with __has_include
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a single header. As far as I see it does not exist in alpine Linux. Therefore I chose this approach. The code is in the public domain. It should even be processor independent and might even work on Mac, no idea, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just compile for a local PC to do some testing? Do we really need alpine support?
arangod/GeneralServer/CommTask.cpp
Outdated
@@ -150,6 +153,11 @@ bool resolveRequestContext(GeneralRequest& req) { | |||
|
|||
CommTask::Flow CommTask::prepareExecution(auth::TokenCache::Entry const& authToken, | |||
GeneralRequest& req) { | |||
|
|||
#ifdef USE_DTRACE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why DTRACE_PROBE1 not just a noop, instead of wrapping everything in #ifdef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 74 #define statements in lib/Basics/sdt.h
. Yes, so far I am using only two of them. But I think it is impractical to define them all as empty macros if USE_DTRACE
is set to 0. I would prefer to leave it as it is, but it is an easy change to define those that we actually use as empty macros for now, if you strongly prefer this. I have no strong feelings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also prefer having just one file to be included wherever tracing is needed:
lib/Basics/dtrace-wrapper.h
And this file could contain:
#ifndef ARANGODB_DTRACE_WRAPPER_H
#define ARANGODB_DTRACE_WRAPPER_H 1
#if USE_DTRACE
#include "Basics/sdt.h"
#else
#define DTRACE_PROBE1(...) do { } while (0);
#define DTRACE_PROBE2(...) do { } while (0);
#endif
#endif
That would allow us to have everywhere managed in a single place, and keep the changes to the code minimal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach.
I will ask this week's team lead sync meeting for approval to add the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…telisting * origin/devel: (80 commits) Feature/aql subquery execution block impl execute implementation batch sub queries (#11318) Fix isAdminUser. (#11326) Bug fix/fixes 20200318 (#11319) updated CHANGELOG Feature/out of search in range (#11324) fix "fix" for collection figures (#11323) updated CHANGELOG compilation fixes for clang-10s more strict checking (#11316) fix failing query (#11317) KShortestPathsExecutor must reset its KShortestPathFinder, including all caches. (#11312) Feature/aql subquery execution block impl execute implementation expected number of rows (#11274) Add DTRACE points to measure request timings. (#11245) USE_STRICT_OPENSSL is Off by default Fix usesRevisionAsDocumentId population and add syncByRevision flag (#11314) Traversal Bugfix (#11310) Bug fix/issue 11275 (#11299) added simple test (#11301) Fix some typos (#10173) Documentation/typos 2020-01-24 (#10975) Update CHANGELOG ...
…ql-functions * origin/devel: (25 commits) Bug fix/fixes 20200318 (#11319) updated CHANGELOG Feature/out of search in range (#11324) fix "fix" for collection figures (#11323) updated CHANGELOG compilation fixes for clang-10s more strict checking (#11316) fix failing query (#11317) KShortestPathsExecutor must reset its KShortestPathFinder, including all caches. (#11312) Feature/aql subquery execution block impl execute implementation expected number of rows (#11274) Add DTRACE points to measure request timings. (#11245) USE_STRICT_OPENSSL is Off by default Fix usesRevisionAsDocumentId population and add syncByRevision flag (#11314) Traversal Bugfix (#11310) Bug fix/issue 11275 (#11299) added simple test (#11301) Fix some typos (#10173) Documentation/typos 2020-01-24 (#10975) Update CHANGELOG Some cleanup for new executor test code, which accidentally fixes ASAN failures in ExecutorTestHelper (#11283) LZ4 update (#11306) ...
This PR adds DTRACE points to the code base to measure the timings of requests with the
bpftrace
tool. This is at the moment experimental and work in progress, but could help us eventually to improve performance.