Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9207216rwr; Thu, 11 May 2023 11:24:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JL/b1+dMXffGQMEhMrI2rqk2lGGffsFf0wJJ+bsWXEBu/vMs0a6WzOCEFjS+l4vMUBUPw X-Received: by 2002:a17:902:7d98:b0:1ac:7b13:de71 with SMTP id a24-20020a1709027d9800b001ac7b13de71mr16286911plm.37.1683829496990; Thu, 11 May 2023 11:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683829496; cv=none; d=google.com; s=arc-20160816; b=RnKpcl0L9vPdiCS4UHRspk6HZ59rkYaiCpKqgNMeF+JP7xc0xvYFwuvz1ulK55Ypfd XPIpnORBvoscYpTia1OSr+5LpZ84QDo6blTH03ObMMzwAyGy7YWC7zc2jX5ilLreZnPX A4XDl7unMsM9+2/riePOuo1eUHtkFdto58zrV0W0gthbxP6vvwIMoCO+n5cYfpD36ha5 udyprDEL4zepY1Lf0M0RCFWtIo+ehasSciKtOP3a1yvUdJ837wrPriMCgF/AyCdkGU5i V7JckqglEHnURMWU13l9utn4ybe54np0DY9ddZmyo+vZSWCdvVNAdDV9h6NIG6cAQ+IN Tj2A== 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=drdvUtNygeEhycPS+Rz+HH3LqPx73hl6PPBd8e5Oyi/YyW/cS9Kf3VWmNeQOVwd5Go 8htw/gsM2L5ACtTd+WxFcw+ujdBGxcQ6Kz51AAMIXvzj3WhyoRgF/2oQAlW8WGJMVN7a n9sY28m8N3LutJIgdQy1eS3dbG3A6J3S/BBf/0s/Rn748420DN629Y1PIm82Bdalb2h4 iVKwxvzclvUsHbt70hebbDFWC1J4QaLQbWJLTBZ2oTaSclUw1bIIXMJl/oXqItnpptor gMKLVWoRBNWk022YcfNqLb8a3AHVkAhHAPOmH5D3FYXG7W0+B1bCGzU8TBO2kX91BVSs gQAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bOsA92m9; 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 o19-20020a637313000000b0051b37c000dcsi2119739pgc.81.2023.05.11.11.24.42; Thu, 11 May 2023 11:24:56 -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=bOsA92m9; 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 S239250AbjEKSGI (ORCPT + 99 others); Thu, 11 May 2023 14:06:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239194AbjEKSFq (ORCPT ); Thu, 11 May 2023 14:05:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2AC58A4A; Thu, 11 May 2023 11:05:17 -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 6033765094; Thu, 11 May 2023 18:04:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEF58C4339E; Thu, 11 May 2023 18:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683828296; bh=NspQ5eSfzkW/s4ZKEIvi8KiViH9J4SR7mF8q0fY8gJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bOsA92m9AdNn6Tp6Q5Wnrj0TfXWHfvnnMaQmEHfrYgBKfV4cchmUnOq3yX0DTJVcz e8ehWgWWzwpTh3Egygs1D4qVUcu0jzpTTghtHA2HrA9EySOso3fzW1BpaysjTP85lA otoTCSW4Y/IqsE/dYLDfwEk+uwFUtu8ReMEMNQbsjg9pFsXSxMOsOqu9Gmc2P8ZdkY Vo1OdGxb2JF0RFFWfuwf7aea4mUgop1gxxKOhUJllL4wN29+MRszUa8AkKfNkJazfA q4x46Nwl6tX+IBjW/PUg3noNu8sWh1H40XfzPqqmq7Wd9GuI6DMLnJ88bD4n7hq8yt KrtTfLkY1Kh7g== From: Daniel Bristot de Oliveira To: linux-trace-devel@vger.kernel.org, Steven Rostedt Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Juri Lelli , William White , Daniel Bristot de Oliveira , Masami Hiramatsu , Jonathan Corbet Subject: [PATCH 8/8] rtla/hwnoise: Reduce runtime to 75% Date: Thu, 11 May 2023 20:04:26 +0200 Message-Id: <09fd28d1be7a5f3e01da1c2c007cf56790635f39.1683827510.git.bristot@kernel.org> 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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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