From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C4B1C47425 for ; Fri, 4 Jun 2021 16:37:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DBC1611AE for ; Fri, 4 Jun 2021 16:37:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231488AbhFDQiu (ORCPT ); Fri, 4 Jun 2021 12:38:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30909 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbhFDQiu (ORCPT ); Fri, 4 Jun 2021 12:38:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622824623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2R95iU+K6VJS0ggs/ypSJ0kttHe2HN6yW0DLVhKPBKU=; b=Dfx1AeIx5GWkdrALDIBlWT0aIM5ds3Jf4VjIPUq8cVUpEutJiFp1OOYp+UP7hzzHtxWCm8 zLhXYk3QxF/hkCabveLQWr2BW271cmauq68OHFE+Jroa1RwO/lLTqvCjpDchuy1OI6yMsj sXk5TifcKLyLpT+loCXmKY3DFgGAD4E= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-169-4G2kOeqqNEGeBNBPmE0RHw-1; Fri, 04 Jun 2021 12:37:01 -0400 X-MC-Unique: 4G2kOeqqNEGeBNBPmE0RHw-1 Received: by mail-ej1-f72.google.com with SMTP id w1-20020a1709064a01b02903f1e4e947c9so2199110eju.16 for ; Fri, 04 Jun 2021 09:37:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2R95iU+K6VJS0ggs/ypSJ0kttHe2HN6yW0DLVhKPBKU=; b=IEm07vnhopLFgTdp4fcIL0g287jZnap/G0fPIfehlfLaWqOsZclKQjzrnUUCvpgslQ ajQsNRR6FDoc9lC7rc37m8IJkrH6b3DXrAa3pGkz4Dz2y/yUaJimyGvARCcF8lZhVoYb RoWlC1HXadlpYkR5x1N+F0VhweW8J1scAitKhJ4+N2xkmzjhbusnv22PPfD/nL6uqPeA fR9r8lxzABlWVa5P1Ommn7r0vdu8u4BJ33x4KH9yg770ZdbGukopGmCaCInLuILY8iNU TRNyLrcyDrMe0Mgd8uVUioQ0L6tdZ8ilICrpN8mCpbVd3fwWZo0egBu8fUzOaFQmCdsE AQ6Q== X-Gm-Message-State: AOAM533QcWAViNC11AiKijoSBcK3PaK8Sr4Ok0dKxjKFOQzNVPLLhuDg /6oBST6PwYWtPWsAGxSuFWx5FAz11aIy8jtIrAIAeQREUIdRT4+6+ny+xd7B71faeH4K/8AIk04 1hV9T06iAeT4+pXgGaCv0vgJd X-Received: by 2002:a17:906:6ad0:: with SMTP id q16mr5186951ejs.286.1622824620639; Fri, 04 Jun 2021 09:37:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJ2lBK6941HhBBh1FNI1m4A4fIxSF+XsHILdiZPZ0kTehu2311HmaloLU/AMMJ4NuWvimtsg== X-Received: by 2002:a17:906:6ad0:: with SMTP id q16mr5186937ejs.286.1622824620487; Fri, 04 Jun 2021 09:37:00 -0700 (PDT) Received: from x1.bristot.me (host-79-24-6-4.retail.telecomitalia.it. [79.24.6.4]) by smtp.gmail.com with ESMTPSA id v23sm3559032eds.25.2021.06.04.09.36.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Jun 2021 09:37:00 -0700 (PDT) Subject: Re: [PATCH V3 6/9] trace/hwlat: Use the generic function to read/write width and window To: Steven Rostedt 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 References: <20210603172709.25c322a1@gandalf.local.home> From: Daniel Bristot de Oliveira Message-ID: <4ff9f435-9932-f555-9f19-65f92041950e@redhat.com> Date: Fri, 4 Jun 2021 18:36:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210603172709.25c322a1@gandalf.local.home> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/3/21 11:27 PM, Steven Rostedt wrote: > On Fri, 14 May 2021 22:51:15 +0200 > Daniel Bristot de Oliveira wrote: > >> @@ -733,16 +624,18 @@ static ssize_t hwlat_mode_write(struct file *filp, const char __user *ubuf, >> return ret; >> } >> >> -static const struct file_operations width_fops = { >> - .open = tracing_open_generic, >> - .read = hwlat_read, >> - .write = hwlat_width_write, >> +static struct trace_ull_config hwlat_width = { >> + .lock = &hwlat_data.lock, >> + .val = &hwlat_data.sample_width, >> + .max = &hwlat_data.sample_window, >> + .min = NULL, >> }; >> >> -static const struct file_operations window_fops = { >> - .open = tracing_open_generic, >> - .read = hwlat_read, >> - .write = hwlat_window_write, >> +static struct trace_ull_config hwlat_window = { > Yeah, the naming convention needs to be changed, because ull_config is > meaningless, and this code makes no sense. I know what it is doing, but if > I didn't, I'd have no clue what it was doing by reading it. :-p I will rework the patch 5/9 to add a better explanation for the read/write functions, and I will add comments to this patch, explaining the reason for the min/max values. Sound good? -- Daniel > -- Steve > >