From patchwork Tue Jan 7 14:48:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 13929118 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 05C401F0E25 for ; Tue, 7 Jan 2025 14:50:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736261442; cv=none; b=InJD5b/zfkLXoHzcE+/QNABaRo3hvU/902RFwFsZO/Wmk9Hp8sZuw37EyycPJ2jrs1P95G/LwAyU2OUByR/GZiY8p4z/9wcWlPw1IW6QqwX+mEF9jGUPb/G/T1+kxxEaAxKG5s8hMMoWz32LopTlJS5iaV4LBHBUFjFqsOZHYhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736261442; c=relaxed/simple; bh=yWJNeLUlUwSkJjpwIh1lxy4NhW8QzCWxVfdVz1RS7ZY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AvLAuQLVsR2ieU8qZcoB/SdvckWCrY2XsnNCptDdkNhTFPZnGD4S7SmMLFM3JeU8uBMsJ2JgdXNHj3yx5pvDxfLfo0rOzLTWd20Bny0bdaS7F7KFSEeWI28DwScg6MbWD5XTPKSiocGOewfB5BPPn8y8OkqQNB1jzQ4NGpgQNoo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PrJCCQjo; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PrJCCQjo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736261439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NM0ibh4ovGXHvVLVyF/bSYQFn1AYBfBKeO4PWD9Syis=; b=PrJCCQjoUquiFozwid3zcjPt+aakfMWOAQ5UzbCjRLEDpxwWV0KFLsgt//S+wz1Nleg5Bb FZ1iLRw4TAA5auyHIBu5tdhUMJBZh2BVtmSSkasG9EZ027YhDpFuaOT06yNElN/3ebo+te H4B2loB5qDytq8lHoau6h1Ns9aLKw/k= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-250-wqNov7CjNkqUSEe-QgB86A-1; Tue, 07 Jan 2025 09:50:36 -0500 X-MC-Unique: wqNov7CjNkqUSEe-QgB86A-1 X-Mimecast-MFC-AGG-ID: wqNov7CjNkqUSEe-QgB86A Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 279DC1956057; Tue, 7 Jan 2025 14:50:35 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.159]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3B339195609D; Tue, 7 Jan 2025 14:50:32 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, John Kacur , Luis Goncalves , Tomas Glozar Subject: [PATCH 1/3] rtla/osnoise: Distinguish missing workload option Date: Tue, 7 Jan 2025 15:48:21 +0100 Message-ID: <20250107144823.239782-2-tglozar@redhat.com> In-Reply-To: <20250107144823.239782-1-tglozar@redhat.com> References: <20250107144823.239782-1-tglozar@redhat.com> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 osnoise_set_workload returns -1 for both missing OSNOISE_WORKLOAD option and failure in setting the option. Return -1 for missing and -2 for failure to distinguish them. Cc: stable@vger.kernel.org Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/osnoise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tracing/rtla/src/osnoise.c b/tools/tracing/rtla/src/osnoise.c index 245e9344932b..699a83f538a8 100644 --- a/tools/tracing/rtla/src/osnoise.c +++ b/tools/tracing/rtla/src/osnoise.c @@ -867,7 +867,7 @@ int osnoise_set_workload(struct osnoise_context *context, bool onoff) retval = osnoise_options_set_option("OSNOISE_WORKLOAD", onoff); if (retval < 0) - return -1; + return -2; context->opt_workload = onoff; From patchwork Tue Jan 7 14:48:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 13929119 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 D2E521F2370 for ; Tue, 7 Jan 2025 14:50:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736261444; cv=none; b=Dq4T7rzesAVB1KP6u7HP6XVrFFMETbEjYTpRi/0KlaUF8AC7NivnRCNVGaOx5Qaop7IqkvCvo1DLgaxgZvhJau1sB22io4ohdETKII/DZLrAr64nqsv7cyArZcSAQ7op7gb1j2urcS/5gowgusZN8MCI6OJdZUhK9VuDM0iM8+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736261444; c=relaxed/simple; bh=w0c3rNLDyxO6JHtLQmyOE++mY8R4pmsFiFv3QAnGGpw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kkP175byFpIlTo5yNdS3EXG9ztcecTiU2Mnp5oxzpscqZ1SIJiviBdo2jnr6MQyIhR2EenjCYrDkGpeDBTQ92djK2ppCqgSYmaEvcNLSNTVseXfGu8VtclwUyiF53TQgLteH/gnw1cELIm0vMZxbCDpZyaw38TmmOlEttDq44Os= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VpzLUgfd; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VpzLUgfd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736261442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nqf+2O72YPOi9tYokBhg/rAaOaHnIjswD4gdhGy2+dg=; b=VpzLUgfdO0y1BMj+aTNq1/nrmIMvkaqsMFSh53rnz1e5AvaSaQ7g2v6xMGZNQ1ey0d2SPj XdRxpQLgi+Dal2pj7U/zCbIWE0FmFTvVhjQGM365o4NvYuA54J9hUXZH0DCu3pUp4PU88B qwqTGukusRMMRP/nB797QnjwQzSfmqs= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-261-pXFpWcSgMw6eMUXXtjQnPg-1; Tue, 07 Jan 2025 09:50:38 -0500 X-MC-Unique: pXFpWcSgMw6eMUXXtjQnPg-1 X-Mimecast-MFC-AGG-ID: pXFpWcSgMw6eMUXXtjQnPg Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 742431955F65; Tue, 7 Jan 2025 14:50:37 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.159]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 917CE1956088; Tue, 7 Jan 2025 14:50:35 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, John Kacur , Luis Goncalves , Tomas Glozar Subject: [PATCH 2/3] rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads Date: Tue, 7 Jan 2025 15:48:22 +0100 Message-ID: <20250107144823.239782-3-tglozar@redhat.com> In-Reply-To: <20250107144823.239782-1-tglozar@redhat.com> References: <20250107144823.239782-1-tglozar@redhat.com> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 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 Fixes: ed774f7481fa ("rtla/timerlat_hist: Add timerlat user-space support") Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/timerlat_hist.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c index 4403cc4eba30..66dbc034bdc7 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -1100,12 +1100,15 @@ timerlat_hist_apply_config(struct osnoise_tool *tool, struct timerlat_hist_param } } - 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; From patchwork Tue Jan 7 14:48:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 13929120 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 168A41F2C59 for ; Tue, 7 Jan 2025 14:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736261447; cv=none; b=XEKD7OX9OcqCbGL4IYQOVYTt8Qff6Ujc9wZyr5x74r7PkQp1lvXeInv679uethDkEMy3uUWKOSed0FYwodDOl9tQl9xQIS0hyA0N+KqZLE3+reHceiT625T+wTxW2KtCQmr5m2GxqIdnTcxtKlg2C5jOrZOdmT1bWv9GVZRe/js= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736261447; c=relaxed/simple; bh=JFHwV3rqAhje+xFwmQcHy9oSgigK/8RdGCoLPRcD5Ro=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PvN+Uy4sYasMkwH1yscrs60i93phT0GRO6TFW+ZctKutiOzYbXPvO3JsU9nbC8pq1wkSnHPOfD3pbivUvThJ8Gqgbz91z6IDYrdzL3tL+GC76HS8klkCV3jnmk9G0xTyzd7J4tOMXpXIDmOFBrt2hkLuaF+n6gHh2qCTFIsErMc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cHuoYei2; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cHuoYei2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736261445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p2N17mINbCXI2IZHsY3as/nDrVkZy95kpKV0uMugEi0=; b=cHuoYei2W7VrtIevIdt0Z3D+Wi73EOJsR/faLtwhQji63YpdmYlS0qSl3TR1CoidKD0aed A0hO2uqFHlAxyMSm5eBuER1CFXF70XMqQgEH9Qt9JbmCRw8hTv8lJSd5HKGp9m2TzhZs+3 oGYpoYyGh7PFEIy45sIZQ0hhDu4w97A= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-215-BN1CTcmRP9KOrEZHFfrhDA-1; Tue, 07 Jan 2025 09:50:42 -0500 X-MC-Unique: BN1CTcmRP9KOrEZHFfrhDA-1 X-Mimecast-MFC-AGG-ID: BN1CTcmRP9KOrEZHFfrhDA Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2E4AD19560B3; Tue, 7 Jan 2025 14:50:40 +0000 (UTC) Received: from fedora.brq.redhat.com (unknown [10.43.17.159]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E07111956088; Tue, 7 Jan 2025 14:50:37 +0000 (UTC) From: Tomas Glozar To: Steven Rostedt Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, John Kacur , Luis Goncalves , Tomas Glozar Subject: [PATCH 3/3] rtla/timerlat_top: Set OSNOISE_WORKLOAD for kernel threads Date: Tue, 7 Jan 2025 15:48:23 +0100 Message-ID: <20250107144823.239782-4-tglozar@redhat.com> In-Reply-To: <20250107144823.239782-1-tglozar@redhat.com> References: <20250107144823.239782-1-tglozar@redhat.com> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Apply fix from previous commit also to timerlat-top. Cc: stable@vger.kernel.org Fixes: cdca4f4e5e8e ("rtla/timerlat_top: Add timerlat user-space support") Signed-off-by: Tomas Glozar --- tools/tracing/rtla/src/timerlat_top.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c index 059b468981e4..521f9822e747 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -851,12 +851,15 @@ timerlat_top_apply_config(struct osnoise_tool *top, struct timerlat_top_params * } } - if (params->user_top) { - retval = osnoise_set_workload(top->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(top->context, params->kernel_workload); + if (retval < -1) { + err_msg("Failed to set OSNOISE_WORKLOAD option\n"); + goto out_err; } if (isatty(STDOUT_FILENO) && !params->quiet)