From patchwork Thu Sep 21 18:44:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radoslaw Biernacki X-Patchwork-Id: 113925 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2355334qgf; Thu, 21 Sep 2017 11:44:23 -0700 (PDT) X-Received: by 10.223.136.123 with SMTP id e56mr2854852wre.227.1506019463825; Thu, 21 Sep 2017 11:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506019463; cv=none; d=google.com; s=arc-20160816; b=dnRTe9KBCOoGL4UbfYreAgRJvMLomfRjs9zMRweEgKVVeXuzZ7DINk/hYBdSUK/jTx 1oT/JlU+pXb6G9NNfswB7Dm4nMXCbEd2dSNjRLC3ZXHcgH53JfNFX6heB64M096M/kNe SdqxwaHhPIfuy2iuqCKtnKv3VB1wIrDH60prg+dpHMUHp27wGXqUdAXgXr0tqrc42v84 KObrpmXX1hlx3lUW09XWj21xNI0R4F9pF8qwG5+wLiEoo0eI6ydGvCxF3BvYEln9WIXh mRBbX00MkShCi73ZA5c6lw4G9h+lBWwLi/+BMN46XQfJnMVxuNGEcPEkRlBfrsSI7SX1 oQcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from:dkim-signature:arc-authentication-results; bh=gdDi/Ik2iJoxjIFz1lzXRM+QHNnmr5GnGFiiHjOJBGE=; b=0PrRCc8fKB2hMoP+QobuuYOYgtjFRuGzpNBIej8uD23n2BEAJpsJfLCh0bJXoYMyrr Lv5zZyQGSQgWpc2BWOzKYT3SXvLf1Fnw2f3rnq/pZD9x5ol2ybtGE+qDcqWSoKLQVXUz G5rnnaj3KoX7EtIi+UyxZum6lviZZlj8nkMmzam8DBWktIzji8MALeocYyNvONkkejhN HKZ7siR+rfhJklxYK+i7ZbJrXNtvJNkJzNVbiLk981Yl5GjR8Rb26E3qLAIzTXmUPjea PcCxQ8eanXyEZwMA6VOR2WisZVJDbM+iXMvKFHEIjW73owBzJNkYa5YcBs6D8D6bu+23 25vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ir9JqGFF; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 63si1499270wrh.187.2017.09.21.11.44.23; Thu, 21 Sep 2017 11:44:23 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ir9JqGFF; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D4B701B1A8; Thu, 21 Sep 2017 20:44:22 +0200 (CEST) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by dpdk.org (Postfix) with ESMTP id 63A611B1A3 for ; Thu, 21 Sep 2017 20:44:21 +0200 (CEST) Received: by mail-lf0-f50.google.com with SMTP id y187so6654281lfc.8 for ; Thu, 21 Sep 2017 11:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=gdDi/Ik2iJoxjIFz1lzXRM+QHNnmr5GnGFiiHjOJBGE=; b=ir9JqGFFwLh7Qv3kLjEIoRYtlu0AsHDvLT1W4VcCTbnTX1pUKDGANgDaP4PdEzoFkC COPl95xjOGHdfZoNx9oZKrNzaY/yt4mzy1CiZMi/oGacD9/p1fXF2rGhNlUZOaR1pa9P rfb/qoYDRPBGfrpY09tMyEDN+PnbvablLOLfQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gdDi/Ik2iJoxjIFz1lzXRM+QHNnmr5GnGFiiHjOJBGE=; b=ByNUXAgKiGwGdJ3YctVy0uWuCdGt9zrnj+KPY8HCnnhRQ4PPycdglbrUg265TpuQ5m FptuvSuyTg0g/Yw1BDBKdNa8vsmJyC6hEvTPwwp5u9FugwvH5LOUCwn7S4RzVkAbdWZT tnsQzEBUSgAcK8AH+LFEusb3qHloi3OtiG8nXuwNKsDRUoVOjiajwX4PwsLYfn/Qwu3/ Zgo0O5ubl1DhZZ96EzLewoM8XUFJ3D5zJYtBUqPdCYfnfGd1k5DAZNlWF+6rCg0atGlF R3/0AiVACqqagW2ZmzC5GcDGYS/vnLKzDKtjH4jWttAaRm4J5XaN/fot1BMqw5sQCkMx 0m8Q== X-Gm-Message-State: AHPjjUhOP7z96vNsHnvH+FzpiTNkAHXOeKG6XuFN+V0Wm90C1GXemR3G LU4tCkmoLzaQoKz5+7Rp214Q9TqVc1o= X-Google-Smtp-Source: AOwi7QAdKlrrAyR+LX6CDO9xYlnFbbPBA+TCbsTVxnLm+s+LDBNS465/eNtGH0o8pxtqpOVyvtuZIA== X-Received: by 10.46.21.6 with SMTP id s6mr1362323ljd.70.1506019460846; Thu, 21 Sep 2017 11:44:20 -0700 (PDT) Received: from rad-H81M-S1.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id b8sm421948ljf.60.2017.09.21.11.44.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Sep 2017 11:44:19 -0700 (PDT) From: Radoslaw Biernacki To: dev@dpdk.org Cc: olivier.matz@6wind.com, stable@dpdk.org Date: Thu, 21 Sep 2017 20:44:09 +0200 Message-Id: <1506019449-18782-1-git-send-email-radoslaw.biernacki@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] test/logs: fix dynamic log levels testing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" This patch fixes the dynamic log levels testing in logs_autotest. Introduction of rte_log_set_level() in patch c1b5fa94a46f was done with parameter RTE_LOG_EMERG which caused all RTE_LOG() calls an early return due to all given levels were far below EMERG. If first two logs supposed to show up on console, the initial log level must be low (DEBUG). It is than changed above ERR when we test if TESTAPP2 log type can be filtered by log type log level. Fixes: c1b5fa94a46f ("eal: support dynamic log types") Signed-off-by: Radoslaw Biernacki --- test/test/test_logs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.7.4 Acked-by: Olivier Matz diff --git a/test/test/test_logs.c b/test/test/test_logs.c index 730a86b..2a77064 100644 --- a/test/test/test_logs.c +++ b/test/test/test_logs.c @@ -61,9 +61,9 @@ static int test_logs(void) { - /* enable these logs type */ - rte_log_set_level(RTE_LOGTYPE_TESTAPP1, RTE_LOG_EMERG); - rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_EMERG); + /* set logtype level low to so we can test global level */ + rte_log_set_level(RTE_LOGTYPE_TESTAPP1, RTE_LOG_DEBUG); + rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_DEBUG); /* log in error level */ rte_log_set_global_level(RTE_LOG_ERR); @@ -75,8 +75,8 @@ test_logs(void) RTE_LOG(ERR, TESTAPP2, "error message (not displayed)\n"); RTE_LOG(CRIT, TESTAPP2, "critical message\n"); - /* disable one log type */ - rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_DEBUG); + /* bump up single log type level above global to test it */ + rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_EMERG); /* log in error level */ rte_log_set_global_level(RTE_LOG_ERR);