Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp247409rdb; Thu, 1 Feb 2024 07:29:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IESLGhTqEGnvGnesYrak2tTxaWjxaXO3MNp0t4qesL0YfsXchGknWz4RkBwk+NwSTtPpxIb X-Received: by 2002:a17:907:b9d6:b0:a35:965d:5988 with SMTP id xa22-20020a170907b9d600b00a35965d5988mr1919128ejc.11.1706801396947; Thu, 01 Feb 2024 07:29:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706801396; cv=pass; d=google.com; s=arc-20160816; b=vfSwHZB+c0rT8poxxYCMFI0GvR2Gk9BxbuLUweOhI4ksxEmFdzuTmfcGNSg/iA8Rtf dPfggaXvNfW6qNpiBE3c24z/7sBD5bDoOctRRhiu0mr27pcySjyJgZ/RSp9okZo5fLsq cO5cG5CKI7Ij4PDnGD0qf1QTbk4JOld8mBDHhARRv3fgwWd3PywjBdP0fsef41tFgHlY /qIejommbPxQOU79xqZVZiaRWQ1QoZzazSinHZZIAo1v2uHR6iA09BY5MOwG6yMiozxk y9KJ9leL5MPzwv4XLd6n0gyDZoAVjQXcy437ny3YAg2opadTsPjKc5vLSotXsQfUavAL fFZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=soETPMX16+JYDJQ+o/kRDyTlbuNEMJ6jEgPq2i8SfIs=; fh=gUJuMDaQKikIycZEpim7o/XM11rFeyzl02Ok3KM9tOg=; b=mioFPRU8KFBywaJC8lhfxHNFPg1fSga8uoQXf4t8dEjJ959DXWd4jvfB/u1d2V92NO LsUqbRHpfAAAi5GpCoDKhYXhIWPHVVrGHmD43EqMQd8fJtML6DxUGWV/bVPK7kZDIMg7 8p+ikRG1L3p/8JzAhF0ZRQtMf+WOSae3rrv9eVHKKvoOMN8RJcHHfN2GkwPFgtI9/n+Q CgsapMxr6lolKsbM/ng7UNEABfL0YoyuJ/Cx9n1YEqTpqCMfomHjh9i789w38QH2VvoC hlgVW8g1IyQAMq/+Ii2+Eqb4J5vklVUZYGK0jO/j1smBxMUDEsQRKUZtKV77hDL5oJvQ gEyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UysrzrXq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-48408-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48408-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCU1z0oInFCNgKLjIIvjc3DhlA7KhNLf/NRFaSTgDHkldbTLAdHlqX4/qj/Muid5OsoJgw5INBv+gx1wrME0BNafKOAve8FVKTfo6IE7Nw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id yk18-20020a17090770d200b00a3124a632fbsi6638544ejb.838.2024.02.01.07.29.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 07:29:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48408-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UysrzrXq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-48408-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48408-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B10741F2BE7B for ; Thu, 1 Feb 2024 15:29:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D2C4779E5; Thu, 1 Feb 2024 15:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UysrzrXq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D2F962166; Thu, 1 Feb 2024 15:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801246; cv=none; b=IPxDOGoztjPqLAgrkcblUUOMnE0MSTkn5J6+ddIRdCDnWSZb6qbzdtqLU46Tbdz2jq79SPwaINXoZbAgK3Qcfruhdgb8L2He0o1fukPmfeXNL2FfvI6hEBGQGWmblo5agHUDl911ab40r/GQNXTu2hlZJypnsJttO/61ynj9u6E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801246; c=relaxed/simple; bh=J4oACJ7K02dl5yARmR3wThXfdDqsUmklZwHWhRZPSAQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=to88ZmmDc6xUPHZuKpKaEYx7IknfqCwKpa8nENhESH4PVhg63EEFpx6ZPmouECITU2pNg5vemj6JY5MnBX1uMOKBAqHd5jk7FAEcumxsiimxgekosyGhHTu+XiXprWWHHWlkJAP0sTvTIx7n96Mbjo+oEh5bcEUFMz0+N3XsEEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UysrzrXq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFDE5C433C7; Thu, 1 Feb 2024 15:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706801246; bh=J4oACJ7K02dl5yARmR3wThXfdDqsUmklZwHWhRZPSAQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=UysrzrXqbkN/eYckVeuBK8QLFf3oKCyaE5jk5aKqffI5wKVIHHGZYq7HdvPfkt9HP TrHxL8Q7SmNs8sVFV8HmLJVGfHgE0G4E1mpRc6GWGveRktupuD4fUAl0jo+VrH36Wn uD6vNQ/BzHFBwz31OKvv7SbNgL+j8DKLYAfOahQ4FsZh6TmWa9xixHW1lEaQdlmmuL yvRqCWTymTvXjQB6Q42UCQ1Y4MKMscptPFzyDiNM7htsgKKimeG1u5IaeQ9Sa2ZKrB kzcUKuqq4a3Y1r0Nr/rx3fSPtIL4WH30ScoiXxxXfLaubFQht9JU/4RI5S6w+uS6HH Q8ulzLDRWjDSQ== Message-ID: <88ffd0ec-ef43-4b26-9314-207606291af3@kernel.org> Date: Thu, 1 Feb 2024 16:27:22 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] tracing/timerlat: Move hrtimer_init to timerlat_fd open() To: Steven Rostedt Cc: Masami Hiramatsu , Mathieu Desnoyers , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, stable@vger.kernel.org References: <7324dd3fc0035658c99b825204a66049389c56e3.1706798888.git.bristot@kernel.org> <20240201102526.755de868@gandalf.local.home> Content-Language: en-US, pt-BR, it-IT From: Daniel Bristot de Oliveira In-Reply-To: <20240201102526.755de868@gandalf.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/1/24 16:25, Steven Rostedt wrote: > On Thu, 1 Feb 2024 16:13:39 +0100 > Daniel Bristot de Oliveira 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 >> --- >> 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); >> >