Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35597508rwd; Mon, 10 Jul 2023 09:36:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlHZIwnC72J96LRJ0NyYhYkRoibBVN/gq4dbdIarfac5RQKZHVXFnO9IbB0GHmIodjHXOk9j X-Received: by 2002:a50:fc1a:0:b0:51d:92bf:e6ae with SMTP id i26-20020a50fc1a000000b0051d92bfe6aemr11691302edr.18.1689007006063; Mon, 10 Jul 2023 09:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689007006; cv=none; d=google.com; s=arc-20160816; b=0o774HhoSXqr2p+TAhwJZAi9iv4DOtxCdQ/sNhc+T3akZ18Zg8jSovHKOmvTQ58T5i dwcEFwjdnZdMyYkqGzUVNLXWh9AFQmq/lEE8QCyIDaG57HFemTBQXYyeIDg6bsPAsSAL et3azgTpywYv/dsLOpJwuiyehZJqCvhFJM213ZPoKIRavp8ufWBc20bN8idwIPv96iyl shG3KwLIuhikJhbuYUODgMRqSaflWEJ/mLapmREJcBgG0M+OaTNasdkNa2xSVxuXRdAf Pu9/5kffQnD9Pt7SLTLHT3E/j8NpJ73DkG3x9p1VQnZKxucVgAnwfx4iRWq9ch48KMqr XegQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nNVZYknB2Vq1JRArgSq8p2eWi+qAP7L/4Om5s83itfg=; fh=zxPSd6M29w+v6q1VB4/sh/9uFD/aajoT27IZUWD9Glg=; b=IEegqBi3O7XL0O5qxqtRAQ+b7BI3z5umYcNLSjm89LK7ZrFuRtlmqbd6LqsVHaJXhM vsU8FHzZMac3mtyLN738OyqhUxBHtaDlw5JALegWReca6yoIw72+Dde2ITvbp+Am+UY8 9tD729pTqypFduzmJNCBbjK0v/RiqLeygy8I3q1drQ2aIKOegFTKl+xHeZ7WlQzoqRHs 5ikvinbtsjp8YGUfpE8mwBDfyI8S3g8FY3KYoGiO5WaSo7tf3JTvufnKgkoDwx+U3u+8 +vOZyVrsGUl1NPmBEg69A/VxBa5tbDezkarMQsGKND4fUMMcbDgIWthJxOxdfvlyb3Ua fToA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b6eXKJJX; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020a056402048400b0051ddbf43286si9924939edv.403.2023.07.10.09.36.14; Mon, 10 Jul 2023 09:36:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b6eXKJJX; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229458AbjGJQTp (ORCPT + 99 others); Mon, 10 Jul 2023 12:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjGJQTo (ORCPT ); Mon, 10 Jul 2023 12:19:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8D8B106 for ; Mon, 10 Jul 2023 09:19:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5C101610A2 for ; Mon, 10 Jul 2023 16:19:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 418F3C433C7; Mon, 10 Jul 2023 16:19:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689005982; bh=en7QKplx5pilJyCKBzL8WRSMhtpkM1Rm+EM7uGdVrME=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b6eXKJJXO5ry+Qmpta3CAr6xlBpbyKh9E81VSMdir92JSQqHp9pXCopjaPjiWYAsp GLkPib/No7goRpI36FqVvJ1Yf8iY7NmpZAWNWDBI/JA70T2Dj0tkD8i/GmM1l2lnBk ddRK4nwgMlqczIt2+6r5o9cnQrX0V+n8UcDD4q9uUKfIPQ0JzMUknbDCOJ+WP9a800 zTC/BKE5wwxAZnJqJKpeU8V0TF0V1K/oOM9/hpaMD4ROmX7IpLU8nJkpUiVBiwuUh4 eAOY0bXdukjWw/FgSXpmNHwtwGCovSC6Q1on/2KxNRuB5L5bTVyDgJmUdG6WdJcsgo Fmt5Hux6h96hw== Date: Mon, 10 Jul 2023 18:19:39 +0200 From: Lorenzo Bianconi To: Chuck Lever III Cc: Chuck Lever , Linux NFS Mailing List , "lorenzo.bianconi@redhat.com" , "jlayton@kernel.org" Subject: Re: [RFC] NFSD: add rpc_status entry in nfsd debug filesystem Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0JFP51DTI3ifb8uE" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org --0JFP51DTI3ifb8uE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jul 10, Chuck Lever III wrote: >=20 >=20 > > On Jul 10, 2023, at 11:33 AM, Lorenzo Bianconi wro= te: > >=20 > >>> + for (i =3D 0; i < serv->sv_nrpools; i++) { > >>> + struct svc_rqst *rqstp; > >>> + > >>> + seq_puts(m, "XID | FLAGS | PROG |"); > >>> + seq_puts(m, " VERS | PROC\t|"); > >>> + seq_puts(m, " REMOTE - LOCAL IP ADDR"); > >>> + seq_puts(m, "\t\t\t\t\t\t\t\t | NFS4 COMPOUND OPS\n"); > >>> + list_for_each_entry_rcu(rqstp, > >>> + &serv->sv_pools[i].sp_all_threads, > >>> + rq_all) { > >>> + if (!test_bit(RQ_BUSY, &rqstp->rq_flags)) > >>> + continue; > >>> + > >>> + seq_printf(m, > >>> + "0x%08x | 0x%08lx | 0x%08x | NFSv%d | %s\t|", > >>> + be32_to_cpu(rqstp->rq_xid), rqstp->rq_flags, > >>> + rqstp->rq_prog, rqstp->rq_vers, > >>> + svc_proc_name(rqstp)); > >>> + > >>> + if (rqstp->rq_addr.ss_family =3D=3D AF_INET) { > >>> + seq_printf(m, " %pI4 - %pI4\t\t\t\t\t\t\t |", > >>> + &((struct sockaddr_in *)&rqstp->rq_addr)->sin_addr, > >>> + &((struct sockaddr_in *)&rqstp->rq_daddr)->sin_addr); > >>> + } else if (rqstp->rq_addr.ss_family =3D=3D AF_INET6) { > >>> + seq_printf(m, " %pI6 - %pI6 |", > >>> + &((struct sockaddr_in6 *)&rqstp->rq_addr)->sin6_addr, > >>> + &((struct sockaddr_in6 *)&rqstp->rq_daddr)->sin6_addr); > >>> + } else { > >>> + seq_printf(m, " Unknown address family: %hu\n", > >>> + rqstp->rq_addr.ss_family); > >>> + continue; > >>> + } > >>> +#ifdef CONFIG_NFSD_V4 > >>> + if (rqstp->rq_vers =3D=3D NFS4_VERSION && > >>> + rqstp->rq_proc =3D=3D NFSPROC4_COMPOUND) { > >>> + /* NFSv4 compund */ > >>> + struct nfsd4_compoundargs *args =3D rqstp->rq_argp; > >>> + struct nfsd4_compoundres *resp =3D rqstp->rq_resp; > >>> + > >>> + while (resp->opcnt < args->opcnt) { > >>> + struct nfsd4_op *op =3D &args->ops[resp->opcnt++]; > >>> + > >>> + seq_printf(m, " %s", nfsd4_op_name(op->opnum)); > >>> + } > >>> + } > >>> +#endif /* CONFIG_NFSD_V4 */ > >>> + seq_puts(m, "\n"); > >>=20 > >> My only quibble here is that the file format needs to be parsable > >> by scripts as well as readable by humans. I'm not sure I have a > >> specific comment, but it's something that needs some attention and > >> verification (with, say, a sample user space tool, hint hint). > >=20 > > maybe we can add a csv hanlder, what do you think? not sure. >=20 > I suggested JSON to Jeff as another option, but I don't think we want > to swing that far in the other direction. >=20 > There are plenty of examples of /sys files that are both parsable and > human-friendly. I'll leave it to you to find one or two formats that > seem capable of the task at hand, and let's pick from one of those. ok, I will take a look. In the meantime I posted a new revision to continue= the discussion. Regartds, Lorenzo >=20 >=20 > -- > Chuck Lever >=20 >=20 --0JFP51DTI3ifb8uE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCZKwvmwAKCRA6cBh0uS2t rIW3AP0Vr7Sgk2hss85aXUXAHIVtRv1GPpX8NYQBGcTY2Fv5mgD+MWNw+1qJNrYl 38ktfYWIV3ysfgHNklo9G4jZHUGLRgQ= =9OJa -----END PGP SIGNATURE----- --0JFP51DTI3ifb8uE--