Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2780139pxa; Fri, 7 Aug 2020 22:44:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFo7hmChYA7kC2eb1GndNWMLURxbksACjpVoxRpCIbzvq1kY1Z1fJV3pecIoqUBTVUSG2k X-Received: by 2002:aa7:d350:: with SMTP id m16mr11773007edr.169.1596865480791; Fri, 07 Aug 2020 22:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596865480; cv=none; d=google.com; s=arc-20160816; b=ZURvWoRP1Dth9GLS6EG0cMoLxWpNlxQiTVq0qMxrw8+ZMkdP8RHGfaJMBFZXZHxsFD tqbIkeaeMidodVMY+P9Z+z/G2K36XnlaMQKHeqsEysKArfTqjz/0CTrTNPVSBOfppJaJ KWkkx+QyBCCyJHtouzID54qrd3giqEOnwQ1Yxb7o0ks7QGO90C4dNdyjI47UlGNNWcvM xxZ7+77ZYc5GAazla7+V9v0g6xBmKd1xZvUQ+D5F4eT4Z5cpAQKP6TF5QIu5XmWaJuvP 4adzRvi3cCL4sk++WgKn8dfUd84VHKXcwzpp7751A8aHqxp6Jx667tk6p5JNN06n30Oq 9EjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jDBf/IUVVChPi1FiB/JkvMCEmRQBLPNF5s7WtTHVCy0=; b=nhAEXtoYAjTJkm2dNRUsWVojgvfq1J/tXaC9Kz0vQKkzDmiRRaKevt3O14nMtm4Oxt zWddo4wnpP62ZlBtzsbDH4ITHdqRr/bLJsTwYOQoiA4yVfUbs28TPAfib/QKPpkeMyp4 MiT+isLxnMA+YfYGQ4d8h2EE/KzQIsbzNAKSgbnKD0F7UXoDEqMw6ELNfCBs1a9DreuB p5fW+aRABRUICkkd6CG90+xy28cxvzof1Hj7VzJDlX+L6Hkwsd3WfiwfNjHm7wo9qcmg ALuFzYeu6FAU08pd5aD36kQl/YR89FjN/mtyHQ0Io9fxnjUXo6D48gtOEbNAz0aK5rTU 8QrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Po+8Wm8v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b23si6721867ejv.299.2020.08.07.22.44.17; Fri, 07 Aug 2020 22:44:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Po+8Wm8v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726442AbgHHFnJ (ORCPT + 99 others); Sat, 8 Aug 2020 01:43:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:55138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725786AbgHHFnH (ORCPT ); Sat, 8 Aug 2020 01:43:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 647B42177B; Sat, 8 Aug 2020 05:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596865387; bh=Gow8EnzM5fWfP3mZhZVoa+SnXxaXlDH20QUzxm9L8Ck=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Po+8Wm8vqO79Mbwdrc9oYj/ZjXH8UYIQlB75Tym7cJdAsxCHiT3ndt4kHE/UNWOOg DGLbs+XQu2rxgSUwRDu4QYed8QKt6M+mYUSgvQnh765NtNXmKa6e7p/exOH7MiwuuV qPD8yYGq0qaNm6j5iT7ehaVy46MHURCIjAXaBhUA= Date: Sat, 8 Aug 2020 07:43:04 +0200 From: Greg KH To: Jonathan Adams Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Jim Mattson , David Rientjes Subject: Re: [RFC PATCH 2/7] core/metricfs: add support for percpu metricfs files Message-ID: <20200808054304.GC1037591@kroah.com> References: <20200807212916.2883031-1-jwadams@google.com> <20200807212916.2883031-3-jwadams@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200807212916.2883031-3-jwadams@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 07, 2020 at 02:29:11PM -0700, Jonathan Adams wrote: > Add a simple mechanism for exporting percpu data through metricfs. > The API follows the existing metricfs pattern. A percpu file is > defined with: > > METRIC_EXPORT_PERCPU_INT(name, desc, fn) > METRIC_EXPORT_PERCPU_COUNTER(name, desc, fn) > > The first defines a file for exposing a percpu int. The second is > similar, but is for a counter that accumulates since boot. The > 'name' is used as the metricfs file. The 'desc' is a description > of the metric. The 'fn' is a callback function to emit a single > percpu value: > > void (*fn)(struct metric_emitter *e, int cpu); > > The callback must call METRIC_EMIT_PERCPU_INT with the value for > the specified CPU. > > Signed-off-by: Jonathan Adams > > --- > > jwadams@google.com: rebased to 5.6-pre6, renamed funcs to start with > metric_. This is work originally done by another engineer at > google, who would rather not have their name associated with this > patchset. They're okay with me sending it under my name. > --- > include/linux/metricfs.h | 28 +++++++++++++++++++ > kernel/metricfs.c | 58 ++++++++++++++++++++++++++++++++++++---- fs/metricfs/ ? This isn't a kernel "core" feature. Or just put it in fs/debugfs/ and tack it along with one of the debugfs helper functions to make it easier for everyone to use these (if they actually are valuable. It's hard to see how this differs from any other debugfs interface today. thanks, greg k-h