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 2C5BEA0524; Fri, 19 Mar 2021 17:29:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D12D4140FF1; Fri, 19 Mar 2021 17:29:41 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id 3349040143 for ; Fri, 19 Mar 2021 17:29:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616171379; 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=MORFTHDyvZOi33I03bkPUyyXR3xAD2vasHs+LURpoYU=; b=OGJCAJ0vDZ1uPNSisysdKRF/RnFHAZXY8iPIrXrd7qdjwxrBOWuV8QuKlZfB0cdYl+vfbk dem5+N/9It+D2hQUbIGbj36b8R7WNrWksodJycb/z+vA88pKlumsbmI8zZKByRafSVDQW5 Pi3tLNxcXOt2K6dBB9+1IpdpSKBeV1k= Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-444-F9ws2knnMseGtWRroYjN5A-1; Fri, 19 Mar 2021 12:29:37 -0400 X-MC-Unique: F9ws2knnMseGtWRroYjN5A-1 Received: by mail-vk1-f199.google.com with SMTP id k198so11505528vke.12 for ; Fri, 19 Mar 2021 09:29:37 -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=MORFTHDyvZOi33I03bkPUyyXR3xAD2vasHs+LURpoYU=; b=UpadlbisMzPBBzdi98rphs4Y5iwmoUg7ZvNlbFfu0cM2+Z6qdA/tA43lqxZlgDtbxc 695yC+c5KnVxE/kwd6H3oH5y+E/gEAqdUqTGXEPY8lqK9hDigvsL7uO7ihHcMxpV1g2z AqnAetIHAftoVtca3Xq8aYKEUbD1ArXjtn9iAgwQMhaa0SsCkW6iE4FV5dBp60H2Ra5r 2MJkTE3wJeDWqFZxhNiuCDfQmTw/3fDMxAX7KlAh4L2TlrHggquMOVZOCvgZ4kTuXnDu UPJaK1kz9bmWPnEklGiH1PGXjCx9sPfSjVhrVKT52cYIiVMnyw/LHcUk2FwCA/gWQ/AW Aang== X-Gm-Message-State: AOAM532A1FwJOUUHHGf8Cu8bcfazAjeYO1+2xbza2enHR/oAgUWzU8g8 lWU6x9hrnLl9E521Wyx9ggtO6WYTsO2aX0xhnSsqx/qRdS8RcoqLygZyHbiNOSFESg/RNiOAW5b JNPQYKryK7Wwgnhj8FiE= X-Received: by 2002:a05:6102:3594:: with SMTP id h20mr3649918vsu.10.1616171376997; Fri, 19 Mar 2021 09:29:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCBjqrhU2AsPCuyqWbJe/OuCivbskXSEC8MuLcTiwiw6ToVuj476Bo1seRppHNnQNxEl6TYX0rd+1l61EEOf8= X-Received: by 2002:a05:6102:3594:: with SMTP id h20mr3649897vsu.10.1616171376722; Fri, 19 Mar 2021 09:29:36 -0700 (PDT) MIME-Version: 1.0 References: <20210310140107.2730088-1-thomas@monjalon.net> <20210310140107.2730088-4-thomas@monjalon.net> In-Reply-To: <20210310140107.2730088-4-thomas@monjalon.net> From: David Marchand Date: Fri, 19 Mar 2021 17:29:25 +0100 Message-ID: To: Thomas Monjalon Cc: dev , John Griffin , Fiona Trahe , Deepak Kumar Jain , Ajit Khaparde , Raveendra Padasalagi , Vikas Gupta , Rosen Xu , Tianfei zhang , Bruce Richardson , Nipun Gupta , Hemant Agrawal , Xiao Wang 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 3/3] drivers: align log names 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 Wed, Mar 10, 2021 at 3:02 PM Thomas Monjalon wrote: > > The log levels are configured by using the name of the logs. > Some drivers are aligned to follow a common log name standard: > pmd.class.driver[.sub] > Some "common" drivers skip the "class" part: > pmd.driver.sub Without a check, this is likely to happen again. I cooked this: diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 78a408ef98..dc52569792 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -199,6 +199,41 @@ check_internal_tags() { # return $res } +check_log_levels() { # + res=0 + + cat "$1" |awk ' + BEGIN { + pattern = ""; + ret = 0; + } + /^+++ b\// { + count = split($2, path, "/") + if (count >= 4 && path[2] == "lib") { + pattern = "lib\\." gensub(/librte_(.*)/, "\\1", "", path[3]) + } else if (count >= 5 && path[2] == "drivers") { + pattern = "pmd\\." path[3] "\\." path[4] + } else { + pattern = ""; + } + } + /^+.*RTE_LOG_REGISTER\([^,]+,[^,]+,/ { + if (pattern == "") { + next; + } + if (! ($0 ~ "RTE_LOG_REGISTER\\([^,]+, " pattern "(|\\.[^,]+),")) { + print $0 + print "Added logtype does not comply with pattern: " gensub(/\\/, "", "g", pattern) + ret = 1; + } + } + END { + exit ret; + }' || res=1 + + return $res +} + number=0 range='origin/main..' quiet=false @@ -290,6 +325,14 @@ check () { # ret=1 fi + ! $verbose || printf '\nChecking RTE_LOG_REGISTER:\n' + report=$(check_log_levels "$tmpinput") + if [ $? -ne 0 ] ; then + $headline_printed || print_headline "$3" + printf '%s\n' "$report" + ret=1 + fi + if [ "$tmpinput" != "$1" ]; then rm -f "$tmpinput" trap - INT Which for following patch: diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 761a0f26bb..ef6e3b2d0c 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -8452,7 +8452,8 @@ RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe_vf, "* igb_uio | vfio-pci"); RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe_vf, IXGBEVF_DEVARG_PFLINK_FULLCHK "=<0|1>"); -RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.init, NOTICE); +RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgb.init, NOTICE); +RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgbe.plop, NOTICE); RTE_LOG_REGISTER(ixgbe_logtype_driver, pmd.net.ixgbe.driver, NOTICE); #ifdef RTE_LIBRTE_IXGBE_DEBUG_RX diff --git a/lib/librte_compressdev/rte_compressdev.c b/lib/librte_compressdev/rte_compressdev.c index 49a342f400..d444685053 100644 --- a/lib/librte_compressdev/rte_compressdev.c +++ b/lib/librte_compressdev/rte_compressdev.c @@ -764,3 +764,5 @@ rte_compressdev_name_get(uint8_t dev_id) } RTE_LOG_REGISTER(compressdev_logtype, lib.compressdev, NOTICE); +RTE_LOG_REGISTER(compressdev_logtype, lib.compressdev, NOTICE); +RTE_LOG_REGISTER(compressdev_logtype, lib.compressde, NOTICE); Triggers: $ ./devtools/checkpatches.sh -n1 ... +RTE_LOG_REGISTER(ixgbe_logtype_init, pmd.net.ixgb.init, NOTICE); Added logtype does not comply with pattern: pmd.net.ixgbe +RTE_LOG_REGISTER(compressdev_logtype, lib.compressde, NOTICE); Added logtype does not comply with pattern: lib.compressdev WDYT? -- David Marchand