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 6A3EB41C30; Tue, 7 Feb 2023 17:41:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B5A44021F; Tue, 7 Feb 2023 17:41:42 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 3487240151 for ; Tue, 7 Feb 2023 17:41:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675788099; 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=GGLTg2QEA9JeUO10cVjatH03hKxCCBWKv2FXR6U5Qm0=; b=jQr+4nJKxHueH4+INnmtSTazt1XC9yQlH1NebV66JZjMQGwJeK2facC5WGBBDba/f/1PbY mmvO+Hz+jMfqMAUsTqIXW7cfVNJLPAOau2Gc7fpRyBTK721XpXa7jWXuz6XaDvoJdlJfw5 TlUXHUq77nEfiPcdJhfDKYd4BstSN1Y= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-43-_knHTnC7PC66XIwLz9cP4w-1; Tue, 07 Feb 2023 11:41:36 -0500 X-MC-Unique: _knHTnC7PC66XIwLz9cP4w-1 Received: by mail-pf1-f200.google.com with SMTP id z2-20020a626502000000b0059085684b50so8484877pfb.16 for ; Tue, 07 Feb 2023 08:41:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GGLTg2QEA9JeUO10cVjatH03hKxCCBWKv2FXR6U5Qm0=; b=y6PleyKQuAMFOsAmmYaX9u+OOumbwfAu2rLfXNlkxgxsBkwobuGPchBIpb/2HfNd61 3RfJYA/MFu5tv1ogZUVvZ6rkObdqYYxQIrnasY9y1Tf7odJjustrtiA8VytlBp+KiRje SJbM9i5SaoA8Sro0EeUXP+a8sxCYPPxseY3duRh/34d2/3AiDNR3deEpexmLD+eOjREe hmfs+taSvwdV/wJ7/SsATWGHqf7HMXE3EdQ0lg79jrevlLubnMTDZsEcSyjJHUPoh9Xx 3MiOnjHnNgg6iTB+AgIhniHRtt/gGdK7z3mH4NLlMbYoq6l1wIKkOvb+dA26Gprd4Hjk U2nw== X-Gm-Message-State: AO0yUKWn17iWtggVfLlXtL0O9oKh//zSh+XQyw7/SSO/lQWIcRtNRiuq 6LaMr2lnXYTMpXRFeSnboIDVLIgyHY/WMwn6ei91IoYUoZjBABj4PIMY6jsFxY1H48HrdDAHPaf onQfsJpjUrUCm4tvv/HY= X-Received: by 2002:a17:902:ec8e:b0:198:f240:7e52 with SMTP id x14-20020a170902ec8e00b00198f2407e52mr905055plg.13.1675788095866; Tue, 07 Feb 2023 08:41:35 -0800 (PST) X-Google-Smtp-Source: AK7set++KCRt44s0NIywHN11JG09yQ+yplf3wMCxHA4hEWHI3jep3cUAW2ZAk/u+dqGXDw9csgPGlooPbzSkVQ/kj/4= X-Received: by 2002:a17:902:ec8e:b0:198:f240:7e52 with SMTP id x14-20020a170902ec8e00b00198f2407e52mr905048plg.13.1675788095551; Tue, 07 Feb 2023 08:41:35 -0800 (PST) MIME-Version: 1.0 References: <20230206173941.783305-1-stephen@networkplumber.org> <20230207081932.1c5836d6@hermes.local> In-Reply-To: <20230207081932.1c5836d6@hermes.local> From: David Marchand Date: Tue, 7 Feb 2023 17:41:24 +0100 Message-ID: Subject: Re: [PATCH] mbuf: replace RTE_LOGTYPE_MBUF with dynamic type To: Stephen Hemminger Cc: dev@dpdk.org, Olivier Matz X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Tue, Feb 7, 2023 at 5:19 PM Stephen Hemminger wrote: > > On Tue, 7 Feb 2023 09:34:13 +0100 > David Marchand wrote: > > > Why do we need a new naming convention? > > Please use RTE_LOG_REGISTER_DEFAULT. > > Should be use RTE_LOG_REGISTER_SUFFIX( ) with "mbuf" RTE_LOG_REGISTER_DEFAULT() hooks the logtype handle you pass to an automatic RTE_LOG_DEFAULT_LOGTYPE name based on location in the tree (generated by the build framework). #define RTE_LOG_REGISTER_IMPL(type, name, level) \ int type; \ RTE_INIT(__##type) \ { \ type = rte_log_register_type_and_pick_level(name, RTE_LOG_##level); \ if (type < 0) \ type = RTE_LOGTYPE_EAL; \ } #define RTE_LOG_REGISTER_DEFAULT(type, level) \ RTE_LOG_REGISTER_IMPL(type, RTE_STR(RTE_LOG_DEFAULT_LOGTYPE), level) When compiling: [4/5] ccache cc -Ilib/librte_mbuf.a.p -Ilib -I../lib -Ilib/mbuf -I../lib/mbuf -I. -I.. -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include -I../lib/eal/linux/include -Ilib/eal/x86/include -I../lib/eal/x86/include -Ilib/eal/common -I../lib/eal/common -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs -Ilib/metrics -I../lib/metrics -Ilib/telemetry -I../lib/telemetry -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -O2 -g -include rte_config.h -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-zero-length-bounds -D_GNU_SOURCE -Wno-error=array-bounds -DRTE_LIBRTE_BBDEV_DEBUG -DRTE_LIBRTE_EVENTDEV_DEBUG -DRTE_LIBRTE_IEEE1588 -fPIC -march=corei7 -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation -DRTE_LOG_DEFAULT_LOGTYPE=lib.mbuf -MD -MQ lib/librte_mbuf.a.p/mbuf_rte_mbuf.c.o -MF lib/librte_mbuf.a.p/mbuf_rte_mbuf.c.o.d -o lib/librte_mbuf.a.p/mbuf_rte_mbuf.c.o -c ../lib/mbuf/rte_mbuf.c RTE_LOG_REGISTER_SUFFIX() may be used to define "sub" logtypes, like if you needed lib.mbuf.foo. -- David Marchand