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 BF788A034E; Wed, 9 Feb 2022 16:36:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FC9F41144; Wed, 9 Feb 2022 16:36:09 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 4B08B41143 for ; Wed, 9 Feb 2022 16:36:08 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id c3so2525556pls.5 for ; Wed, 09 Feb 2022 07:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dIVOc8WwO3C9K9FinZeTcqCVy1hChJpW5qi9vdsUwyg=; b=7NRBRreymr62hZ9me6T+sNll1i4abyi4Y+YxIOUCTxfFI9NViyPQAF1SJ8gueV7Oc2 DIjOiRsmyfXPeJBLzSgwQCui0k49sXRrOELlDcez2P3H549VoeVl0K8UNxH5cjKffCSY SzOSbYHwxYSoEzQrydRQOvDCRVcLJRATbmkPOUsiUgeMqtoFzddOWIXG5JNcotFV/hgi ITYjpckl4ab9R578Fb1zXkG79O2IC+MukSz9m447ggdHs1fASxfn2FmFCq8cI1nvW9hE NoS9fT+f/I+vWi7anLtC2GrKo0dN2enJQE56FB2dONgmnC9VtI0Fdy7Wx3tapMeAuTr4 2S5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dIVOc8WwO3C9K9FinZeTcqCVy1hChJpW5qi9vdsUwyg=; b=iiU3hzdzc6A+/qIvlQ5E89YNAhu2/w6hMcRxa/qGWoYmp7Z1P37lozWt8Q1al+mLtY AFiGn5bQdUfPLsS9VyTSQufi38wlEpqK48ZlI51JwUBdwyB02eHWFNuGuKM6FI2Ob1gt ZE+M+rLWzK1kIboY2Yo9P+ZGlT0J/iUAscxgCeQIIfvzEad44fQUXMszeOJpPO8ziutP tQZejuTYBKqa0bs+HRllw9afbdikImuIpGaR66FQkmWj292IFgOeYgfHW9fVjP4K5zBX Kd1O8747UbaRP49DxVS7QEhZo4DGk1/BbEFXVBFPODt1U7jt+a1ppiZLMXoxiXUsVF3Y 8BEg== X-Gm-Message-State: AOAM532t+NU/HcBmPCu39DQB6kHq3rXVeuw9iquO7FqjLfuqOkql5l01 mVo189E/Ce/7pOcsHFcUFKB6D+tJtdhOowk2 X-Google-Smtp-Source: ABdhPJy1EvHnL5QQ/JVu56tuXQwjx8GptXTPBPsi3eWexyH4zid30t1MeFMhUDYuhp7xmG7Lk2oxcg== X-Received: by 2002:a17:90a:7a82:: with SMTP id q2mr3172202pjf.40.1644420967493; Wed, 09 Feb 2022 07:36:07 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id u19sm10187291pfi.126.2022.02.09.07.36.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 07:36:07 -0800 (PST) Date: Wed, 9 Feb 2022 07:36:04 -0800 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org, Stephen Hemminger , david.marchand@redhat.com Subject: Re: [PATCH] eal: remove unnecessary argv[0] handling Message-ID: <20220209073604.029e2081@hermes.local> In-Reply-To: <2032198.bB369e8A3T@thomas> References: <20220202194738.404876-1-stephen@networkplumber.org> <2032198.bB369e8A3T@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Wed, 09 Feb 2022 15:58:26 +0100 Thomas Monjalon wrote: > 02/02/2022 20:47, Stephen Hemminger: > > The rte_eal_init function looks at argv[0] to determine > > the program name to pass to the log init function. > > This is both unnecessary and in a corner case a problem. > > > > Parsing argv[0] is unnecessary because the function openlog() > > already determines the log identifier from program name if > > NULL is passed, see openlog man page: > > The string pointed to by ident is prepended to every message, and is > > typically set to the program name. If ident is NULL, the program name > > is used. (POSIX.1-2008 does not specify the behavior when ident is > > NULL.) > > What about POSIX warning? There are many cases where it is practical and useful to do non-POSIX things (see _GNU_SOURCE). Look at pthread_setaffinity_np() etc. > Did you test it? Which libc? What about musl? No, I don't have or use alternative libc versions. > > [...] > > - if (eal_log_init(logid, internal_conf->syslog_facility) < 0) { > > + if (eal_log_init(NULL, internal_conf->syslog_facility) < 0) { > > We could completely remove the logid parameter. Yes, it could go away.