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 AE55AA0579; Fri, 9 Apr 2021 11:08:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30169407FF; Fri, 9 Apr 2021 11:08:55 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 422454014D for ; Fri, 9 Apr 2021 11:08:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617959333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=d2393Qd4c8X1hLzW2JUApzcQ6s5cqFCtiM7kGDtNCds=; b=XBwHSjjWajf12ZYw66zKeb/x4WdpH+eZGlMvC6ksm/cG+XwVU3zGMK5/K2kyKMoB9nis98 wKMwqkZO4zwVfbVhR404kN+OLRZMwucPEnIM9PsA8Clq8fpEF2XJiH9ZBXZIIOvXsX2ei9 rY0TKF9QyweAnBhIJXdbBQbtKNe+EvA= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-541-E6B4m9AjOWqdO9mwZmxYLA-1; Fri, 09 Apr 2021 05:08:51 -0400 X-MC-Unique: E6B4m9AjOWqdO9mwZmxYLA-1 Received: by mail-vk1-f200.google.com with SMTP id s194so1008816vkh.8 for ; Fri, 09 Apr 2021 02:08:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=d2393Qd4c8X1hLzW2JUApzcQ6s5cqFCtiM7kGDtNCds=; b=aW/NlLZzaZOBzwMa2+W+m6kRKCopN8kKWRCoYDLiW7olSHzM9UaKrW3mi9tyi/GvgP 9lxAak3L3gjCUKNIabuNAvvDWVNt5S0LYo1rHBa0WshNjK+anUFYTreCqHEZ1YIHYU1p PhUmVjLU2jlifL8EAPu28pae5j0ZJPQlD8H8zhkHGl9508Tc4eb/raNLpio/HCH0mBV+ kCywmxXXlSCFeDeaLQwm8tc9r6VG9YWTFThZdrIru3TJt54hx43jkW6yWS8oE02Z/Ta8 99QBWG1IZh6KvqT2rgDCKqtUuMgvlVHONQN1aPf05fdb1XHiBP1o2bnohKersJVD+CBp ZCyw== X-Gm-Message-State: AOAM532l1Pp3fCkvard7lcVmDzftMMO/q+AUDtnOGHqRBQESMoVm32DE NoxdGHhWoPMtZXFOZjr1NBgCHitA01rUjTkFV2SAlzAdkBNMqKbuqovsrQGM1lqs/3sjA5/xuox bTUa1I7TwLZPu0MWf43w= X-Received: by 2002:ab0:e17:: with SMTP id g23mr9751736uak.87.1617959331330; Fri, 09 Apr 2021 02:08:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIOpuUhREk4fH36+quaBODHNIM9pdeKVuo2+MaN6sPtjdqsokLgrxQ7xMFCcWzzqdqsKrTzWaMNj+6ReUytrI= X-Received: by 2002:ab0:e17:: with SMTP id g23mr9751726uak.87.1617959331081; Fri, 09 Apr 2021 02:08:51 -0700 (PDT) MIME-Version: 1.0 References: <20200626114751.22523-1-david.marchand@redhat.com> <20210324103213.29922-1-david.marchand@redhat.com> <20210324103213.29922-3-david.marchand@redhat.com> <20224994.fzTK4MuzM9@thomas> In-Reply-To: <20224994.fzTK4MuzM9@thomas> From: David Marchand Date: Fri, 9 Apr 2021 11:08:39 +0200 Message-ID: To: Thomas Monjalon Cc: dev , Andrew Rybchenko , Lukasz Wojciechowski , Ilya Maximets Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 2/3] log: track log level changes 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 Sender: "dev" On Thu, Apr 8, 2021 at 5:55 PM Thomas Monjalon wrote: > > 24/03/2021 11:32, David Marchand: > > Add a log message when registering log types and changing log levels. > [...] > > + RTE_LOG(DEBUG, EAL, "%s logtype level changed from %s to %s\n", > > I would prefer "foo log level changed" > instead of "foo logtype level changed". > Opinions? No objection for me. > > > + rte_logs.dynamic_types[type].name == NULL ? > > + "" : rte_logs.dynamic_types[type].name, > > In which case the logtype name is undefined? The logtype name is strdup(). When registering static logtypes, this could fail, and we log the level change at this point. The other path would be to call rte_log_set_level() on those static logtypes (there is also the case of the holes in the static logtypes, but if users are using them, it sounds like a hack). > If it is unexexpected, should we have "unknown" instead of ""? We could still register a "unknown" logtype, and then it would be odd :-). Empty is clear to me. -- David Marchand