Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp759555ioo; Sat, 21 May 2022 13:27:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3XwTpW5cwkdAdNTVt/aDGfiNg5q8GyNoAisaN+hR8vLJp+plZ7AgcT/rfp53RQKsDLIjz X-Received: by 2002:a17:902:bb01:b0:161:fa9f:5511 with SMTP id im1-20020a170902bb0100b00161fa9f5511mr7238368plb.147.1653164854484; Sat, 21 May 2022 13:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653164854; cv=none; d=google.com; s=arc-20160816; b=GC4yRnkwcD2U8bxcxKtdr+fvwHLDlIk7ZYXo+HVcGrEP6L/k5NyjpfQfCWQIBkmc0Q AUDXLCjYJvnBwxcJHXqp2KDuxcPDOdJk/zCcJs2s7MrYTvH/Daes2rl8FCpJkQZsNpCP IMXnkaqTNfUmweG6Y4qWe4fbPKjHcGE84a3+ppxJ1Ra2AYmuwKGnnbk/3SSlYgo66qv5 PQsx8O5T3cJRm9GmXXyoKlhqk2jORmkv1iMf26AWADVrAt9G8ubv8xGGHHtyZBz9E1gk yp0EwILj/fyoBf0TP+Lu7ppj4X3TXDt9gvYH2D34PfFx7C1XI7OQn1AdAtPNL83+iosb S2OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TX5ubsOE693MmLyfmpEsKA9kTxG9wuZlKhY/Lmx1Dcg=; b=babP7SPENqcwsKJYFZe5NJilngoR5rUZrdiEs1OHUqepDiiyZesc0fTGT3L+gB7rDj PlPYaodhiOqQSH12f6CmKdueP8lOLaCKi9XBVXG2mg5H8Z8ELBHpUEU5W655S2WQSgXk 083OxyRUr3xz81Lx+gI11jH3M+t1AO59MWjfsAUkqpFDsHUvvYu/3DcP/ac65SLcO/RQ scd+30+bLy8DBHBtbPcQv0zL5Y5pddcRMrN4CB1A159zaT+zmB0LZ7RqZOcQ4YhM83sN 9GD4xKFQz1layMjJ2n8TgG/xiQjBDGtPV6zQxZ+eZpfjGonp4SWGEBfoyJz1FPUqt6sU 4Eyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=mMPPPEU4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w32-20020a634760000000b003db68cb9d71si4245474pgk.407.2022.05.21.13.27.22; Sat, 21 May 2022 13:27:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@google.com header.s=20210112 header.b=mMPPPEU4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245289AbiESVxR (ORCPT + 99 others); Thu, 19 May 2022 17:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245178AbiESVxP (ORCPT ); Thu, 19 May 2022 17:53:15 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3733353E32 for ; Thu, 19 May 2022 14:53:14 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id j24so9024840wrb.1 for ; Thu, 19 May 2022 14:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TX5ubsOE693MmLyfmpEsKA9kTxG9wuZlKhY/Lmx1Dcg=; b=mMPPPEU4Yx+mtS5aVcwwgLsWwhqGNX6yCnKkNTj4avhRkEw8A6Uq0MGgn3uQNfBa4e vKCS7kRRTVqExk6sdIA7WNd2XVzEBGzO6kLyAOKv+b2hbCz6VpydFzHqeK97GrH1obED DUm111fatIa2ZI2LUM5nXCzufj0xA3ubSlq4VJ8aYUAJR0lPkN5DVMzKQ/gJrn6cj34F odcg+YbyZm37Rud7oZtAmoSRH9hQqreI+3js+Zc+mcbTKeS+u55W21Q2CbVCLpNx+ndK YqGwZpkbe4mSYOv1KvetzgMDp3pD3nmNNlapjgV5N81c47T4qaPui2JXENarJTeGL/Cw m0Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TX5ubsOE693MmLyfmpEsKA9kTxG9wuZlKhY/Lmx1Dcg=; b=4rX65qIeCQ+8UCamFGi/+XJY3T2Yqf+pFgtMvycXHh+pLOUK9p7iZsKdLDEK7PoL6q E3VnAZuXSU+I1CrYO0QGeDYtKALierCsl871L6NQB7gLEdbiNZICbOxcfYpYHwrwoRvy f02cMbFqauQVL36hTso5DavgFHLv9Ql94SRYrQ52e+oMMA/NRtE3RDKpC/a5E75+/FKM 32iO8/DwcCcBWg1cRoOH6nuzjqBBakGd8DlSnTSx/GbCI2MhxUV5e3jWnIeyNciqHH6E 8ik5LvLbRpVNc19vi0p1a/bnSXXPqreJBA901HbrSwXihkz84kjwhea9dlch3C8PTtY7 nN4g== X-Gm-Message-State: AOAM532IPbitLmDsaSjMSFleDiqQQX9mum4mXaOfvaKxZ18qQ/PEhI3c Sai4JCUpOiqJT7l+xj60a2IyM5EU0W7X0R9RZI0DIQ== X-Received: by 2002:a5d:6c68:0:b0:20c:b69f:cbd0 with SMTP id r8-20020a5d6c68000000b0020cb69fcbd0mr6016090wrz.500.1652997192512; Thu, 19 May 2022 14:53:12 -0700 (PDT) MIME-Version: 1.0 References: <20220519214021.3572840-1-kaleshsingh@google.com> <01c1e280-eec4-4f04-553b-670ae1376c33@infradead.org> In-Reply-To: <01c1e280-eec4-4f04-553b-670ae1376c33@infradead.org> From: Kalesh Singh Date: Thu, 19 May 2022 14:53:01 -0700 Message-ID: Subject: Re: [RFC PATCH] procfs: Add file path and size to /proc//fdinfo To: Randy Dunlap Cc: Ioannis Ilkos , "T.J. Mercier" , Suren Baghdasaryan , "Cc: Android Kernel" , Jonathan Corbet , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Andrew Morton , Christoph Anton Mitterer , Kees Cook , Mike Rapoport , Colin Cross , LKML , linux-fsdevel , "open list:DOCUMENTATION" , Linux Media Mailing List , DRI mailing list , "moderated list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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-kernel@vger.kernel.org On Thu, May 19, 2022 at 2:47 PM Randy Dunlap wrote: > > Hi-- > > On 5/19/22 14:40, Kalesh Singh wrote: > > diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst > > index 061744c436d9..ad66d78aca51 100644 > > --- a/Documentation/filesystems/proc.rst > > +++ b/Documentation/filesystems/proc.rst > > @@ -1922,13 +1922,16 @@ if precise results are needed. > > 3.8 /proc//fdinfo/ - Information about opened file > > --------------------------------------------------------------- > > This file provides information associated with an opened file. The regular > > -files have at least four fields -- 'pos', 'flags', 'mnt_id' and 'ino'. > > +files have at least six fields -- 'pos', 'flags', 'mnt_id', 'ino', 'size', > > +and 'path'. > > + > > The 'pos' represents the current offset of the opened file in decimal > > form [see lseek(2) for details], 'flags' denotes the octal O_xxx mask the > > file has been created with [see open(2) for details] and 'mnt_id' represents > > mount ID of the file system containing the opened file [see 3.5 > > /proc//mountinfo for details]. 'ino' represents the inode number of > > -the file. > > +the file, 'size' represents the size of the file in bytes, and 'path' > > +represents the file path. > > > > A typical output is:: > > > > @@ -1936,6 +1939,8 @@ A typical output is:: > > flags: 0100002 > > mnt_id: 19 > > ino: 63107 > > + size: 0 > > + path: /dev/null > > > > All locks associated with a file descriptor are shown in its fdinfo too:: > > > > @@ -1953,6 +1958,8 @@ Eventfd files > > flags: 04002 > > mnt_id: 9 > > ino: 63107 > > + size: 0 > > + path: anon_inode:[eventfd] > > eventfd-count: 5a > > > > where 'eventfd-count' is hex value of a counter. > > @@ -1966,6 +1973,8 @@ Signalfd files > > flags: 04002 > > mnt_id: 9 > > ino: 63107 > > + size: 0 > > + path: anon_inode:[signalfd] > > sigmask: 0000000000000200 > > > > where 'sigmask' is hex value of the signal mask associated > > @@ -1980,6 +1989,8 @@ Epoll files > > flags: 02 > > mnt_id: 9 > > ino: 63107 > > + size: 0 > > + path: anon_inode:[eventpoll] > > tfd: 5 events: 1d data: ffffffffffffffff pos:0 ino:61af sdev:7 > > > > where 'tfd' is a target file descriptor number in decimal form, > > @@ -1998,6 +2009,8 @@ For inotify files the format is the following:: > > flags: 02000000 > > mnt_id: 9 > > ino: 63107 > > + size: 0 > > + path: anon_inode:inotify > > inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:7e9e0000640d1b6d > > > > where 'wd' is a watch descriptor in decimal form, i.e. a target file > > @@ -2021,6 +2034,8 @@ For fanotify files the format is:: > > flags: 02 > > mnt_id: 9 > > ino: 63107 > > + size: 0 > > + path: anon_inode:[fanotify] > > fanotify flags:10 event-flags:0 > > fanotify mnt_id:12 mflags:40 mask:38 ignored_mask:40000003 > > fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:69f90400c275b5b4 > > @@ -2046,6 +2061,8 @@ Timerfd files > > flags: 02 > > mnt_id: 9 > > ino: 63107 > > + size: 0 > > + path: anon_inode:[timerfd] > > clockid: 0 > > ticks: 0 > > settime flags: 01 > > @@ -2070,6 +2087,7 @@ DMA Buffer files > > mnt_id: 9 > > ino: 63107 > > size: 32768 > > + path: /dmabuf: > > count: 2 > > exp_name: system-heap > > All of these added lines should be indented with a tab instead of spaces. Ahh. Thanks for catching it. WIll update in the next version. -Kalesh > > thanks. > -- > ~Randy > > -- > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >