From patchwork Mon Feb 25 06:16:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 10828259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B11011390 for ; Mon, 25 Feb 2019 06:16:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 994A82AA89 for ; Mon, 25 Feb 2019 06:16:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89D892AA86; Mon, 25 Feb 2019 06:16:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B4EA2AA86 for ; Mon, 25 Feb 2019 06:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbfBYGQ3 (ORCPT ); Mon, 25 Feb 2019 01:16:29 -0500 Received: from mail-pl1-f172.google.com ([209.85.214.172]:33036 "EHLO mail-pl1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbfBYGQ3 (ORCPT ); Mon, 25 Feb 2019 01:16:29 -0500 Received: by mail-pl1-f172.google.com with SMTP id y10so4001935plp.0 for ; Sun, 24 Feb 2019 22:16:28 -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; bh=6mmLeXtT8/RuAbBQ1vwRKDNY4Ut9CixfNLNiQZQwWN4=; b=bxhDUa7Neut812vEktqf0jMJ6HvM9DHzqZH7MUSJijbnPhbvHJalhNvSf2BeQXXp+4 sBs9Ck22I7A7yc3cIuEEvbnRVdzOMnAZbaS/TonH8zLXvId3N7bhWALmgmk62o8eqFgg C5vjoVqL6RrCttVAk4Wp23q9xskMJ6pmb7qxIQc3nLj2DbfJNMseCij9WNrh335mbdVL 8hiiSMg9C0c1olK4u8y1jFD3hm3Z2ptELn6W0pAOrx1yYWUKHsfcYaekTjJ5tggU90UX Sc/uqxY3ciqp2xnmSxtXZhUhQJGTo8rosCOiDwJwLK1b4HZ+egFjQbcPEtNvL37pRI5T G/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; bh=6mmLeXtT8/RuAbBQ1vwRKDNY4Ut9CixfNLNiQZQwWN4=; b=bD8daFKcVenoYhk5lfCzP21aILXBuIAASOBwrdYYjoDwauv94Cm7FR1MGRXDoQJvFy q1mrQGifwhcNr6GiNlKwrCrl2qsXzfjatbNR/NGiQoAyjISI5spHzeKAHOwmeKXPAm1x QTkkzkoDre35+kmYkpRnYLSSiL6t2pMCv924Ppu3HjLH3IuCG46O+PH1Vik+3VmX7RJ5 60+UXZMcu9byQEqBv12JAR5+EY8ToqaeU2QqZ1xjjLdSZQmfUQrmaWW8sFragnZUEaed EXk9cNslzGpQb5rg9rNDgyJFdkKnBeeZh9PxTD7hURym7SaMI0l9LBrChfKoq8tc4/sK v/Jg== X-Gm-Message-State: AHQUAuZ24BCZ0sdagnQJjB67MpAeK8AASCIaYwsznxBRrEUqumXzu/S8 mxEcZ5QYzl9won5PNDCFfRiUEjYIt23mXCVdVmyuR/L6 X-Google-Smtp-Source: AHgI3IY6i2YcFW1WgKLdfn8dDyoSKL/uI7gZEDPId0gKWNza5KSywfYW4ZKIpv6JQcLqbr4EdL0tg0VQ69ynwYk++Ns= X-Received: by 2002:a17:902:468:: with SMTP id 95mr17800652ple.73.1551075388319; Sun, 24 Feb 2019 22:16:28 -0800 (PST) MIME-Version: 1.0 From: Steve French Date: Mon, 25 Feb 2019 00:16:17 -0600 Message-ID: Subject: [PATCH] Add tracepoints for query_dir To: CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adds two tracepoints - one for query_dir done (no err) and one for query_dir_err (no more files, or error on query dir) e.g. In one window: # trace-cmd record -e smb3_query_dir* Hit Ctrl^C to stop recording In another window do an ls /mnt And then do: # trace-cmd show # _-----=> irqs-off # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / delay # TASK-PID CPU# |||| TIMESTAMP FUNCTION # | | | |||| | | ls-27625 [006] .... 74313.708032: smb3_query_dir_done: xid=20 sid=0xaf0a6274 tid=0x9f398492 fid=0x7a50dd5a offset=0x0 len=0x13 ls-27625 [006] .... 74313.708713: smb3_query_dir_err: xid=21 sid=0xaf0a6274 tid=0x9f398492 fid=0x7a50dd5a offset=0x0 len=0x0 rc=0 Patch attached From c5cd7cf176c933cb7122906d5725d9f9598e2ee3 Mon Sep 17 00:00:00 2001 From: Steve French Date: Mon, 25 Feb 2019 00:11:43 -0600 Subject: [PATCH] smb3: add tracepoints for query dir Adds two tracepoints - one for query_dir done (no err) and one for query_dir_err (no more files, or error on query dir) Sanple output: To start the trace in one window: trace-cmd record -e smb3_query_dir* Then in another window after doing an ls /mnt View the trace output by: trace-cmd show Sample output (note that the "error" in no more files, so is rc=0) ls-27625 [006] .... 74313.708032: smb3_query_dir_done: xid=20 sid=0xaf0a6274 tid=0x9f398492 fid=0x7a50dd5a offset=0x0 len=0x13 ls-27625 [006] .... 74313.708713: smb3_query_dir_err: xid=21 sid=0xaf0a6274 tid=0x9f398492 fid=0x7a50dd5a offset=0x0 len=0x0 rc=0 Signed-off-by: Steve French --- fs/cifs/smb2pdu.c | 4 ++++ fs/cifs/trace.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 64e172633bc4..b6e2a1f40078 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3896,9 +3896,13 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, else cifs_dbg(VFS, "illegal search buffer type\n"); + trace_smb3_query_dir_done(xid, persistent_fid, tcon->tid, + tcon->ses->Suid, index, srch_inf->entries_in_buffer); return rc; qdir_exit: + trace_smb3_query_dir_err(xid, persistent_fid, tcon->tid, + tcon->ses->Suid, index, 0, rc); free_rsp_buf(resp_buftype, rsp); return rc; } diff --git a/fs/cifs/trace.h b/fs/cifs/trace.h index 59be48206932..bf4f43f6893b 100644 --- a/fs/cifs/trace.h +++ b/fs/cifs/trace.h @@ -58,6 +58,7 @@ DEFINE_EVENT(smb3_rw_err_class, smb3_##name, \ DEFINE_SMB3_RW_ERR_EVENT(write_err); DEFINE_SMB3_RW_ERR_EVENT(read_err); +DEFINE_SMB3_RW_ERR_EVENT(query_dir_err); /* For logging successful read or write */ @@ -102,6 +103,7 @@ DEFINE_EVENT(smb3_rw_done_class, smb3_##name, \ DEFINE_SMB3_RW_DONE_EVENT(write_done); DEFINE_SMB3_RW_DONE_EVENT(read_done); +DEFINE_SMB3_RW_DONE_EVENT(query_dir_done); /* * For handle based calls other than read and write, and get/set info -- 2.17.1