From patchwork Wed Feb 27 04:05:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1048659 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ayNNLhoU"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 448MXt6mtwz9s6w for ; Wed, 27 Feb 2019 15:05:34 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729610AbfB0EFd (ORCPT ); Tue, 26 Feb 2019 23:05:33 -0500 Received: from mail-pg1-f169.google.com ([209.85.215.169]:37466 "EHLO mail-pg1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729373AbfB0EFd (ORCPT ); Tue, 26 Feb 2019 23:05:33 -0500 Received: by mail-pg1-f169.google.com with SMTP id q206so7271924pgq.4 for ; Tue, 26 Feb 2019 20:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=JlU7JqL3P1dCdEx0xNYbJGQJNr5OwAZtZOUxMsyljwc=; b=ayNNLhoUtLZNfTQyh2yAPBpcfdK9HO8AMz8xSkFb9T3KUq4zBGmt2+vKdwofxaECA9 ag5rIyfGeUNY+aK1Ipvub7ZeEWrgvOwn/6gDUI3qusDUAUbX3eNgeqW6w5txu8Ent2/u 2wFZxKPUG5xGztuGYIi1RBs9+PR8uEOlinioeXdkaQXYhCJ+kfDu72TYPcnSf3To1/F9 4QMY6/4HcqsnRh+qGwe46aMPq+c2Y1AwmqvMa6WBcQRkGdoINMqxDLQpmgcuoqCZF2tb fET7k34IvmZQ1kDOAXC5usjCHCGKgx45wGyhSZ6pU2ZWdAMZHGn25Hyn4TKFWZIxVfGI e+dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=JlU7JqL3P1dCdEx0xNYbJGQJNr5OwAZtZOUxMsyljwc=; b=NmD8iHGBx04EifyK9eZDm0GwI8OUyMyt3Cfa1JUIs2KdLUPgZZZqlIt+pl5XnmUvNH sLaB9VoO6Z7Q8fHgfMsYxqbJLdqpvuZ6dqMbxtqzrcXn3z73TU1mPoBel0sIODLEuNLL jBEM+tYPeGAPuZBXk/2a03KFBlxP0sWC3z6BakRksygt8hY7kqd3vwJinDv8JQgU5VKh lyw/x4Sh8gyaWWVICGidqSeZndIRVRrLGrOQaDnkPgxn/PjfxaXLorDnb8XNbAfOwCey EPkmWXbzaq2nzPmoC3PGlYgas91TBJl1MA+pvTYvsXwqOfXcSGzLhsS0Lrh9u7zRN8Sc vNUw== X-Gm-Message-State: AHQUAuYeiUGgNPRMSlBMGyml3GiGrdxLxwCTyGcvwEdHxU6xpmdfBwPM RNt+Nz8W/y17k3OUxvfqUsfPMRLbUTLKVJYGTj0/GsIu X-Google-Smtp-Source: AHgI3IZLz6yRcsMJCLHNy/vB/2c60B5wSWaPXHvXqXDy0n7zM2P0rHKfmJ8Gwre9yDgMg3s2YPBhMiledq9zuZLkjZY= X-Received: by 2002:aa7:8d42:: with SMTP id s2mr11057525pfe.116.1551240331838; Tue, 26 Feb 2019 20:05:31 -0800 (PST) MIME-Version: 1.0 From: Steve French Date: Tue, 26 Feb 2019 22:05:19 -0600 Message-ID: Subject: [PATCH] smb3: add dynamic trace point for query_info_enter/done To: CIFS Cc: Pavel Shilovsky Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Adds dynamic trace points for the query_info_enter and query_info_done (no error) case. We only had one on query_info errors in existing code. These two tracepoints are for the non-compounded query_info paths. Sample output (after doing: trace-cmd record -e smb3_query_info*) # trace-cmd show # tracer: nop # # _-----=> irqs-off # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / delay # TASK-PID CPU# |||| TIMESTAMP FUNCTION # | | | |||| | | ls-24140 [001] .... 27811.866068: smb3_query_info_enter: xid=7 sid=0xd2d00587 tid=0xb5441939 fid=0xcf082bac class=18 type=0x1 ls-24140 [001] .... 27811.867656: smb3_query_info_done: xid=7 sid=0xd2d00587 tid=0xb5441939 fid=0xcf082bac class=18 type=0x1 getcifsacl-24149 [005] .... 27854.759873: smb3_query_info_enter: xid=15 sid=0xd2d00587 tid=0xb5441939 fid=0x99896e72 class=0 type=0x3 getcifsacl-24149 [005] .... 27854.761730: smb3_query_info_done: xid=15 sid=0xd2d00587 tid=0xb5441939 fid=0x99896e72 class=0 type=0x3 Reviewed-by: Pavel Shilovsky From 678e45cde16bfa0c79cb2ec798072050de9fc48a Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 26 Feb 2019 21:58:30 -0600 Subject: [PATCH] smb3: add dynamic trace point for query_info_enter/done Adds dynamic trace points for the query_info_enter and query_info_done (no error) case. We only had one existing trace point related to this which was on query_info errors. Note that these two new tracepoints are for the non-compounded query_info paths. Sample output (from: trace-cmd record -e smb3_query_info*) ls-24140 [001] .... 27811.866068: smb3_query_info_enter: xid=7 sid=0xd2d00587 tid=0xb5441939 fid=0xcf082bac class=18 type=0x1 ls-24140 [001] .... 27811.867656: smb3_query_info_done: xid=7 sid=0xd2d00587 tid=0xb5441939 fid=0xcf082bac class=18 type=0x1 getcifsacl-24149 [005] .... 27854.759873: smb3_query_info_enter: xid=15 sid=0xd2d00587 tid=0xb5441939 fid=0x99896e72 class=0 type=0x3 getcifsacl-24149 [005] .... 27854.761730: smb3_query_info_done: xid=15 sid=0xd2d00587 tid=0xb5441939 fid=0x99896e72 class=0 type=0x3 Signed-off-by: Steve French --- fs/cifs/smb2pdu.c | 6 ++++++ fs/cifs/trace.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 5e34a7b54d1e..733021566356 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2868,6 +2868,9 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, if (rc) goto qinf_exit; + trace_smb3_query_info_enter(xid, persistent_fid, tcon->tid, + ses->Suid, info_class, (__u32)info_type); + rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov); rsp = (struct smb2_query_info_rsp *)rsp_iov.iov_base; @@ -2878,6 +2881,9 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, goto qinf_exit; } + trace_smb3_query_info_done(xid, persistent_fid, tcon->tid, + ses->Suid, info_class, (__u32)info_type); + if (dlen) { *dlen = le32_to_cpu(rsp->OutputBufferLength); if (!*data) { diff --git a/fs/cifs/trace.h b/fs/cifs/trace.h index 2a0be3e1927f..d8b049afa606 100644 --- a/fs/cifs/trace.h +++ b/fs/cifs/trace.h @@ -153,6 +153,48 @@ DEFINE_SMB3_FD_ERR_EVENT(close_err); /* * For handle based query/set info calls */ +DECLARE_EVENT_CLASS(smb3_inf_enter_class, + TP_PROTO(unsigned int xid, + __u64 fid, + __u32 tid, + __u64 sesid, + __u8 infclass, + __u32 type), + TP_ARGS(xid, fid, tid, sesid, infclass, type), + TP_STRUCT__entry( + __field(unsigned int, xid) + __field(__u64, fid) + __field(__u32, tid) + __field(__u64, sesid) + __field(__u8, infclass) + __field(__u32, type) + ), + TP_fast_assign( + __entry->xid = xid; + __entry->fid = fid; + __entry->tid = tid; + __entry->sesid = sesid; + __entry->infclass = infclass; + __entry->type = type; + ), + TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx class=%u type=0x%x", + __entry->xid, __entry->sesid, __entry->tid, __entry->fid, + __entry->infclass, __entry->type) +) + +#define DEFINE_SMB3_INF_ENTER_EVENT(name) \ +DEFINE_EVENT(smb3_inf_enter_class, smb3_##name, \ + TP_PROTO(unsigned int xid, \ + __u64 fid, \ + __u32 tid, \ + __u64 sesid, \ + __u8 infclass, \ + __u32 type), \ + TP_ARGS(xid, fid, tid, sesid, infclass, type)) + +DEFINE_SMB3_INF_ENTER_EVENT(query_info_enter); +DEFINE_SMB3_INF_ENTER_EVENT(query_info_done); + DECLARE_EVENT_CLASS(smb3_inf_err_class, TP_PROTO(unsigned int xid, __u64 fid, -- 2.17.1