[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen: Annotate printk() as cold



commit 7e939abca7446256b59dc5d61e5ac444deb53da5
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Sat Feb 18 00:46:49 2023 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Tue Nov 21 13:28:51 2023 +0000

    xen: Annotate printk() as cold
    
    There is no such thing as a fastpath with a printk() on it, making printk() 
an
    excellent heuristic for slowpaths.
    
    Net delta is:
    
      add/remove: 595/2 grow/shrink: 56/762 up/down: 70879/-87331 (-16452)
      Total: Before=4085425, After=4068973, chg -0.40%
    
    because cold functions are optimised differently.  For example, one function
    with a particularly large swing is:
    
      vmcs_dump_vcpu.cold                            -    2172   +2172
      vmcs_dump_vcpu                              7030     408   -6622
    
    with a net delta of 7030 down to 4450.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/include/xen/lib.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 8eef557dd5..1793be5b6b 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -79,7 +79,7 @@ debugtrace_printk(const char *fmt, ...) {}
 /* Allows us to use '%p' as general-purpose machine-word format char. */
 #define _p(_x) ((void *)(unsigned long)(_x))
 extern void printk(const char *fmt, ...)
-    __attribute__ ((format (printf, 1, 2)));
+    __attribute__ ((format (printf, 1, 2), cold));
 
 #define printk_once(fmt, args...)               \
 ({                                              \
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.