[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210603172709.25c322a1@gandalf.local.home>
Date: Thu, 3 Jun 2021 17:27:09 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Daniel Bristot de Oliveira <bristot@...hat.com>
Cc: linux-kernel@...r.kernel.org, Phil Auld <pauld@...hat.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Kate Carcia <kcarcia@...hat.com>,
Jonathan Corbet <corbet@....net>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Alexandre Chartre <alexandre.chartre@...cle.com>,
Clark Willaims <williams@...hat.com>,
John Kacur <jkacur@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>, linux-doc@...r.kernel.org
Subject: Re: [PATCH V3 6/9] trace/hwlat: Use the generic function to
read/write width and window
On Fri, 14 May 2021 22:51:15 +0200
Daniel Bristot de Oliveira <bristot@...hat.com> 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
-- Steve
> + .lock = &hwlat_data.lock,
> + .val = &hwlat_data.sample_window,
> + .max = NULL,
> + .min = &hwlat_data.sample_width,
> };
>
> static const struct file_operations thread_mode_fops = {
> @@ -775,15 +668,15 @@ static int init_tracefs(void)
>
> hwlat_sample_window = tracefs_create_file("window", 0640,
> top_dir,
> - &hwlat_data.sample_window,
> - &window_fops);
> + &hwlat_window,
> + &trace_ull_config_fops);
> if (!hwlat_sample_window)
> goto err;
>
> hwlat_sample_width = tracefs_create_file("width", 0644,
> top_dir,
> - &hwlat_data.sample_width,
> - &width_fops);
> + &hwlat_width,
> + &trace_ull_config_fops);
> if (!hwlat_sample_width)
> goto err;
>
Powered by blists - more mailing lists