Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7344995rwd; Tue, 6 Jun 2023 09:23:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5s4CPktAfjbfKiRPEJrvCrq/Q/PeJBf5lwLrSJyg5eohzAat3yflhaXhbXr835a5W4UrUS X-Received: by 2002:a05:622a:1454:b0:3f6:bcda:e77 with SMTP id v20-20020a05622a145400b003f6bcda0e77mr134621qtx.55.1686068627728; Tue, 06 Jun 2023 09:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686068627; cv=none; d=google.com; s=arc-20160816; b=d1D5WMPvyEjYrtmj5xTjUxh5EHDqiUJUcODtK2dzAwytn3jm7E+nCY/QjdfL3LcYtx iZJyi7gtFCe46LhlQqJls5wjDOyqyi1X7M8+dpFfTd/Or7RBR0zCptsMIOXfuFdQU+lV STugNw8x59B04LN8426BKcOcibh4vvP1sEOx4sx9X5blx0o+g6pxdeRAJiUVYEpVjL5V 5DYxAGB+NLcX1HthQvEb4isO/aG1DPjVDhT7dpjV2YqbGe1bOsHUKCsAtfU7jEjI0//X 3Y1o+20mRw3ekZqWbn9Dygeyxc7CgqZxlfjg08Si5T6r7hrd2zbm5thXpSC262xr2L4r bkrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IuEl6VmCH9AG6rJIRnhgRWl3VGVJ2sbXriGj1FiN49U=; b=ZAZxDBtDW7iJdsAmhnCOS8qmhh3tVrjGG6zyJbmKqYgLtCbi1Rpojn3tSu+GVDa3Cp vImeuH7Q+Ncu6hCAi0VaU9Cs9GnPN4pMhz+tZQCp8I66BuqF5hBCKw67OEhVPD7dndEc i76co2xMFuoytgpV0VCKXuoRE6xWR4Z6vn+OvUIu9j1dDxdFhLAdcjyZFz1I1ZweIQma 2heu0pp/Vym3vYVSKHuXkTHCQJzSRyBN1LfkTPYJzre61YI+NUOcmGVqW4alVN3feDYh rN9qAi/p6sYl/9ru7De+x0awvM3p0HJG38uCzkNsB6FQcF2R1Pax2lmAx0lw/TtYwyLH 3R7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SUtXBjQ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d14-20020a05622a05ce00b003f6a4917824si6493719qtb.677.2023.06.06.09.23.32; Tue, 06 Jun 2023 09:23:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SUtXBjQ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238550AbjFFQN3 (ORCPT + 99 others); Tue, 6 Jun 2023 12:13:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238358AbjFFQNK (ORCPT ); Tue, 6 Jun 2023 12:13:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CAE710F4; Tue, 6 Jun 2023 09:12:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 93CC662DE6; Tue, 6 Jun 2023 16:12:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00082C4339E; Tue, 6 Jun 2023 16:12:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686067976; bh=NspQ5eSfzkW/s4ZKEIvi8KiViH9J4SR7mF8q0fY8gJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SUtXBjQ4gi424FRAJAf2Lbg14t8Udt17Q1lNOb275daD7+epD2u4HVXHQakeqfdTx BmLXKKYW5L5TbtrrdFCyA/b5d6JOy4pd01YgfKbzz1yNgkTOcIrLvbMuPalTxWpbZ/ LRTytWxeT+b0Izt90iiS98ZXRun49fBSFhZNIkIclFuaDeQPQOWybL30eqzWhVGvWK Bn7IAnGAqSGUt3XuzeYcoGTFXQQrhim/8EyYQmPwJgu2DO880EQ/qI67GZKSi/wILd tF8/fh4Z0f32tydaH1C8CnEDAiZYnGjXYtTOSkI5da1PYbVwtHTJcoLAstoEzN94AH nF7jrOJ2hVnUA== From: Daniel Bristot de Oliveira To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Steven Rostedt Cc: linux-doc@vger.kernel.org, Juri Lelli , William White , Daniel Bristot de Oliveira , Masami Hiramatsu , Jonathan Corbet Subject: [PATCH V3 08/11] rtla/hwnoise: Reduce runtime to 75% Date: Tue, 6 Jun 2023 18:12:22 +0200 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org osnoise runs 100% of time by default. It makes sense because osnoise is preemptive. hwnoise checks preemption once a second, so it reduces system progress. Reduce runtime to 75% to avoid problems by default. I added a Fixes as it might avoid problems for first time users as it lands on distros. Cc: Steven Rostedt Cc: Daniel Bristot de Oliveira Cc: Masami Hiramatsu Cc: Jonathan Corbet Fixes: 1f428356c38d ("rtla: Add hwnoise tool") Signed-off-by: Daniel Bristot de Oliveira --- tools/tracing/rtla/src/osnoise_top.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/osnoise_top.c index 85abba568faf..f7c959be8677 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -348,8 +348,14 @@ struct osnoise_top_params *osnoise_top_parse_args(int argc, char **argv) if (!params) exit(1); - if (strcmp(argv[0], "hwnoise") == 0) + if (strcmp(argv[0], "hwnoise") == 0) { params->mode = MODE_HWNOISE; + /* + * Reduce CPU usage for 75% to avoid killing the system. + */ + params->runtime = 750000; + params->period = 1000000; + } while (1) { static struct option long_options[] = { -- 2.38.1