From: Daniel Bristot de Oliveira <bristot@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] tracing/timerlat: Move hrtimer_init to timerlat_fd open()
Date: Thu, 1 Feb 2024 16:27:22 +0100 [thread overview]
Message-ID: <88ffd0ec-ef43-4b26-9314-207606291af3@kernel.org> (raw)
In-Reply-To: <20240201102526.755de868@gandalf.local.home>
On 2/1/24 16:25, Steven Rostedt wrote:
> On Thu, 1 Feb 2024 16:13:39 +0100
> Daniel Bristot de Oliveira <bristot@kernel.org> wrote:
>
>> Currently, the timerlat's hrtimer is initialized at the first read of
>> timerlat_fd, and destroyed at close(). It works, but it causes an error
>> if the user program open() and close() the file without reading.
>>
>> Move hrtimer_init to timerlat_fd open() to avoid this problem.
>>
>> No functional changes.
>
> It can't be fixing something and not have any functional changes.
>
> No functional changes means the code is restructured but the resulting
> assembly would be the same.
>
> Like moving functions around in a file so that you don't need extra
> prototype declarations.
>
> Please only add "No functional changes" if the function's assembly would be
> the same.
ok
>>
>> Fixes: e88ed227f639 ("tracing/timerlat: Add user-space interface")
>
> With a fixes tag, I'm assuming his should go into v6.8 with a Cc stable?
right, I added it on Cc, but did not include the Cc:.. tag. It seems that I should have.
-- Daniel
> -- Steve
>
>
>> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
>> ---
>> kernel/trace/trace_osnoise.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
>> index bd0d01d00fb9..a8e28f9b9271 100644
>> --- a/kernel/trace/trace_osnoise.c
>> +++ b/kernel/trace/trace_osnoise.c
>> @@ -2444,6 +2444,9 @@ static int timerlat_fd_open(struct inode *inode, struct file *file)
>> tlat = this_cpu_tmr_var();
>> tlat->count = 0;
>>
>> + hrtimer_init(&tlat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD);
>> + tlat->timer.function = timerlat_irq;
>> +
>> migrate_enable();
>> return 0;
>> };
>> @@ -2526,9 +2529,6 @@ timerlat_fd_read(struct file *file, char __user *ubuf, size_t count,
>> tlat->tracing_thread = false;
>> tlat->kthread = current;
>>
>> - hrtimer_init(&tlat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD);
>> - tlat->timer.function = timerlat_irq;
>> -
>> /* Annotate now to drift new period */
>> tlat->abs_period = hrtimer_cb_get_time(&tlat->timer);
>>
>
next prev parent reply other threads:[~2024-02-01 15:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 15:13 [PATCH] tracing/timerlat: Move hrtimer_init to timerlat_fd open() Daniel Bristot de Oliveira
2024-02-01 15:25 ` Steven Rostedt
2024-02-01 15:27 ` Daniel Bristot de Oliveira [this message]
2024-02-01 15:44 ` Greg KH
2024-02-01 16:02 ` Daniel Bristot de Oliveira
2024-02-01 16:10 ` Steven Rostedt
2024-02-01 18:05 ` Greg KH
2024-02-01 18:08 ` Steven Rostedt
2024-02-01 18:12 ` Greg KH
2024-02-01 18:24 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=88ffd0ec-ef43-4b26-9314-207606291af3@kernel.org \
--to=bristot@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).