From nobody Tue Apr 7 16:31:35 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E2FAECAAD8 for ; Fri, 26 Aug 2022 18:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345092AbiHZStZ (ORCPT ); Fri, 26 Aug 2022 14:49:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233859AbiHZSss (ORCPT ); Fri, 26 Aug 2022 14:48:48 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EDCAE926B for ; Fri, 26 Aug 2022 11:45:56 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id d16-20020a17090ad3d000b001fb42eb7467so1431701pjw.9 for ; Fri, 26 Aug 2022 11:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc; bh=ed1e9YFm1bkZbR55Fi4AhXJIeJ9QRqoxJ1lB8J6isug=; b=crNOK3R3j37Xfzsw7QfNA/TW9IqQ86Oi4O+K9vKqcNRVNnRTzE1oXlyg98BmhLviPJ KLHYIbkEOkvBDd1CAUcAro992fVQk+vABTN3+2WkuHttTBFSOXWL7HdLVGnMNkkGlzqh aLPSLCRKfUKHTR/OLGAc2hEERwQwipghOY/UpBheYsv7EHMtLiGGJziLMXC2peRxrUHF cHmb9c1lPOczty49iWiq1S0AezJ119qzmB/nm9yxkjrc0X9cBCkG4wMbtm3z6vizScOL mL6P55tmRz+wuKR7IF1Sis2CxD2sQYTuUpPxGvduoZg7KF2JCnPww4DF3z30H5LdM7UD AunQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc; bh=ed1e9YFm1bkZbR55Fi4AhXJIeJ9QRqoxJ1lB8J6isug=; b=3xvM5VBtX07SOEWDV/XbWyGJXL4BVd5I3k0Yar2zqyfZFYuLVuFNPS0AY9hj+U6hwc Wtz1Q1MEIZW7JBoa/hfqKACkF41wdtkiK3PFx9NnTqO5Zq33d0qPOmvL9dBibuG1aDWk q700NNz6q50Hb61gRg+7t5uvNj8qKqLw8f187etkqB/ERA4sTTlHL02r9zVgnK53H+Li rggXycYasdeTfPI8xEZz4YpAvm0GGn/7xTuhWuKzjbn0VuVY1ai9S7Jw0ET7l50XXQMy GVySh85rNlvgSht+PyCkNZI4b4mjbO0TT+AdhVc9DikrBgwzQsdALjHCYJD4rWk+k2sC FdiA== X-Gm-Message-State: ACgBeo0I9JP+kxnMUFXaxjKVeMtTDasdFrOywwR6189w65HdTbd0Xu9M PttQj3V5HVWBFlhW+CdR5Zy9BGq55Pr2 X-Google-Smtp-Source: AA6agR4VDwzUoO8UNjuYNU++2w8cs4ot7vOoQfFlsV1MVMK5t9LYoz+dLgPORgCghxFYDB3BmNjS+AqIy1UU X-Received: from vipin.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:479f]) (user=vipinsh job=sendgmr) by 2002:a17:90a:c1:b0:1f4:f757:6b48 with SMTP id v1-20020a17090a00c100b001f4f7576b48mr5715558pjd.56.1661539555510; Fri, 26 Aug 2022 11:45:55 -0700 (PDT) Date: Fri, 26 Aug 2022 11:44:58 -0700 In-Reply-To: <20220826184500.1940077-1-vipinsh@google.com> Mime-Version: 1.0 References: <20220826184500.1940077-1-vipinsh@google.com> X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220826184500.1940077-3-vipinsh@google.com> Subject: [PATCH v3 2/4] KVM: selftests: Put command line options in alphabetical order in dirty_log_perf_test From: Vipin Sharma To: seanjc@google.com, dmatlack@google.com, pbonzini@redhat.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Vipin Sharma Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There are 13 command line options and they are not in any order. Put them in alphabetical order to make it easy to add new options. No functional change intended. Signed-off-by: Vipin Sharma --- .../selftests/kvm/dirty_log_perf_test.c | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/test= ing/selftests/kvm/dirty_log_perf_test.c index a03db7f9f4c0..acf8b80c91d1 100644 --- a/tools/testing/selftests/kvm/dirty_log_perf_test.c +++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c @@ -406,51 +406,53 @@ int main(int argc, char *argv[]) =20 guest_modes_append_default(); =20 - while ((opt =3D getopt(argc, argv, "eghi:p:m:nb:f:v:os:x:")) !=3D -1) { + while ((opt =3D getopt(argc, argv, "b:ef:ghi:m:nop:s:v:x:")) !=3D -1) { switch (opt) { + case 'b': + guest_percpu_mem_size =3D parse_size(optarg); + break; case 'e': /* 'e' is for evil. */ run_vcpus_while_disabling_dirty_logging =3D true; dirty_log_manual_caps =3D 0; break; + case 'f': + p.wr_fract =3D atoi(optarg); + TEST_ASSERT(p.wr_fract >=3D 1, + "Write fraction cannot be less than one"); + break; case 'g': dirty_log_manual_caps =3D 0; break; + case 'h': + help(argv[0]); + break; case 'i': p.iterations =3D atoi(optarg); break; - case 'p': - p.phys_offset =3D strtoull(optarg, NULL, 0); - break; case 'm': guest_modes_cmdline(optarg); break; case 'n': perf_test_args.nested =3D true; break; - case 'b': - guest_percpu_mem_size =3D parse_size(optarg); + case 'o': + p.partition_vcpu_memory_access =3D false; break; - case 'f': - p.wr_fract =3D atoi(optarg); - TEST_ASSERT(p.wr_fract >=3D 1, - "Write fraction cannot be less than one"); + case 'p': + p.phys_offset =3D strtoull(optarg, NULL, 0); + break; + case 's': + p.backing_src =3D parse_backing_src_type(optarg); break; case 'v': nr_vcpus =3D atoi(optarg); TEST_ASSERT(nr_vcpus > 0 && nr_vcpus <=3D max_vcpus, "Invalid number of vcpus, must be between 1 and %d", max_vcpus); break; - case 'o': - p.partition_vcpu_memory_access =3D false; - break; - case 's': - p.backing_src =3D parse_backing_src_type(optarg); - break; case 'x': p.slots =3D atoi(optarg); break; - case 'h': default: help(argv[0]); break; --=20 2.37.2.672.g94769d06f0-goog