From mboxrd@z Thu Jan 1 00:00:00 1970 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 53B2D202F9A; Thu, 13 Feb 2025 15:35:19 +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=1739460919; cv=none; b=EVXXqSYm66iKDCVXjqXuxcBgE60N/trDZ+mIBXpZITh2MKVzddptJreDPBbCY2RdkzkM2ZRQS4W19EqAnHSLP2MJEo1a4iWXxjGZSoT5AhYafyN3x47eiOhOq4o1oSBtvXEWtJ1yc+hkQTywXqYS/h3CpVCjVqnXLjuh7i+kXtE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739460919; c=relaxed/simple; bh=x4jyQyZ9xd+iWD4HOW2uSVZ/JFuS6cF3G7Jy8mXoBKI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OyQvILzVLKFfPZ8YnDoYOBjBKY/SVmylAX0YCnpAJHwwfx6XFBVqx2nTfS3oO4nGFZlbXGyNmeSQNZ5PoiJ/MZ1cDM4hzl4BGfAjwzFlL4+LSYraKVRZ8w3qmlv5lAxp5HpqKBe6qydSlyxKQQRYdD1DggtmR4lCTU7ssUlu5eY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NNv3eV9V; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NNv3eV9V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4525C4CEE4; Thu, 13 Feb 2025 15:35:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1739460919; bh=x4jyQyZ9xd+iWD4HOW2uSVZ/JFuS6cF3G7Jy8mXoBKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NNv3eV9VpKznBAKEwBL1cYxuwvcUWDfHqlo+KVoADd0NQAsB+1Cx3nY7kn++4bOEj MuueW0foTTIdnAQnSHe+QMI67PiIx6oFlSHaS+2yOcEmG0nEWVsvm7tx0jgGxmuPda QsdujpmXAJuPopt+4e30CN/4jndthw7gx4JCib8Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, John Kacur , Luis Goncalves , Tomas Glozar , "Steven Rostedt (Google)" Subject: [PATCH 6.6 251/273] rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads Date: Thu, 13 Feb 2025 15:30:23 +0100 Message-ID: <20250213142417.348299043@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250213142407.354217048@linuxfoundation.org> References: <20250213142407.354217048@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tomas Glozar commit d8d866171a414ed88bd0d720864095fd75461134 upstream. When using rtla timerlat with userspace threads (-u or -U), rtla disables the OSNOISE_WORKLOAD option in /sys/kernel/tracing/osnoise/options. This option is not re-enabled in a subsequent run with kernel-space threads, leading to rtla collecting no results if the previous run exited abnormally: $ rtla timerlat hist -u ^\Quit (core dumped) $ rtla timerlat hist -k -d 1s Index over: count: min: avg: max: ALL: IRQ Thr Usr count: 0 0 0 min: - - - avg: - - - max: - - - The issue persists until OSNOISE_WORKLOAD is set manually by running: $ echo OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options Set OSNOISE_WORKLOAD when running rtla with kernel-space threads if available to fix the issue. Cc: stable@vger.kernel.org Cc: John Kacur Cc: Luis Goncalves Link: https://lore.kernel.org/20250107144823.239782-3-tglozar@redhat.com Fixes: ed774f7481fa ("rtla/timerlat_hist: Add timerlat user-space support") Signed-off-by: Tomas Glozar Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- tools/tracing/rtla/src/timerlat_hist.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -900,12 +900,15 @@ timerlat_hist_apply_config(struct osnois auto_house_keeping(¶ms->monitored_cpus); } - if (params->user_hist) { - retval = osnoise_set_workload(tool->context, 0); - if (retval) { - err_msg("Failed to set OSNOISE_WORKLOAD option\n"); - goto out_err; - } + /* + * Set workload according to type of thread if the kernel supports it. + * On kernels without support, user threads will have already failed + * on missing timerlat_fd, and kernel threads do not need it. + */ + retval = osnoise_set_workload(tool->context, params->kernel_workload); + if (retval < -1) { + err_msg("Failed to set OSNOISE_WORKLOAD option\n"); + goto out_err; } return 0;