From patchwork Tue Jan 14 17:00:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 11332693 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 837E0139A for ; Tue, 14 Jan 2020 17:02:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60E4224670 for ; Tue, 14 Jan 2020 17:02:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NsBSr6t7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726195AbgANRCc (ORCPT ); Tue, 14 Jan 2020 12:02:32 -0500 Received: from mail-yw1-f66.google.com ([209.85.161.66]:43450 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgANRCc (ORCPT ); Tue, 14 Jan 2020 12:02:32 -0500 Received: by mail-yw1-f66.google.com with SMTP id v126so9599785ywc.10 for ; Tue, 14 Jan 2020 09:02:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0XJzOwwa46IxUxZN6OzSr2hsV41A8UOkH+Mu7jcmN8k=; b=NsBSr6t7SuaaitiXPz2uPSbUjbBAc+r/BhomyX8jaleYN+xJCQRrC4mTIUWWqVPljq 5/Xx22TmsgzlEG/fPG3Lbr/zAm10mi1oSY9c9M9cd/62dH8dmkfNaFsMQW9v1Og9xT8W ZsK7LZgDthE8EwpZ6Pw2oUCIZN8ZWN9RoDZUf9atqlsoTSlUNbQe7Bx56InC1rEJ6beN yS7eOq/7/cKrwUmj+yly89TwI/QxL5e7n0xTR3y78c0OOCGTHYNmJkzB+zp0IbR2k3LB AcBNBzJQ+J0FRKlfQOdqYhbBh5yQx4gNo+Qjk9+FyiqC0lXQlfXTsZ+3Bj7GKXOeWhbT 3Bmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0XJzOwwa46IxUxZN6OzSr2hsV41A8UOkH+Mu7jcmN8k=; b=tiEMaVEUosr1oW+8C9dr8n5mjb8jFTSayiEsfRCTSLcE45G4KgDFcAv0gYtqIcT3st ChLd4kGa5szmtw+eUCWlHnORgRltP0Swk7h7fcoNPV23guPvGsiyZtiTECLovcE5Se5S yWim4gKKlwOgN8VqE3rEvkd5OT7mYGyKxOKljYc4fX9DKlOsv3BRYulxw7jLBi+rihmf apYDbxFft9nJm/vXwgqozZlsnvwb+7TTyhlCdsOO2r44pPiHMJxM09rXz1lQ4bj1jdxq fcqauW6wyzb7Em9n4g55oSrW9odnMMQN8GJPl5dkbB5BFJTTMs0MtOtEuCJ6TwufhIvQ mFLw== X-Gm-Message-State: APjAAAVeDJUaPReJGMxyEoPLPxtQvLbZFAUO19MWwuOM7aket8cpTv7p tcu1oCXPu3bSk2yExKE8xRDsKfk= X-Google-Smtp-Source: APXvYqx8M9Wzvs2DQ8wEFblWmIOW9spp//VgiPskb+BA36XjrYa6vfA1M2G4Y4nFKe+JcP2v7niVUg== X-Received: by 2002:a81:b1c3:: with SMTP id p186mr13943258ywh.398.1579021351626; Tue, 14 Jan 2020 09:02:31 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id q185sm6926930ywh.61.2020.01.14.09.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 09:02:31 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: "J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH 1/2] nfsd: Fix a perf warning Date: Tue, 14 Jan 2020 12:00:21 -0500 Message-Id: <20200114170022.923083-1-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org perf does not know how to deal with a __builtin_bswap32() call, and complains. All other functions just store the xid etc in host endian form, so let's do that in the tracepoint for nfsd_file_acquire too. Signed-off-by: Trond Myklebust --- fs/nfsd/trace.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index ffc78a0e28b2..b073bdc2e6e8 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -228,7 +228,7 @@ TRACE_EVENT(nfsd_file_acquire, TP_ARGS(rqstp, hash, inode, may_flags, nf, status), TP_STRUCT__entry( - __field(__be32, xid) + __field(u32, xid) __field(unsigned int, hash) __field(void *, inode) __field(unsigned int, may_flags) @@ -236,11 +236,11 @@ TRACE_EVENT(nfsd_file_acquire, __field(unsigned long, nf_flags) __field(unsigned char, nf_may) __field(struct file *, nf_file) - __field(__be32, status) + __field(u32, status) ), TP_fast_assign( - __entry->xid = rqstp->rq_xid; + __entry->xid = be32_to_cpu(rqstp->rq_xid); __entry->hash = hash; __entry->inode = inode; __entry->may_flags = may_flags; @@ -248,15 +248,15 @@ TRACE_EVENT(nfsd_file_acquire, __entry->nf_flags = nf ? nf->nf_flags : 0; __entry->nf_may = nf ? nf->nf_may : 0; __entry->nf_file = nf ? nf->nf_file : NULL; - __entry->status = status; + __entry->status = be32_to_cpu(status); ), TP_printk("xid=0x%x hash=0x%x inode=0x%p may_flags=%s ref=%d nf_flags=%s nf_may=%s nf_file=0x%p status=%u", - be32_to_cpu(__entry->xid), __entry->hash, __entry->inode, + __entry->xid, __entry->hash, __entry->inode, show_nf_may(__entry->may_flags), __entry->nf_ref, show_nf_flags(__entry->nf_flags), show_nf_may(__entry->nf_may), __entry->nf_file, - be32_to_cpu(__entry->status)) + __entry->status) ); DECLARE_EVENT_CLASS(nfsd_file_search_class, From patchwork Tue Jan 14 17:00:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 11332695 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3706E13A0 for ; Tue, 14 Jan 2020 17:02:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15C2624670 for ; Tue, 14 Jan 2020 17:02:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I8KlLuIk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726946AbgANRCd (ORCPT ); Tue, 14 Jan 2020 12:02:33 -0500 Received: from mail-yw1-f66.google.com ([209.85.161.66]:41347 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgANRCd (ORCPT ); Tue, 14 Jan 2020 12:02:33 -0500 Received: by mail-yw1-f66.google.com with SMTP id l22so9611755ywc.8 for ; Tue, 14 Jan 2020 09:02:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WCB73bbYYD5MHty/raK1qkIhT6EzYQtfJOCKDR4gdeI=; b=I8KlLuIknShW0lotuZ2NNECiV+tZO1wFaklel6ORyghG5w4FCqWshthmPgu6R667am boneH0LpLirguDHqLhsiNz5lQKqzWHuAFVpby6xKL/DwxdkJKvG1a7C5KizJmiWB/ikY RdaAkd8DCK+JHdkxseUcLCjVZ4Dj2mn9E69Gk4Y8dvwAynA3zl42+UGEaVjNs/S4iaVM bYz6d4NLYKt/yGqXxJTaOUkm3i7AIwc4AmY+x4Jpx8ASHCRih/8z8AptqP0IYOv0BBn5 3OYt9T4hdqy7nV6f6kys2tnF3QuDX/eaR9Mse/6PH+RFNJreOhsswJ7jtGfzpAWQScH/ /1hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WCB73bbYYD5MHty/raK1qkIhT6EzYQtfJOCKDR4gdeI=; b=N3ZqDvgwxC7S9isST5oz2OeNI8Pwhm23ZT6V6sjKAGyb/ae/sBhD/S3SytBLVPVQMD LBZCTeh6JNA/3gHaaeF8OGTUvH4Ox11Jrr9bTI6gOFXUpqqbUStmzUYPh8dTyuyIGiu5 S06f3VFfeEQglyh1MQN9wFFhxhAIb/Euy1P8fu78WPWHnTRgMm0nrdwj4GLuJ92QlGqN Mybiq/pD5t1N1OjVb3nZnSCPXPxgPnptenvftlr6YdhnGSHwaYXU6sCJF4AV6hCn+gtk hppY4oGHcy5BD7GuYwv1neVqxr9pkGfQNifj4VS7YGIKHu3Wa9hWExlNJtICMIP+jC2i HPLw== X-Gm-Message-State: APjAAAUdOgzOAeWDaR0U1l9RgzZAs51v6SjXEWiIN397MG9WlWN2TPMo ifZpFsECWIgbPEr0W+rM9g== X-Google-Smtp-Source: APXvYqxiuPcJj6aYmirTrfOvGAHJkyz4tJJQQt57N7zggcgsMblsXD3VSBsOjxBXUK4bx/vT+uO1Cw== X-Received: by 2002:a81:4cd3:: with SMTP id z202mr13455100ywa.477.1579021352649; Tue, 14 Jan 2020 09:02:32 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id q185sm6926930ywh.61.2020.01.14.09.02.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 09:02:32 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: "J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/2] nfsd: Define the file access mode enum for tracing Date: Tue, 14 Jan 2020 12:00:22 -0500 Message-Id: <20200114170022.923083-2-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200114170022.923083-1-trond.myklebust@hammerspace.com> References: <20200114170022.923083-1-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Signed-off-by: Trond Myklebust --- fs/nfsd/trace.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h index b073bdc2e6e8..17ecef404e5b 100644 --- a/fs/nfsd/trace.h +++ b/fs/nfsd/trace.h @@ -166,6 +166,12 @@ DEFINE_STATEID_EVENT(layout_recall_done); DEFINE_STATEID_EVENT(layout_recall_fail); DEFINE_STATEID_EVENT(layout_recall_release); +TRACE_DEFINE_ENUM(NFSD_FILE_HASHED); +TRACE_DEFINE_ENUM(NFSD_FILE_PENDING); +TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_READ); +TRACE_DEFINE_ENUM(NFSD_FILE_BREAK_WRITE); +TRACE_DEFINE_ENUM(NFSD_FILE_REFERENCED); + #define show_nf_flags(val) \ __print_flags(val, "|", \ { 1 << NFSD_FILE_HASHED, "HASHED" }, \