From patchwork Mon Jan 19 01:56:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 43285 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 636A32034D for ; Mon, 19 Jan 2015 01:57:16 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id n3sf2281626wiv.0 for ; Sun, 18 Jan 2015 17:57:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=jdEVKnGVjiqGRsQO+PqrvVZ9HsM35+EE3B7tZzDEUvI=; b=CrMh1YARhp3/osINJQ6ZztG3hPnQGTHATVUZQsNr/QAgwe4PGngZpskRt2yAAgE7fB LqoMp/Fz1NL0l4xXb+6x8IgkTUApoS4R7A7SPMuvvAht1lt3bdR7A00UhTIVbBEdIn0/ T/ATiWGFXYOubsdZRtX8Pg6LbvU4oOZNupNFAAWVlcphwXs9wL34YB0V/tPaQAbJwuaW T/t4HCL0WWAqAysuPBX9zXGuMYIYWQozLHpiVW7QHmtdDrcGqHM1YXkW8t6CVw+TJJWf f5zUHsbQ9qZP/JMBvKNseUcq+FMKoLkMu9GdEjEjJkOOeFYwGXOTN7MGZr+kB9wHwg+C IZqA== X-Gm-Message-State: ALoCoQlD+YsZwVZMwa1cUEIE9Dz0Zr/YBS4FviHQwtKvNC/21qXp6k7DcE1POrEVZ36/pZMOw53K X-Received: by 10.180.82.34 with SMTP id f2mr1690274wiy.1.1421632635733; Sun, 18 Jan 2015 17:57:15 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.201 with SMTP id x9ls572742lae.89.gmail; Sun, 18 Jan 2015 17:57:15 -0800 (PST) X-Received: by 10.152.5.132 with SMTP id s4mr21251593las.39.1421632635572; Sun, 18 Jan 2015 17:57:15 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id qr3si9576198lbb.73.2015.01.18.17.57.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 Jan 2015 17:57:15 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id ms9so4012308lab.1 for ; Sun, 18 Jan 2015 17:57:15 -0800 (PST) X-Received: by 10.152.8.11 with SMTP id n11mr26640253laa.38.1421632635488; Sun, 18 Jan 2015 17:57:15 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp945766lbb; Sun, 18 Jan 2015 17:57:14 -0800 (PST) X-Received: by 10.224.45.69 with SMTP id d5mr44659578qaf.56.1421632634167; Sun, 18 Jan 2015 17:57:14 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id m8si15394138qay.103.2015.01.18.17.57.11 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 18 Jan 2015 17:57:14 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YD1aX-0007NH-VZ; Mon, 19 Jan 2015 01:57:09 +0000 Received: from mail-qa0-f51.google.com ([209.85.216.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YD1aC-0007L7-Rr for lng-odp@lists.linaro.org; Mon, 19 Jan 2015 01:56:48 +0000 Received: by mail-qa0-f51.google.com with SMTP id f12so21357118qad.10 for ; Sun, 18 Jan 2015 17:56:43 -0800 (PST) X-Received: by 10.224.4.133 with SMTP id 5mr34581289qar.37.1421632603719; Sun, 18 Jan 2015 17:56:43 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id u15sm9532139qag.21.2015.01.18.17.56.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Jan 2015 17:56:43 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Sun, 18 Jan 2015 20:56:24 -0500 Message-Id: <1421632584-26181-5-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1421632584-26181-1-git-send-email-mike.holmes@linaro.org> References: <1421632584-26181-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 4/4] api: move loging out of odp_debug X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Only odp_init needs the logging definitions so remove them from odp_debug.h Signed-off-by: Mike Holmes --- platform/linux-generic/include/api/odp_debug.h | 32 ----------------------- platform/linux-generic/include/api/odp_init.h | 36 +++++++++++++++++++++++++- platform/linux-generic/include/odp_internal.h | 2 +- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/platform/linux-generic/include/api/odp_debug.h b/platform/linux-generic/include/api/odp_debug.h index 4c32500..ce07e85 100644 --- a/platform/linux-generic/include/api/odp_debug.h +++ b/platform/linux-generic/include/api/odp_debug.h @@ -48,38 +48,6 @@ extern "C" { #define _ODP_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg) /** - * ODP log level. - */ -typedef enum odp_log_level { - ODP_LOG_DBG, - ODP_LOG_ERR, - ODP_LOG_UNIMPLEMENTED, - ODP_LOG_ABORT, - ODP_LOG_PRINT -} odp_log_level_e; - -/** - * ODP log function - * - * Instead of direct prints to stdout/stderr all logging in ODP implementation - * should be done via this function or its wrappers. - * ODP platform MUST provide a default *weak* implementation of this function. - * Application MAY override the function if needed by providing a strong - * function. - * - * @param[in] level Log level - * @param[in] fmt printf-style message format - * - * @return The number of characters logged if succeeded. Otherwise returns - * a negative number. - */ -extern int odp_override_log(odp_log_level_e level, const char *fmt, ...); - - -/** Replaceable logging function */ -typedef int (*odp_log_func_t)(odp_log_level_e level, const char *fmt, ...); - -/** * @} */ diff --git a/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h index 73c4a3b..b0ea316 100644 --- a/platform/linux-generic/include/api/odp_init.h +++ b/platform/linux-generic/include/api/odp_init.h @@ -29,13 +29,47 @@ extern "C" { #include -#include /** @defgroup odp_initialization ODP INITIALIZATION * Initialisation operations. * @{ */ +/** + * ODP log level. + */ +typedef enum odp_log_level { + ODP_LOG_DBG, + ODP_LOG_ERR, + ODP_LOG_UNIMPLEMENTED, + ODP_LOG_ABORT, + ODP_LOG_PRINT +} odp_log_level_e; + +/** + * ODP log function + * + * Instead of direct prints to stdout/stderr all logging in ODP implementation + * should be done via this function or its wrappers. + * ODP platform MUST provide a default *weak* implementation of this function. + * Application MAY override the function if needed by providing a strong + * function. + * + * @warning The use of the weak replacement is not as portable as using the + * odp_init_global() function parmiters. + * + * @param[in] level Log level + * @param[in] fmt printf-style message format + * + * @return The number of characters logged if succeeded. Otherwise returns + * a negative number. + */ +int odp_override_log(odp_log_level_e level, const char *fmt, ...); + + +/** Replaceable logging function */ +typedef int (*odp_log_func_t)(odp_log_level_e level, const char *fmt, ...); + /** ODP initialization data. * Data that is required to initialize the ODP API with the * application specific data such as specifying a logging callback, the log diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 7401a30..07c9f60 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -18,7 +18,7 @@ extern "C" { #endif -#include +#include struct odp_global_data { odp_log_func_t log_fn;