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:
parent
494a02537f
commit
2450abdf90
@ -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)));
|
||||
|
||||
|
@ -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)));
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user