From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by dpdk.org (Postfix) with ESMTP id 4254B1B19D for ; Thu, 21 Sep 2017 20:44:21 +0200 (CEST) Received: by mail-lf0-f46.google.com with SMTP id k23so6620672lfi.11 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=MRgfYl8FZKdoomLBRg7m9xsQ637UaN1kU98uIyhQUonyxNin0DG6hgn+JzUoY15SQl kda5iNjGIu8ajoNh2UoPX7wI40lxO9V8W69XAJwKg3RKWjsI/HRrhG08pA4XvdUS/hW+ G0eqwFmcHgWLCSaRbfKPfMh/CTwuSUCwbkRnfWfOdXI2d8DKAx4NzBmdcJSdpx95Jk24 7f993bOOUIBNBOWJUPh+0a4WE5n7elmJrvbqbDrBXoP1hKF2qNZcBNpPyB68zhZ483TA 2jcCmz0b00yNj0fV+WEZZVjdd3+50dGZWHmJeB3L2N8SbCiwS2V6Gq5zh3J9Iq4YkdjN NQ3Q== X-Gm-Message-State: AHPjjUjk9JZhABi80ul44nxGkXa7T7lMj/hL1vBRi4/siWfQ1KXYlEjo XXX3E6lAbS00XvLWQF6u2nY4Rg== 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-stable] [PATCH] test/logs: fix dynamic log levels testing X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2017 18:44:21 -0000 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(-) 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); -- 2.7.4