Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8883FC433F5 for ; Fri, 1 Oct 2021 17:29:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70F5461A85 for ; Fri, 1 Oct 2021 17:29:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354559AbhJARbl (ORCPT ); Fri, 1 Oct 2021 13:31:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355419AbhJARbk (ORCPT ); Fri, 1 Oct 2021 13:31:40 -0400 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41BA6C061775 for ; Fri, 1 Oct 2021 10:29:56 -0700 (PDT) Received: by mail-qv1-xf34.google.com with SMTP id a14so6015898qvb.6 for ; Fri, 01 Oct 2021 10:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uS2U7d6Ir4S0YesLx3uyebCCXb/YI1Oizx5Tj/VXKeg=; b=Y6m4CqJ+EAnL/bClcry3kolUFmDPmgo1/fj0ooionj1LszVNGwo08FU6KQswH3NWd1 2LV1Whgqv9SLMISYgjG73/WB2fbP67EBt4g0YlpYm822w8sStl0eG4uKFfGEq/w0kd15 ZJ/htOyFXwpIrhcBAExc3rFLtlgZ+TrX1HugNyBGdgD/OenfVvrs9xTwLbnjKTu18YTV CxVAKDGsPmfMWCbIAFU0sQJcb+rIA93BMoUvYhuavlmj9EZmdcZCNx87BPP+nQt0z5oT K/S2X72DJsywfsztnwpDCmWwvARfAl345fXXLrps1mpwZya1/aHrPStofAkn4JnjQWOb IBHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uS2U7d6Ir4S0YesLx3uyebCCXb/YI1Oizx5Tj/VXKeg=; b=gmYzNUor2bHKljMVbVNRIKLFLAurLSEKMlggV+omZxMLl+I9b6eJ5rIMUETQREB2oJ T+aDOQatF6CJkgTl5yjOSIvwRwCtV+FUm8sDXGvGmH7S1dTgUAB3Ro3da0/orkLnl/AO /a5u8frlpC67079HkWJjoQtRY9NsKw0yDgsQAUzKS5nxp68aMmnxgz3qp6SWurgCs1em Uee7Uaw6BIJi5DJPnlc/qg59WZzw+1DNnyXzKIE9TBAKLWh4Ze9mw9LD4P4oLeQBO0rT jnVAEorkGdCz2X/1hTgtDeo0pQMnsOaOMvTNw447OYfIoIVBKoGo6ZI5C6nEazfPYzp8 ARGQ== X-Gm-Message-State: AOAM530G7E5I8QA7wVPqA4dpOjbiW7GqhNzA0qSrKWNy772Lb84MG5xk K75Ai3Fb5WSzasuhdnHU6sCe62SQXc4= X-Google-Smtp-Source: ABdhPJzVX2lMf4ZaCDRk6aAc/8P7i6o38Q9CODwKGPtTn056F68zqJnwU7I8o+dIkkujlVZvrFzFzw== X-Received: by 2002:ad4:5893:: with SMTP id dz19mr10455460qvb.61.1633109395400; Fri, 01 Oct 2021 10:29:55 -0700 (PDT) Received: from localhost.localdomain (bras-base-rdwyon0600w-grc-09-184-147-143-99.dsl.bell.ca. [184.147.143.99]) by smtp.gmail.com with ESMTPSA id o23sm3741131qtl.74.2021.10.01.10.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:29:55 -0700 (PDT) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Sebastian Andrzej Siewior , Pierre FICHEUX , Thomas Gleixner , Punit Agrawal , John Ogness , Luis Goncalves , Leah Leshchinsky , John Kacur Subject: [PATCH 3/3] rt-tests: cyclictest: Add --default-system option Date: Fri, 1 Oct 2021 13:29:37 -0400 Message-Id: <20211001172937.13060-3-jkacur@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211001172937.13060-1-jkacur@redhat.com> References: <20211001172937.13060-1-jkacur@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org This patch add the long option --default-system --default-system runs cyclictest without attempting any tuning. Power management is not suppressed so cyclictest measures the system as it is configured. This is effectively the same as --laptop, but makes it clear to the user what is done and why. Signed-off-by: John Kacur --- src/cyclictest/cyclictest.8 | 3 +++ src/cyclictest/cyclictest.c | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/cyclictest/cyclictest.8 b/src/cyclictest/cyclictest.8 index dc0a278f3d30..dcae5b83147f 100644 --- a/src/cyclictest/cyclictest.8 +++ b/src/cyclictest/cyclictest.8 @@ -59,6 +59,9 @@ select clock .br 1 = CLOCK_REALTIME .TP +.B \-\-default\-system +Don't attempt to tune the system from cyclictest. Power management is not suppressed. This might give poorer results, but will allow you to discover if you need to tune the system. +.TP .B \-d, \-\-distance=DIST Distance of thread intervals in us, default = 500 .TP diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index 067b75317c9a..cbdc6c11ffe3 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -194,6 +194,7 @@ static int ct_debug; static int use_fifo = 0; static pthread_t fifo_threadid; static int laptop = 0; +static int power_management = 0; static int use_histfile = 0; #ifdef ARCH_HAS_SMI_COUNTER @@ -256,6 +257,11 @@ static void set_latency_target(void) return; } + if (power_management) { + warn("not setting cpu_dma_latency from cyclictest\n"); + return; + } + errno = 0; err = stat("/dev/cpu_dma_latency", &s); if (err == -1) { @@ -820,6 +826,10 @@ static void display_help(int error) "-c CLOCK --clock=CLOCK select clock\n" " 0 = CLOCK_MONOTONIC (default)\n" " 1 = CLOCK_REALTIME\n" + " --default-system Don't attempt to tune the system from cyclictest.\n" + " Power management is not suppressed.\n" + " This might give poorer results, but will allow you\n" + " to discover if you need to tune the system\n" "-d DIST --distance=DIST distance of thread intervals in us, default=500\n" "-D --duration=TIME specify a length for the test run.\n" " Append 'm', 'h', or 'd' to specify minutes, hours or days.\n" @@ -947,7 +957,7 @@ static char *policyname(int policy) enum option_values { OPT_AFFINITY=1, OPT_BREAKTRACE, OPT_CLOCK, - OPT_DISTANCE, OPT_DURATION, OPT_LATENCY, + OPT_DEFAULT_SYSTEM, OPT_DISTANCE, OPT_DURATION, OPT_LATENCY, OPT_FIFO, OPT_HISTOGRAM, OPT_HISTOFALL, OPT_HISTFILE, OPT_INTERVAL, OPT_JSON, OPT_MAINAFFINITY, OPT_LOOPS, OPT_MLOCKALL, OPT_REFRESH, OPT_NANOSLEEP, OPT_NSECS, OPT_OSCOPE, OPT_PRIORITY, @@ -976,6 +986,7 @@ static void process_options(int argc, char *argv[], int max_cpus) {"aligned", optional_argument, NULL, OPT_ALIGNED }, {"breaktrace", required_argument, NULL, OPT_BREAKTRACE }, {"clock", required_argument, NULL, OPT_CLOCK }, + {"default-system", no_argument, NULL, OPT_DEFAULT_SYSTEM }, {"distance", required_argument, NULL, OPT_DISTANCE }, {"duration", required_argument, NULL, OPT_DURATION }, {"latency", required_argument, NULL, OPT_LATENCY }, @@ -1061,6 +1072,8 @@ static void process_options(int argc, char *argv[], int max_cpus) case OPT_CLOCK: clocksel = atoi(optarg); break; case 'C': + case OPT_DEFAULT_SYSTEM: + power_management = 1; break; case 'd': case OPT_DISTANCE: distance = atoi(optarg); break; -- 2.31.1