From d46d59e78600aa72176df7217c94743b7e71881a Mon Sep 17 00:00:00 2001 From: Justin Stephenson Date: Wed, 3 May 2017 16:36:57 -0400 Subject: DP: Add Generic DP Request Probes Add the ability to analyze performance and monitor Data Provider requests at a high-level, probes fire when a request is sent and when a request is completed. Request name, domain, target, method, and return code information is passed as target variables to the systemtap probe tapsets which can be used in systemtap scripts. Resolves: https://pagure.io/SSSD/sssd/issue/3061 Reviewed-by: Jakub Hrozek --- src/systemtap/sssd.stp.in | 18 +++++++++++ src/systemtap/sssd_functions.stp | 68 ++++++++++++++++++++++++++++++++++++++++ src/systemtap/sssd_probes.d | 5 +++ 3 files changed, 91 insertions(+) (limited to 'src/systemtap') diff --git a/src/systemtap/sssd.stp.in b/src/systemtap/sssd.stp.in index 199916383..25a68cd04 100644 --- a/src/systemtap/sssd.stp.in +++ b/src/systemtap/sssd.stp.in @@ -254,3 +254,21 @@ probe sdap_nested_group_process_recv = process("@libdir@/sssd/libsss_ldap_common probestr = sprintf("-> %s(orig_dn=[%s])", $$name, orig_dn); } + +## Data Provider Request Probes +probe dp_req_send = process("@libexecdir@/sssd/sssd_be").mark("dp_req_send") +{ + dp_req_domain = user_string($arg1, "NULL"); + dp_req_name = user_string($arg2, "NULL"); + dp_req_target = $arg3; + dp_req_method = $arg4; +} + +probe dp_req_done = process("@libexecdir@/sssd/sssd_be").mark("dp_req_done") +{ + dp_req_name = user_string($arg1, "NULL"); + dp_req_target = $arg2; + dp_req_method = $arg3; + dp_ret = $arg4; + dp_errorstr = user_string($arg5, "NULL"); +} diff --git a/src/systemtap/sssd_functions.stp b/src/systemtap/sssd_functions.stp index bad194ead..e249aac98 100644 --- a/src/systemtap/sssd_functions.stp +++ b/src/systemtap/sssd_functions.stp @@ -1,3 +1,13 @@ +// constants +global TARGET_ID=0, TARGET_AUTH=1, TARGET_ACCESS=2, TARGET_CHPASS=3, + TARGET_SUDO=4, TARGET_AUTOFS=5, TARGET_SELINUX=6, TARGET_HOSTID=7, + TARGET_SUBDOMAINS=8, TARGET_SENTINEL=9 + +global METHOD_CHECK_ONLINE=0, METHOD_ACCOUNT_HANDLER=1, METHOD_AUTH_HANDLER=2, + METHOD_ACCESS_HANDLER=3, METHOD_SELINUX_HANDLER=4, METHOD_SUDO_HANDLER=5, + METHOD_AUTOFS_HANDLER=6, METHOD_HOSTID_HANDLER=7, METHOD_DOMAINS_HANDLER=8, + METHOD_SENTINEL=9 + function acct_req_desc(entry_type) { if (entry_type == 0x0001) { @@ -64,3 +74,61 @@ function sssd_acct_req_probestr(fc_name, entry_type, filter_type, filter_value, extra_value) return probestr } + +function dp_target_str(target) +{ + if (target == TARGET_ID) { + str_target = "ID" + } else if (target == TARGET_AUTH) { + str_target = "AUTH" + } else if (target == TARGET_ACCESS) { + str_target = "ACCESS" + } else if (target == TARGET_CHPASS) { + str_target = "CHPASS" + } else if (target == TARGET_SUDO) { + str_target = "SUDO" + } else if (target == TARGET_AUTOFS) { + str_target = "AUTOFS" + } else if (target == TARGET_SELINUX) { + str_target = "SELINUX" + } else if (target == TARGET_HOSTID) { + str_target = "HOSTID" + } else if (target == TARGET_SUBDOMAINS) { + str_target = "SUBDOMAINS" + } else if (target == TARGET_SENTINEL) { + str_target = "TARGET_SENTINEL" + } else { + str_target = "UNKNOWN" + } + + return str_target +} + +function dp_method_str(method) +{ + if (method == METHOD_CHECK_ONLINE) { + str_method = "Check Online" + } else if (method == METHOD_ACCOUNT_HANDLER) { + str_method = "Account Handler" + } else if (method == METHOD_AUTH_HANDLER) { + str_method = "Auth Handler" + } else if (method == METHOD_ACCESS_HANDLER) { + str_method = "Access Handler" + } else if (method == METHOD_SELINUX_HANDLER) { + str_method = "SELinux Handler" + } else if (method == METHOD_SUDO_HANDLER) { + str_method = "Sudo Handler" + } else if (method == METHOD_AUTOFS_HANDLER) { + str_method = "Autofs Handler" + } else if (method == METHOD_HOSTID_HANDLER) { + str_method = "HostID Handler" + } else if (method == METHOD_DOMAINS_HANDLER) { + str_method = "Domains Handler" + } else if (method == METHOD_SENTINEL) { + str_method = "Method Sentinel" + } else { + str_method = "UNKNOWN" + } + + return str_method +} diff --git a/src/systemtap/sssd_probes.d b/src/systemtap/sssd_probes.d index 33339b415..c0d526871 100644 --- a/src/systemtap/sssd_probes.d +++ b/src/systemtap/sssd_probes.d @@ -65,4 +65,9 @@ provider sssd { probe sdap_nested_group_sysdb_search_groups_post(); probe sdap_nested_group_populate_search_users_pre(); probe sdap_nested_group_populate_search_users_post(); + + probe dp_req_send(const char *domain, const char *dp_req_name, + int target, int method); + probe dp_req_done(const char *dp_req_name, int target, int method, + int ret, const char *errorstr); } -- cgit