From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fiji.vyatta.com (fiji.vyatta.com [76.74.103.50]) by dpdk.org (Postfix) with ESMTP id 906A46A8C for ; Thu, 30 May 2013 19:21:31 +0200 (CEST) Received: by fiji.vyatta.com (Postfix, from userid 1051) id B89F9B24009; Thu, 30 May 2013 08:08:24 -0700 (PDT) Message-Id: <20130530171626.884622340@vyatta.com> User-Agent: quilt/0.60-1 Date: Thu, 30 May 2013 10:12:37 -0700 From: Stephen Hemminger To: dev@dpdk.org References: <20130530171234.301927271@vyatta.com> Content-Disposition: inline; filename=rte_panic-cold.patch X-Mailman-Approved-At: Thu, 30 May 2013 23:34:47 +0200 Subject: [dpdk-dev] [PATCH 3/7] optimize log/panic X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 17:21:31 -0000 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 --- lib/librte_eal/common/include/rte_debug.h | 1 + lib/librte_eal/common/include/rte_log.h | 1 + 2 files changed, 2 insertions(+) --- a/lib/librte_eal/common/include/rte_debug.h 2013-05-29 08:45:38.888471864 -0700 +++ b/lib/librte_eal/common/include/rte_debug.h 2013-05-29 08:49:12.361864834 -0700 @@ -87,6 +87,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))); --- a/lib/librte_eal/common/include/rte_log.h 2013-03-28 08:50:50.234413869 -0700 +++ b/lib/librte_eal/common/include/rte_log.h 2013-05-29 08:49:12.361864834 -0700 @@ -216,6 +216,7 @@ int rte_log_add_in_history(const char *b * - Negative on error. */ int rte_log(uint32_t level, uint32_t logtype, const char *format, ...) + __attribute__((cold)) __attribute__((format(printf, 3, 4))); /**