Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1241595pxj; Fri, 4 Jun 2021 09:21:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOftLj0hWcxvpyBU+PZEm91eENZKUrqnEtFN2JRO8/TzgOuzhRQ7ytEyaL62iYk7BAzHzz X-Received: by 2002:a05:6402:2317:: with SMTP id l23mr5588788eda.265.1622823695170; Fri, 04 Jun 2021 09:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622823695; cv=none; d=google.com; s=arc-20160816; b=f/1MeDAgawA68vaGauvyvouiQp6uU+MmAG5PcQuxB4tt0ZKq3yGi7vWw45GhjkqIMO Nw2544tzXOOxmK0dE5nH7ClUhkl2LcQCn41AZgTVSd9RuXN5poaKKMz3bmByn42iknwP QE3eQm1IOMWNGJ8GFhDwGLNEEcDvmKDV+5yGgIZhUFQEj2paV2L4oe5IfjMihIq5xNqr xVoyvWBK0g2eKLrtGMUDK+sD/LZJRMqNKLyCZAewV5vhDh87aA5xvYV3c0zZNhk3vEoL uxAhn8P4gcoXuNcdzkWFlrM7e0J0/4BZqAhdeUn2EelhOMFx0/W06S2e1+x0V55uX9sO hdEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=pqv315pxYnksdXdfvIYSUzpeS7IUo/92uEp+gQ5i48w=; b=gqxx1kv5OLDQryAC5VvufafmUFw40zrddVSQKQacteH5sqm+AMNgZkxFGaDUGbtXFF l3nmYpGPvVv5i6XpkCCmzbS++Z6hcE6EuQmFlG98IT80jgSFMjS2AsOY4fXxMOSFsvLL RlLe2JrkiE4TBKGVqS0PJ7WOUw83n8XQZ4ScZi1xODXrebrctGQCN5YpJ2edq2D9FeGc e6Im8XgqZUPy6bCSyyZ/IbLgUGJoLOWGnydHfWecT9v0S6wzZa+5UxgsdyizlNBdAXpp Tg1pPMEEkitOT1sUTvOpQOU+AYlKJ6hJxHoOJnZgpjvJofaNgj4MKbBPPhWh0nsHMtfD UvQQ== ARC-Authentication-Results: i=1; mx.google.com; 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 t16si6085887edi.147.2021.06.04.09.21.11; Fri, 04 Jun 2021 09:21:35 -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; 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 S230426AbhFDQTw (ORCPT + 99 others); Fri, 4 Jun 2021 12:19:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:38296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230201AbhFDQTw (ORCPT ); Fri, 4 Jun 2021 12:19:52 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 83190613FF; Fri, 4 Jun 2021 16:18:04 +0000 (UTC) Date: Fri, 4 Jun 2021 12:18:02 -0400 From: Steven Rostedt To: Daniel Bristot de Oliveira Cc: linux-kernel@vger.kernel.org, Phil Auld , Sebastian Andrzej Siewior , Kate Carcia , Jonathan Corbet , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Alexandre Chartre , Clark Willaims , John Kacur , Juri Lelli , linux-doc@vger.kernel.org Subject: Re: [PATCH V3 5/9] tracing/trace: Add a generic function to read/write u64 values from tracefs Message-ID: <20210604121802.192caa07@oasis.local.home> In-Reply-To: References: <20210603172244.6d2a6059@gandalf.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 4 Jun 2021 18:05:06 +0200 Daniel Bristot de Oliveira wrote: > > The reason for this patch is that hwlat, osnoise, and timerlat have "u64 config" > options that are read/write via tracefs "files." In the previous version, I had > multiple functions doing basically the same thing: > > A write function that: > read a u64 from user-space > get a lock, > check for min/max acceptable values > save the value > release the lock. > > and a read function that: > write the config value to the "read" buffer. > > And so, I tried to come up with a way to avoid code duplication. > > question: are only the names that are bad? (I agree that they are bad) or do you > think that the overall idea is bad? :-) > > Suggestions? I don't think the overall idea is bad, if it is what I think you are doing. I just don't believe you articulated what you are doing. It has nothing to do with 64 bit reads and writes, but instead has to do with reading and writing values that depend on each other for what is acceptable. Perhaps have it called trace_min_max_write() and trace_min_max_read(), and document what it is used for. -- Steve