Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3367444imu; Mon, 17 Dec 2018 19:06:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/VfPqM3MJp6LlMG0Ih3Nt9dQy4uEvyOTMBd5za6+usZeofCmpRHGRn1/R1a2tfSIPRa8gmX X-Received: by 2002:a17:902:9f93:: with SMTP id g19mr14683183plq.195.1545102360395; Mon, 17 Dec 2018 19:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545102360; cv=none; d=google.com; s=arc-20160816; b=Xxgw57rAJ2Y6EzOtGhvH/pNaJZvFsXHpczVcdC5lBZDzwd2p2+MPbVXL+30/I5Aev7 QUlPKr9mqotHIuY7lm1h/BHN2dXY3I2sd68FpPaJcffv+XtNuxAlnAI82JALDokkKjrz dHBIz1LwIUyLSwAjK4THsBCYeT6aNcbaWWPOH89mDzVtRsGlfH8ROZu+jjcYLVFXL8RV +OOPZgR1k8f26CUlPfFCvImkbcVn+717SPl0aQbKpnUM4P/J8XeYCm34GCx4y8NHnMi8 OcdWZExeGWWtLxFeIwD3NYSS5IURhvW/y2whZG08Gzp1P+kF1fA4OrDPEjnkm6fMSu65 jV8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=kfI+WlvN6bv5/ZI+AcVjB7eB1UhgnKgBEbaiM15yOMs=; b=VWHxRJ2WgfSFGsUlsyOddB3ld035WfeZuMFLRXR2XSdAczBYttbPZDhHJNtnebmUx7 J6/Y4r1hEjhJ/Ze44mKFUE+RlqTlkpFYjO/qnqzbEmA7q8ACQ7HDPPboXPSQBwwEGBF0 VY/Yrh6NIoxM0CitUpS+qA8aMNWXlr6ImNy+9BZBoXEj31jncGQqMtMxUu8w8b8RNCu6 bpKKE/bJR59pTBq3GwngwxV/f2XISCPClyrOng0+Vh+2LF6dBcGYm5JmjBe8bekgea4C WpSXWUdp8wlYWaDLW0zzO1IbOReqNVVCcdowzhZesQNG4wkTamOARA5oHCIX89BafIxp ohJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si12345286pgn.57.2018.12.17.19.05.43; Mon, 17 Dec 2018 19:06:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726521AbeLRDEy (ORCPT + 99 others); Mon, 17 Dec 2018 22:04:54 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53482 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726285AbeLRDEy (ORCPT ); Mon, 17 Dec 2018 22:04:54 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 809F1722ED; Tue, 18 Dec 2018 03:04:52 +0000 (UTC) Received: from slave.localdomain.com (unknown [10.64.193.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E8742026993; Tue, 18 Dec 2018 03:04:51 +0000 (UTC) From: Masatake YAMATO To: linux-kernel@vger.kernel.org Cc: yamato@redhat.com Subject: [PATCH] eventfd: prepare id to userspace via fdinfo Date: Tue, 18 Dec 2018 12:04:48 +0900 Message-Id: <20181218030448.11483-1-yamato@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 18 Dec 2018 03:04:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 18 Dec 2018 03:04:53 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'yamato@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Finding endpoints of an IPC channel is one of essential task to understand how a user program works. Procfs and netlink socket provide enough hints to find endpoints for IPC channels like pipes, unix sockets, and pseudo terminals. However, there is no simple way to find endpoints for an eventfd file from userland. An inode number doesn't hint. Unlike pipe, all eventfd files share the same inode object. To provide the way to find endpoints of an eventfd file, this patch adds "eventfd-id" field to fdinfo of eventfd as identifier. Address for eventfd context is used as id. --- fs/eventfd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/eventfd.c b/fs/eventfd.c index 08d3bd602f73..fc63ad43d962 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c @@ -297,6 +297,7 @@ static void eventfd_show_fdinfo(struct seq_file *m, struct file *f) seq_printf(m, "eventfd-count: %16llx\n", (unsigned long long)ctx->count); spin_unlock_irq(&ctx->wqh.lock); + seq_printf(m, "eventfd-id: %p\n", ctx); } #endif -- 2.17.2