From: Stephen Hemminger Date: Thu, 30 May 2013 17:12:37 +0000 (+0000) Subject: log: optimize log/panic with attribute cold X-Git-Tag: spdx-start~11256 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2450abdf9039621f93cd1bdf5c1dbea96659b633;p=dpdk.git log: optimize log/panic with attribute cold Both logging and calls to panic are never in the critical path. Use the GCC attribute cold to mark these functions as cold, which generates more optimised code. Signed-off-by: Stephen Hemminger Reviewed-by: Vincent Jardin --- diff --git a/lib/librte_eal/common/include/rte_debug.h b/lib/librte_eal/common/include/rte_debug.h index e191a2123f..acb4a9f4f5 100644 --- a/lib/librte_eal/common/include/rte_debug.h +++ b/lib/librte_eal/common/include/rte_debug.h @@ -86,6 +86,7 @@ void rte_dump_registers(void); * documentation. */ void __rte_panic(const char *funcname , const char *format, ...) + __attribute__((cold)) __attribute__((noreturn)) __attribute__((format(printf, 2, 3))); diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h index 3dbe010415..5f568c8177 100644 --- a/lib/librte_eal/common/include/rte_log.h +++ b/lib/librte_eal/common/include/rte_log.h @@ -217,6 +217,7 @@ int rte_log_add_in_history(const char *buf, size_t size); * - Negative on error. */ int rte_log(uint32_t level, uint32_t logtype, const char *format, ...) + __attribute__((cold)) __attribute__((format(printf, 3, 4))); /**