From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F7B742D82; Wed, 28 Jun 2023 19:58:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7ADD342D0D; Wed, 28 Jun 2023 19:58:38 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 7D43B42B8B for ; Wed, 28 Jun 2023 19:58:34 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1b8033987baso8744235ad.0 for ; Wed, 28 Jun 2023 10:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1687975113; x=1690567113; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=l2wLPETSatqrqW/abs51daUJaAiV13v3uq1MS6O1kj0=; b=i23g3MIU9GT+09ze/klAwfoeLajYVDD992iIT7hX7tvbrIKm3iyxmJQKJk3kR+mtKl ToEZu1mD+0RrJEJdK3u4X2yC0QV9TdNfZTW5YexvFyWaw8LrLjQ07/qZpw6yKAruRvhm ENvIvGoIa6yzocnShsjzmAvf0azPK7gDIUKTb/E5mOf6XBjt5NTRl93ezsvjE7xL9508 XyEtlWZEvqSsQzdw0oPjJPm2yNr/1Fyu/vJB9Gw7uP7ScS4pVrNDd1vtSJgK9WghBmSe JzKCNi+ERuaQiLVEL/1CESJnsjFVntkFHtOApUIZd5cld+tgzz5uWo0OxaYBqtZG3UCA r4AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687975113; x=1690567113; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l2wLPETSatqrqW/abs51daUJaAiV13v3uq1MS6O1kj0=; b=ercc5cE45m7XveloYFse4z3k8x/k+yPwVoQPofoeLEAcNGywZL1rIfQi1mBzAJNUu1 tUyg2kEOL0IJYpMzYaayHc4AW0ckghotPfITfnqi7s/F88BKqFli0KYS9NhDV5jKJKSI Q7gFnGYgkkmbcRRz2/J3LGVrImQ5PQvKr/kCh1W9i5GRowOpDpqJM3yWdmtGV72Lj6a+ UU/BX5m1ki1V5lppaabt5XGlZuarkPxP1vqbwHA5boDwFPaskrcr++8gafRf7k9O2wLv v9z6CJo3EJgTnEFkwsITX/IO3RlrXrSMGiFIc7t6Mo0mxonsnE8pQce42MIYf4dA3tWu pAnQ== X-Gm-Message-State: AC+VfDw5ictSMRbsg7Ve1Osf5axpDN6yCY+hhTkgQe4Jw6X3T7h0YVqX 2vIs32wUL69r8ALsWyAmWXqsbV/inBlP3o/rsEkgzw== X-Google-Smtp-Source: ACHHUZ43TwWKvckvjfhAl1NsgVr0iC/BmqbE02EpLWbIQq0+oK60Yj3qASL//uuO7J/Owft7slvLRg== X-Received: by 2002:a17:902:e888:b0:1b0:4c6c:716 with SMTP id w8-20020a170902e88800b001b04c6c0716mr2485143plg.4.1687975113479; Wed, 28 Jun 2023 10:58:33 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id g11-20020a170902868b00b001b80d399730sm5047875plo.242.2023.06.28.10.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 10:58:32 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Bruce Richardson Subject: [PATCH v5 3/6] eal: fix handling of syslog facility Date: Wed, 28 Jun 2023 10:58:24 -0700 Message-Id: <20230628175827.471909-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230628175827.471909-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20230628175827.471909-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The syslog facility option needs to be parsed before log_init is called. Also help message whas missing the required argument. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_options.c | 2 +- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 2 +- lib/eal/unix/eal_log.c | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index 03059336987d..005da4d12001 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -2193,7 +2193,7 @@ eal_common_usage(void) " --"OPT_VMWARE_TSC_MAP" Use VMware TSC map instead of native RDTSC\n" " --"OPT_PROC_TYPE" Type of this process (primary|secondary|auto)\n" #ifndef RTE_EXEC_ENV_WINDOWS - " --"OPT_SYSLOG" Set syslog facility\n" + " --"OPT_SYSLOG"= Set syslog facility\n" #endif " --"OPT_LOG_LEVEL"= Set global log level\n" " --"OPT_LOG_LEVEL"=:\n" diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index bb9a2b1653d9..104507b61514 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -394,7 +394,7 @@ eal_parse_args(int argc, char **argv) } /* eal_log_level_parse() already handled this option */ - if (opt == OPT_LOG_LEVEL_NUM) + if (opt == OPT_LOG_LEVEL_NUM || opt == OPT_SYSLOG_NUM) continue; ret = eal_parse_common_option(opt, optarg, internal_conf); diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index d7f268fc8116..e30c44380e30 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -611,7 +611,7 @@ eal_parse_args(int argc, char **argv) } /* eal_log_level_parse() already handled these */ - if (opt == OPT_LOG_LEVEL_NUM) + if (opt == OPT_LOG_LEVEL_NUM || opt == OPT_SYSLOG_NUM) continue; ret = eal_parse_common_option(opt, optarg, internal_conf); diff --git a/lib/eal/unix/eal_log.c b/lib/eal/unix/eal_log.c index 3f54284494d7..93cf04fae043 100644 --- a/lib/eal/unix/eal_log.c +++ b/lib/eal/unix/eal_log.c @@ -80,6 +80,7 @@ eal_log_level_parse(int argc, char *const argv[]) eal_long_options, &option_index)) != EOF) { switch (opt) { + case OPT_SYSLOG_NUM: case OPT_LOG_LEVEL_NUM: if (eal_parse_common_option(opt, optarg, internal_conf) < 0) return -1; -- 2.39.2