diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-12-01 23:25:05 +0100 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2016-06-10 18:15:27 +0200 |
commit | 630f3ff08c1d17c7900b9bde814922f775ca2703 (patch) | |
tree | dc7b050b4f1d6036300ee7c8dc775418587dbe24 /src/providers/ldap/sdap_async_users.c | |
parent | 8c829226ce0cf98c35ffce39a66f9645cff65767 (diff) | |
download | sssd-630f3ff08c1d17c7900b9bde814922f775ca2703.tar.gz sssd-630f3ff08c1d17c7900b9bde814922f775ca2703.tar.xz sssd-630f3ff08c1d17c7900b9bde814922f775ca2703.zip |
LDAP: Decorate the hot paths in the LDAP provider with systemtap probes
During performance analysis, the LDAP provider and especially its nested
group code proved to be the place where we spend the most time during
account requests. Therefore, I decorated the LDAP provider with
systemtap probes to be able to observe where the time is spent.
The code allows passing of search properties (base, filter, ...) from
marks to probes. Where applicable, the probes pass on these arguments to
functions and build a human-readable string representation.
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/providers/ldap/sdap_async_users.c')
-rw-r--r-- | src/providers/ldap/sdap_async_users.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c index 480bbc203..c74d2aa8a 100644 --- a/src/providers/ldap/sdap_async_users.c +++ b/src/providers/ldap/sdap_async_users.c @@ -22,6 +22,7 @@ */ #include "util/util.h" +#include "util/probes.h" #include "db/sysdb.h" #include "providers/ldap/sdap_async_private.h" #include "providers/ldap/ldap_common.h" @@ -840,6 +841,7 @@ struct sdap_get_users_state { struct sysdb_ctx *sysdb; struct sdap_options *opts; struct sss_domain_info *dom; + const char *filter; char *higher_usn; struct sysdb_attrs **users; @@ -872,6 +874,9 @@ struct tevent_req *sdap_get_users_send(TALLOC_CTX *memctx, state->opts = opts; state->dom = dom; + state->filter = filter; + PROBE(SDAP_SEARCH_USER_SEND, state->filter); + subreq = sdap_search_user_send(state, ev, dom, opts, search_bases, sh, attrs, filter, timeout, lookup_type); if (subreq == NULL) { @@ -907,10 +912,12 @@ static void sdap_get_users_done(struct tevent_req *subreq) return; } + PROBE(SDAP_SEARCH_USER_SAVE_BEGIN, state->filter); ret = sdap_save_users(state, state->sysdb, state->dom, state->opts, state->users, state->count, &state->higher_usn); + PROBE(SDAP_SEARCH_USER_SAVE_END, state->filter); if (ret) { DEBUG(SSSDBG_OP_FAILURE, "Failed to store users [%d][%s].\n", ret, sss_strerror(ret)); @@ -929,6 +936,7 @@ int sdap_get_users_recv(struct tevent_req *req, struct sdap_get_users_state *state = tevent_req_data(req, struct sdap_get_users_state); + PROBE(SDAP_SEARCH_USER_RECV, state->filter); TEVENT_REQ_RETURN_ON_ERROR(req); if (usn_value) { |