lkml.org 
[lkml]   [2021]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V3 5/9] tracing/trace: Add a generic function to read/write u64 values from tracefs
From
Date
On 6/4/21 6:18 PM, Steven Rostedt wrote:
> On Fri, 4 Jun 2021 18:05:06 +0200
> Daniel Bristot de Oliveira <bristot@redhat.com> 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.

I see!

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

yeah, that is a better (starting point for an) explanation.

> Perhaps have it called trace_min_max_write() and trace_min_max_read(),
> and document what it is used for.

I will do that!

-- Daniel

> -- Steve
>

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