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 <shemminger@vyatta.com>
Reviewed-by: Vincent Jardin <vincent.jardin@6wind.com>
This commit is contained in:
Stephen Hemminger 2013-05-30 17:12:37 +00:00 committed by Thomas Monjalon
parent 494a02537f
commit 2450abdf90
2 changed files with 2 additions and 0 deletions

View File

@ -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)));

View File

@ -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)));
/**