lkml.org 
[lkml]   [2021]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V3 6/9] trace/hwlat: Use the generic function to read/write width and window
From
Date
On 6/3/21 11:27 PM, Steven Rostedt wrote:
> On Fri, 14 May 2021 22:51:15 +0200
> Daniel Bristot de Oliveira <bristot@redhat.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

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
>
>

\
 
 \ /
  Last update: 2021-06-04 18:38    [W:0.049 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site