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 7BBFC1552FA; Thu, 13 Feb 2025 14:53:02 +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=1739458382; cv=none; b=cSpsHwdkV+KyD/TNllis+O9D/qXrI5W7+g9rS4xkA47A38g5nnmfOZKQtkSvJM4kaop8y0Bygvx2nLhI6TW0Q5VdhBvJCTQvL7x1KhKBaA0eOCZrOq6AlRA3bIdpsYpI5K5+Ks9Mrvpz+dAIS1kYiYtH/8WwNxTR2X5gGDW2l3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739458382; c=relaxed/simple; bh=YhnzgHIEaBmiZ7aGfZnXwRNAgkDJQOoH0sGxydZyw9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qya8S8A351RjXdmg3QlxHo43um1IelUrBVMkZgcy1aIXslQUfRCm0zWYQYElwdvHydlK6JyFsf1c1CRnqR5pU9uuhyp6e7dWWk4QIqzeTvGdlMVXkr4EwquFiFvHCzrEfns608BpIRyGow6ITtEfE7AgxZLqjowjVF7DuvFGjYM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=D434cU3l; 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="D434cU3l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8815BC4CED1; Thu, 13 Feb 2025 14:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1739458382; bh=YhnzgHIEaBmiZ7aGfZnXwRNAgkDJQOoH0sGxydZyw9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D434cU3liKgleC9ujLNseRSBFG83AYxoifA4m5lT6iBDMAZhCz74dXtWsTb0cH3f+ sosTtIwndGWnoKJ2PuTEYMnXncbPhyejDiIYY2yKRo1mdleXsRfOkE1XV7Be93DsgG P5Esv1HI+fTAKYVEd6OgkS9zjlOKF8trX6xgsDyE= 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.12 384/422] rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads Date: Thu, 13 Feb 2025 15:28:53 +0100 Message-ID: <20250213142451.365406555@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250213142436.408121546@linuxfoundation.org> References: <20250213142436.408121546@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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 @@ -1091,12 +1091,15 @@ timerlat_hist_apply_config(struct osnois } } - 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;