From nobody Wed Nov 27 06:43:19 2024 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 C2C661B86F7 for ; Fri, 11 Oct 2024 17:30:17 +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=1728667817; cv=none; b=VsdE7P9790zCN4DzB2raiob0zzhGvREqG0wojdWWbR7JoRKdqu6o/EB1Lgb/Wj9+bFPKmNEAOA1K2TpIVxp8PfsGqMHtCutyvoORtwKh/46UIH4KHmg7pCGOTgTtZKcm5oHlsM9WDu3MB8EHwQVcqV55Fv17JL9a/LyH4Y5cM9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728667817; c=relaxed/simple; bh=4imnt4Y1RNNvYUBfcqZKWK5cNTtWSmt7hPOSiP+t3G8=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=q1uXjV6unrhBI1L0rSlpvI83yDij14qRVBuegvVZGRyNXxw6LCDGAd17r9IzfXAPHZPI9Y/u5doCIHqcyiJxfcVEGQ+IzGx5wZ+cA/R5wN167j13Z4ahFojcJ101BRxXHMxKApA0ZtqQq4Ojgm/EoS906U1cBaaRUV7Cz+1wvmk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79B3CC4CEC7; Fri, 11 Oct 2024 17:30:17 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1szJTA-00000001TyN-0DXn; Fri, 11 Oct 2024 13:30:28 -0400 Message-ID: <20241011173027.913282122@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 11 Oct 2024 13:30:11 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Eder Zulian Subject: [for-next][PATCH 1/9] rtla: use the definition for stdout fd when calling isatty() References: <20241011173010.441043942@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Eder Zulian Use the STDOUT_FILENO definition when testing whether the standard output file descriptor refers to a terminal (for better redability). Link: https://lore.kernel.org/20240813142338.376039-1-ezulian@redhat.com Signed-off-by: Eder Zulian Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/src/osnoise_top.c | 2 +- tools/tracing/rtla/src/timerlat_top.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/= osnoise_top.c index 2f756628613d..66e3a4382bc2 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -627,7 +627,7 @@ osnoise_top_apply_config(struct osnoise_tool *tool, str= uct osnoise_top_params *p auto_house_keeping(¶ms->monitored_cpus); } =20 - if (isatty(1) && !params->quiet) + if (isatty(STDOUT_FILENO) && !params->quiet) params->pretty_output =3D 1; =20 return 0; diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src= /timerlat_top.c index 8c16419fe22a..94a2f5bbaeb7 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -850,7 +850,7 @@ timerlat_top_apply_config(struct osnoise_tool *top, str= uct timerlat_top_params * } } =20 - if (isatty(1) && !params->quiet) + if (isatty(STDOUT_FILENO) && !params->quiet) params->pretty_output =3D 1; =20 return 0; --=20 2.45.2 From nobody Wed Nov 27 06:43:19 2024 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 282FE1BDABD for ; Fri, 11 Oct 2024 17:30:17 +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=1728667818; cv=none; b=Gpf7rSOewBtwhUkhxD4q9wu3Lpb6aM2HUEJ8ha8xtJEW+Wxg0FnnnUuzeNPngF235ay+oDohIo1mlhveyzSUlKlh81Oih/YxgNgz7nlTgu9x6oT8Q7y6XRpIXUtTdgUj2G73+2K7MrOy88LbTZqnfMuH0NHp/DnvI+jKKEDSAh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728667818; c=relaxed/simple; bh=fVc/pKVvn61lDZ3Pcaw+QbONKopItCa+PSXF7ERArW4=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=Qm8pdPVkXGRXU+1RNoLCjiGQrLKLumsE9m4zBosrvxqLXs80zbzl/86Bs8pqbhSBQk/bxuj4z5UJ/3QJWjj7XejeZn5c8r5n6hSuVCIqHgk0AacqRxnQrysJOqusb/oQoTFRcEi1KraHCkPZWq/5cSfdqAJgN40ZlUujC43DktI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B588AC4CECE; Fri, 11 Oct 2024 17:30:17 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1szJTA-00000001Tyr-0sQ7; Fri, 11 Oct 2024 13:30:28 -0400 Message-ID: <20241011173028.071613598@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 11 Oct 2024 13:30:12 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Ba Jing Subject: [for-next][PATCH 2/9] tools/rv: Correct the grammatical errors in the comments References: <20241011173010.441043942@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ba Jing The form of "print" should be consistent with "parses". Link: https://lore.kernel.org/20240902233408.8684-1-bajing@cmss.chinamobile= .com Signed-off-by: Ba Jing Signed-off-by: Steven Rostedt (Google) --- tools/verification/rv/src/in_kernel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/verification/rv/src/in_kernel.c b/tools/verification/rv/= src/in_kernel.c index f04479ecc96c..f2bbc75a76f4 100644 --- a/tools/verification/rv/src/in_kernel.c +++ b/tools/verification/rv/src/in_kernel.c @@ -332,7 +332,7 @@ static void ikm_print_header(struct trace_seq *s) * ikm_event_handler - callback to handle event events * * Called any time a rv:"monitor"_event events is generated. - * It parses and print event. + * It parses and prints event. */ static int ikm_event_handler(struct trace_seq *s, struct tep_record *record, @@ -384,7 +384,7 @@ ikm_event_handler(struct trace_seq *s, struct tep_recor= d *record, * ikm_error_handler - callback to handle error events * * Called any time a rv:"monitor"_errors events is generated. - * It parses and print event. + * It parses and prints event. */ static int ikm_error_handler(struct trace_seq *s, struct tep_record *record, --=20 2.45.2 From nobody Wed Nov 27 06:43:19 2024 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 283811BE251 for ; Fri, 11 Oct 2024 17:30:17 +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=1728667818; cv=none; b=AI2133/agUyitZOCS6pGNjgbplGehoows9GXCXpge6pWk3jE9GCpZJkffOMAbW/tkBUXdUbUo+o2j1UA+HfVayAg477I+pyy+z5gYd+oaxVkk/4LYhYyhB2LY4ODbOAIYnbMc+OKnMx7j+XP2I02sDTJlcBUTojk/pQ01iMBg1k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728667818; c=relaxed/simple; bh=PlkEiro4w2gZi89wqc1QOC1Lc+OcpeuLucwn2WycTqc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=VFOMsP8TKfx8zEKzLFGtw739iV8y8sUvjzUYxx26MO21p9ozagGliRSTap0i4EdVsr64T4iqxig/nDeh/K48BdjXeeE37Qc+N5qTVSpDxC3koxevxCknwPJYOWwVO4w/f7MavYfRZkczT2vz4DmAlIV0ZdjYqM5p4/PGLUaR17w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCA85C4CECF; Fri, 11 Oct 2024 17:30:17 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1szJTA-00000001TzL-1XjL; Fri, 11 Oct 2024 13:30:28 -0400 Message-ID: <20241011173028.229805053@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 11 Oct 2024 13:30:13 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Ba Jing Subject: [for-next][PATCH 3/9] tools/rv: Correct the grammatical errors in the comments[2] References: <20241011173010.441043942@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ba Jing The word "trace" begins with a consonant sound, so "a" should be used instead of "an". Link: https://lore.kernel.org/20240903003019.8969-1-bajing@cmss.chinamobile= .com Signed-off-by: Ba Jing Signed-off-by: Steven Rostedt (Google) --- tools/verification/rv/src/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/verification/rv/src/trace.c b/tools/verification/rv/src/= trace.c index 2c7deed47f8d..1b9f9bfa1893 100644 --- a/tools/verification/rv/src/trace.c +++ b/tools/verification/rv/src/trace.c @@ -81,7 +81,7 @@ void trace_instance_destroy(struct trace_instance *trace) } =20 /** - * trace_instance_init - create an trace instance + * trace_instance_init - create a trace instance * * It is more than the tracefs instance, as it contains other * things required for the tracing, such as the local events and --=20 2.45.2 From nobody Wed Nov 27 06:43:19 2024 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 0E9E61BDAA0 for ; Fri, 11 Oct 2024 17:30:18 +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=1728667818; cv=none; b=MDS0+zoTWkO/6RqTJh5DtuYNxbiO2b4fSxu+ABE2NnCIFyPOm+rEtUKuuCtAf4Z4MYrFBKdMnLcbB2uRSzPJLMWozdWqLktHmY7H0IxfG48kem+ZofAniTXTGIbMwAx8KbiH1aiJk7atam+ZKJmidn3VTULZPm8B1W6PThFrHpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728667818; c=relaxed/simple; bh=8bjnbpyGuTuPAyqYprEmWKu3zOa5bj44HU35eTt/2Fs=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=QaJ6AYpLiqYGb1UcUhT1Uu5yc74+pxq3fXBUxS9H1wDGowNLOVN8titV/QO6FaYxElJTIyB1sb0lQVlZJx5kEC94u+N4B8TMTQgfNR7LUHRJzP6717KUzU7uMh7M55YAAGWRd83LIZbnRqKMISPcnnANwdNNcTe1GXHCCy1t9Ag= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA62EC4CEC3; Fri, 11 Oct 2024 17:30:17 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1szJTA-00000001Tzp-2CYP; Fri, 11 Oct 2024 13:30:28 -0400 Message-ID: <20241011173028.386283930@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 11 Oct 2024 13:30:14 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Masami Hiramatsu , Mathieu Desnoyers , Matthew Wilcox , Andrew Kreimer Subject: [for-next][PATCH 4/9] rv: Fix a typo References: <20241011173010.441043942@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Andrew Kreimer Fix a typo in comments. Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Link: https://lore.kernel.org/20240911114349.20449-1-algonell@gmail.com Reported-by: Matthew Wilcox Signed-off-by: Andrew Kreimer Signed-off-by: Steven Rostedt (Google) --- kernel/trace/rv/rv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/rv/rv.c b/kernel/trace/rv/rv.c index dc819aec43e8..279c70e1bd74 100644 --- a/kernel/trace/rv/rv.c +++ b/kernel/trace/rv/rv.c @@ -41,7 +41,7 @@ * per-task monitor, and so on), and the helper functions that glue the * monitor to the system via trace. Generally, a monitor includes some form * of trace output as a reaction for event parsing and exceptions, - * as depicted bellow: + * as depicted below: * * Linux +----- RV Monitor ----------------------------------+ Formal * Realm | | Realm --=20 2.45.2 From nobody Wed Nov 27 06:43:19 2024 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 34A071BF7FE for ; Fri, 11 Oct 2024 17:30:18 +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=1728667818; cv=none; b=UaS5G/+HD5UIJ13M4tnaifXbxNrOkFUsfMYEyHxnPxU3ZMXzr1foXXENcH6rYKwh+ly/4ih2dxS2GwCt9izR08JTjHLV9kKecbR5nFOQ5eGp9qDXfKeFu9N0752hqAvpELp2Be37iAizQ4YyQl+4bzxGuN5LQwp6YUcW/xYVjb0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728667818; c=relaxed/simple; bh=BNLvL2bN+2RdzPqjhwYAmB84r332uy5578mZl6pDUJo=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=SRPjgfIvNtwzHAMEIx4A+/Ttd3OQ6UmKFH6fKRvuCiL2dihL/pp19WsCtnHwY9m5HVLLX17/uznTd6pFmnac6/xzRvzSb6VcVoFBbHRoba9S/85h7dQuXz1s0kN1EaNWwRZaefj/ccLT0InNIa6MwX7QqvmcPHoLTkj/usFrSyQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AFBAC4CED0; Fri, 11 Oct 2024 17:30:18 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1szJTA-00000001U0J-2skX; Fri, 11 Oct 2024 13:30:28 -0400 Message-ID: <20241011173028.545123657@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 11 Oct 2024 13:30:15 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Luis Goncalves , Gabriele Monaco Subject: [for-next][PATCH 5/9] rtla: Fix consistency in getopt_long for timerlat_hist References: <20241011173010.441043942@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Gabriele Monaco Commit e9a4062e1527 ("rtla: Add --trace-buffer-size option") adds a new long option to rtla utilities, but among all affected files, timerlat_hist misses a trailing `:` in the corresponding short option inside the getopt string (e.g. `\3:`). This patch propagates the `:`. Although this change is not functionally required, it improves consistency and slightly reduces the likelihood a future change would introduce a problem. Cc: John Kacur Cc: Luis Goncalves Cc: Tomas Glozar Link: https://lore.kernel.org/20240926143417.54039-1-gmonaco@redhat.com Signed-off-by: Gabriele Monaco Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/src/timerlat_hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/sr= c/timerlat_hist.c index a3907c390d67..1f9137c592f4 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -778,7 +778,7 @@ static struct timerlat_hist_params /* getopt_long stores the option index here. */ int option_index =3D 0; =20 - c =3D getopt_long(argc, argv, "a:c:C::b:d:e:E:DhH:i:knp:P:s:t::T:uU01234= 56:7:8:9\1\2:\3", + c =3D getopt_long(argc, argv, "a:c:C::b:d:e:E:DhH:i:knp:P:s:t::T:uU01234= 56:7:8:9\1\2:\3:", long_options, &option_index); =20 /* detect the end of the options. */ --=20 2.45.2 From nobody Wed Nov 27 06:43:19 2024 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 A1D3F1C32FF for ; Fri, 11 Oct 2024 17:30:18 +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=1728667818; cv=none; b=gV6q7S040dUob+drBPthpXySvqn1TLo9m87mBfqAWeO8S5uEkq7x/aRcadL2zoEBjuMFGa5y2t6NiSfs58LED9J53ONfgWos/SBwDz/43QFhrliMng9Q2WFTr9JV116BkaFn1JGPwV39g40hPe3yu73cTIFdGWSRvFUyXcBYlr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728667818; c=relaxed/simple; bh=LPb8vhx1hirgUydNin6ofHBo/hHyNae4VbV6wc/CH9k=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=czCiEJQHeb/1nHk1qGSFjnrTvpW4NKpYEDgA0fKNNWyVx0phGSPBy0zNSHp5rjZUR8zRVdQvUrQr1s0G1btCZ3/uncz+NGHRSNYx6NgYyxHqIlIdNFk2IPSnJh0pgywoAhU7kb6CqNmRXr42UHrEJYUa28Vp2OApHWLCLf9itgk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42DDFC4CECE; Fri, 11 Oct 2024 17:30:18 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1szJTA-00000001U0n-3Zd2; Fri, 11 Oct 2024 13:30:28 -0400 Message-ID: <20241011173028.712953047@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 11 Oct 2024 13:30:16 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Jan Stancek Subject: [for-next][PATCH 6/9] tools/rtla: drop __NR_sched_getattr References: <20241011173010.441043942@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jan Stancek It's not used since commit 084ce16df0f0 ("tools/rtla: Remove unused sched_getattr() function"). Link: https://lore.kernel.org/c355dc9ad23470098d6a8d0f31fbd702551c9ea8.1728= 552769.git.jstancek@redhat.com Signed-off-by: Jan Stancek Reviewed-by: Tomas Glozar Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/src/utils.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/tools/tracing/rtla/src/utils.c b/tools/tracing/rtla/src/utils.c index 9ac71a66840c..05b2b3fc005e 100644 --- a/tools/tracing/rtla/src/utils.c +++ b/tools/tracing/rtla/src/utils.c @@ -211,24 +211,20 @@ long parse_ns_duration(char *val) /* * This is a set of helper functions to use SCHED_DEADLINE. */ -#ifdef __x86_64__ -# define __NR_sched_setattr 314 -# define __NR_sched_getattr 315 -#elif __i386__ -# define __NR_sched_setattr 351 -# define __NR_sched_getattr 352 -#elif __arm__ -# define __NR_sched_setattr 380 -# define __NR_sched_getattr 381 -#elif __aarch64__ || __riscv -# define __NR_sched_setattr 274 -# define __NR_sched_getattr 275 -#elif __powerpc__ -# define __NR_sched_setattr 355 -# define __NR_sched_getattr 356 -#elif __s390x__ -# define __NR_sched_setattr 345 -# define __NR_sched_getattr 346 +#ifndef __NR_sched_setattr +# ifdef __x86_64__ +# define __NR_sched_setattr 314 +# elif __i386__ +# define __NR_sched_setattr 351 +# elif __arm__ +# define __NR_sched_setattr 380 +# elif __aarch64__ || __riscv +# define __NR_sched_setattr 274 +# elif __powerpc__ +# define __NR_sched_setattr 355 +# elif __s390x__ +# define __NR_sched_setattr 345 +# endif #endif =20 #define SCHED_DEADLINE 6 --=20 2.45.2 From nobody Wed Nov 27 06:43:19 2024 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 DC1AE1C5798 for ; Fri, 11 Oct 2024 17:30:18 +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=1728667818; cv=none; b=OCRKQRIlVa2b5n50QU8wdGzDuLAa46ZO34yL4/TjKTgBE+ZuovRlgzbjxI6tAqGxAs9MUs9AZBELYLuish3OPc+Y9zw1yNrTGstbN1X/FVx2390shaVB7cL9QUtXUWdIdXM2ah/flZFsj0LxgTy71cWgzjsfEHOTGY+7Z42XAEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728667818; c=relaxed/simple; bh=PT7qf5DjdBQGFg1ZvnN6DJYxZK7XLLXsABsgkG6VxQk=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=o77PTt+8uZP7xcyEDwXDz/j+bH9F+5jHvM6DnaY86E0Jo76X+0DO6VKrpCC2i3uKCBzHN7VNPyeiYu7vEw0MuckxIc2y1NSJY7ws1Kj/VNjD4YlGfSq+8k8WevLIUI8H5ultKURmi2pI2H/Sww12zKTcbwv67YI4bFYpwHC+RRQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 812D0C4CED1; Fri, 11 Oct 2024 17:30:18 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1szJTB-00000001U1I-01u4; Fri, 11 Oct 2024 13:30:29 -0400 Message-ID: <20241011173028.871391989@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 11 Oct 2024 13:30:17 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Jan Stancek Subject: [for-next][PATCH 7/9] tools/rtla: fix collision with glibc sched_attr/sched_set_attr References: <20241011173010.441043942@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Jan Stancek glibc commit 21571ca0d703 ("Linux: Add the sched_setattr and sched_getattr functions") now also provides 'struct sched_attr' and sched_setattr() which collide with the ones from rtla. In file included from src/trace.c:11: src/utils.h:49:8: error: redefinition of =E2=80=98struct sched_attr=E2=80= =99 49 | struct sched_attr { | ^~~~~~~~~~ In file included from /usr/include/bits/sched.h:60, from /usr/include/sched.h:43, from /usr/include/tracefs/tracefs.h:10, from src/trace.c:4: /usr/include/linux/sched/types.h:98:8: note: originally defined here 98 | struct sched_attr { | ^~~~~~~~~~ Define 'struct sched_attr' conditionally, similar to what strace did: https://lore.kernel.org/all/20240930222913.3981407-1-raj.khem@gmail.com/ and rename rtla's version of sched_setattr() to avoid collision. Link: https://lore.kernel.org/8088f66a7a57c1b209cd8ae0ae7c336a7f8c930d.1728= 572865.git.jstancek@redhat.com Signed-off-by: Jan Stancek Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/src/utils.c | 4 ++-- tools/tracing/rtla/src/utils.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/tracing/rtla/src/utils.c b/tools/tracing/rtla/src/utils.c index 05b2b3fc005e..6fae234aaf36 100644 --- a/tools/tracing/rtla/src/utils.c +++ b/tools/tracing/rtla/src/utils.c @@ -229,7 +229,7 @@ long parse_ns_duration(char *val) =20 #define SCHED_DEADLINE 6 =20 -static inline int sched_setattr(pid_t pid, const struct sched_attr *attr, +static inline int syscall_sched_setattr(pid_t pid, const struct sched_attr= *attr, unsigned int flags) { return syscall(__NR_sched_setattr, pid, attr, flags); } @@ -239,7 +239,7 @@ int __set_sched_attr(int pid, struct sched_attr *attr) int flags =3D 0; int retval; =20 - retval =3D sched_setattr(pid, attr, flags); + retval =3D syscall_sched_setattr(pid, attr, flags); if (retval < 0) { err_msg("Failed to set sched attributes to the pid %d: %s\n", pid, strerror(errno)); diff --git a/tools/tracing/rtla/src/utils.h b/tools/tracing/rtla/src/utils.h index d44513e6c66a..99c9cf81bcd0 100644 --- a/tools/tracing/rtla/src/utils.h +++ b/tools/tracing/rtla/src/utils.h @@ -46,6 +46,7 @@ update_sum(unsigned long long *a, unsigned long long *b) *a +=3D *b; } =20 +#ifndef SCHED_ATTR_SIZE_VER0 struct sched_attr { uint32_t size; uint32_t sched_policy; @@ -56,6 +57,7 @@ struct sched_attr { uint64_t sched_deadline; uint64_t sched_period; }; +#endif /* SCHED_ATTR_SIZE_VER0 */ =20 int parse_prio(char *arg, struct sched_attr *sched_param); int parse_cpu_set(char *cpu_list, cpu_set_t *set); --=20 2.45.2 From nobody Wed Nov 27 06:43:19 2024 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 EC7D41C689D for ; Fri, 11 Oct 2024 17:30:18 +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=1728667819; cv=none; b=oK87LR1ROgyWOfO5fCpvDTdG2iYX+OqF5uKJPFG+dEuCYp0obTEvFZiQNdhjTJj/5lmUs6Zs/7cSxXi/HzvqZNj3bRHU3ntzNwSgtkiLSz1Nyk7PV9vUvTrVZB7H77uF68X9KTzB7FfkGfXgX6PfvgxsYp2HOyCwBXy5w/FT3j0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728667819; c=relaxed/simple; bh=dk7uh21VkalmBSMSe/A86Rv2sFa4xAMkC5xdLfZJALc=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=MIF9+DWwv82PSR4623taCRyhB6ZClqoS5oxLMCLump8VjaTjLG2hAC+i5GZZjjjr/Uc7qWW8pmbd6LfqAqMYjUL8xcXULHc8emvpWXmuetCYM638w2dOViVERAIQ62IRhCHxnB6p2Bei8clrHFC1togMxKSgyU/UV1CnAnz0pWo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EB51C4CED6; Fri, 11 Oct 2024 17:30:18 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1szJTB-00000001U1n-0fn2; Fri, 11 Oct 2024 13:30:29 -0400 Message-ID: <20241011173029.026778216@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 11 Oct 2024 13:30:18 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Attila Fazekas Subject: [for-next][PATCH 8/9] rtla/timerlat: Make timerlat_top_cpu->*_count unsigned long long References: <20241011173010.441043942@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Tomas Glozar Most fields of struct timerlat_top_cpu are unsigned long long, but the fields {irq,thread,user}_count are int (32-bit signed). This leads to overflow when tracing on a large number of CPUs for a long enough time: $ rtla timerlat top -a20 -c 1-127 -d 12h ... 0 12:00:00 | IRQ Timer Latency (us) | Thread Ti= mer Latency (us) CPU COUNT | cur min avg max | cur mi= n avg max 1 #43200096 | 0 0 1 2 | 3 2= 6 12 ... 127 #43200096 | 0 0 1 2 | 3 = 2 5 11 ALL #119144 e4 | 0 5 4 | = 2 28 16 The average latency should be 0-1 for IRQ and 5-6 for thread, but is reported as 5 and 28, about 4 to 5 times more, due to the count overflowing when summed over all CPUs: 43200096 * 127 =3D 5486412192, however, 1191444898 (=3D 5486412192 mod MAX_INT) is reported instead, as seen on the last line of the output, and the averages are thus ~4.6 times higher than they should be (5486412192 / 1191444898 =3D ~4.6). Fix the issue by changing {irq,thread,user}_count fields to unsigned long long, similarly to other fields in struct timerlat_top_cpu and to the count variable in timerlat_top_print_sum. Link: https://lore.kernel.org/20241011121015.2868751-1-tglozar@redhat.com Reported-by: Attila Fazekas Signed-off-by: Tomas Glozar Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/src/timerlat_top.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src= /timerlat_top.c index 94a2f5bbaeb7..7fb85c8ee3bc 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -54,9 +54,9 @@ struct timerlat_top_params { }; =20 struct timerlat_top_cpu { - int irq_count; - int thread_count; - int user_count; + unsigned long long irq_count; + unsigned long long thread_count; + unsigned long long user_count; =20 unsigned long long cur_irq; unsigned long long min_irq; @@ -280,7 +280,7 @@ static void timerlat_top_print(struct osnoise_tool *top= , int cpu) /* * Unless trace is being lost, IRQ counter is always the max. */ - trace_seq_printf(s, "%3d #%-9d |", cpu, cpu_data->irq_count); + trace_seq_printf(s, "%3d #%-9llu |", cpu, cpu_data->irq_count); =20 if (!cpu_data->irq_count) { trace_seq_printf(s, "%s %s %s %s |", no_value, no_value, no_value, no_va= lue); --=20 2.45.2 From nobody Wed Nov 27 06:43:19 2024 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 CFDCE1C5782 for ; Fri, 11 Oct 2024 17:30:18 +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=1728667818; cv=none; b=sjBw50T1RTI9VT70TbaLu/hMGAjfxW54jEPJlgindoZKJ7yxI26NEFdtek4Q7N3EwsnNJjYTPuSgqa6cmJQW9htine7x3Y8F2aGzDrZOoYpwQ8XnWN11xW8f7qqpeIGhwSQgNz9RG3haG6f56zZea7L073PLZe23N0orVEyqvN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728667818; c=relaxed/simple; bh=LeUqvpIi3xVVykZZ2tXrQflVdKy0iM9aX71D1yOFHZ0=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=qEmGWIhv2yt8KAfbEFmEylFKv9LOXU6qaQ2pJHb9Aw0GPNfYpSEAwFxWzLTCTdXeF6NQe0nMeeDku5tFF4L8bXhl1rWJnFqxMAukdAbkneNs5ZrNfT3sWfG6UIn7QZ9iJBrMpo13ZD5DR16omnKi+WE8uootifASlPoQIGj6NUw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7361C4CEDF; Fri, 11 Oct 2024 17:30:18 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.98) (envelope-from ) id 1szJTB-00000001U2I-1KOo; Fri, 11 Oct 2024 13:30:29 -0400 Message-ID: <20241011173029.181826265@goodmis.org> User-Agent: quilt/0.68 Date: Fri, 11 Oct 2024 13:30:19 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Tomas Glozar , John Kacur , Attila Fazekas Subject: [for-next][PATCH 9/9] rtla/timerlat: Make timerlat_hist_cpu->*_count unsigned long long References: <20241011173010.441043942@goodmis.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Tomas Glozar Do the same fix as in previous commit also for timerlat-hist. Link: https://lore.kernel.org/20241011121015.2868751-2-tglozar@redhat.com Reported-by: Attila Fazekas Signed-off-by: Tomas Glozar Signed-off-by: Steven Rostedt (Google) --- tools/tracing/rtla/src/timerlat_hist.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/sr= c/timerlat_hist.c index 1f9137c592f4..d49c8f0855fe 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -62,9 +62,9 @@ struct timerlat_hist_cpu { int *thread; int *user; =20 - int irq_count; - int thread_count; - int user_count; + unsigned long long irq_count; + unsigned long long thread_count; + unsigned long long user_count; =20 unsigned long long min_irq; unsigned long long sum_irq; @@ -304,15 +304,15 @@ timerlat_print_summary(struct timerlat_hist_params *p= arams, continue; =20 if (!params->no_irq) - trace_seq_printf(trace->seq, "%9d ", + trace_seq_printf(trace->seq, "%9llu ", data->hist[cpu].irq_count); =20 if (!params->no_thread) - trace_seq_printf(trace->seq, "%9d ", + trace_seq_printf(trace->seq, "%9llu ", data->hist[cpu].thread_count); =20 if (params->user_hist) - trace_seq_printf(trace->seq, "%9d ", + trace_seq_printf(trace->seq, "%9llu ", data->hist[cpu].user_count); } trace_seq_printf(trace->seq, "\n"); @@ -488,15 +488,15 @@ timerlat_print_stats_all(struct timerlat_hist_params = *params, trace_seq_printf(trace->seq, "count:"); =20 if (!params->no_irq) - trace_seq_printf(trace->seq, "%9d ", + trace_seq_printf(trace->seq, "%9llu ", sum.irq_count); =20 if (!params->no_thread) - trace_seq_printf(trace->seq, "%9d ", + trace_seq_printf(trace->seq, "%9llu ", sum.thread_count); =20 if (params->user_hist) - trace_seq_printf(trace->seq, "%9d ", + trace_seq_printf(trace->seq, "%9llu ", sum.user_count); =20 trace_seq_printf(trace->seq, "\n"); --=20 2.45.2