From 630f3ff08c1d17c7900b9bde814922f775ca2703 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 1 Dec 2015 23:25:05 +0100 Subject: LDAP: Decorate the hot paths in the LDAP provider with systemtap probes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/providers/ldap/sdap_async_users.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/providers/ldap/sdap_async_users.c') 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) { -- cgit