aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/9p
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-11-28 13:40:46 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2012-01-05 11:51:44 -0500
commit5d3851530d6d68564e4e0ce04d0547d4d106fc72 (patch)
treed47065fcc1f93f00070afe597a98ab185fd13859 /include/net/9p
parenta0ea787b027b79cf2e01c6758e5246db06520158 (diff)
9p: Reduce object size with CONFIG_NET_9P_DEBUG
Reduce object size by deduplicating formats. Use vsprintf extension %pV. Rename P9_DPRINTK uses to p9_debug, align arguments. Add function for _p9_debug and macro to add __func__. Add missing "\n"s to p9_debug uses. Remove embedded function names as p9_debug adds it. Remove P9_EPRINTK macro and convert use to pr_<level>. Add and use pr_fmt and pr_<level>. $ size fs/9p/built-in.o* text data bss dec hex filename 62133 984 16000 79117 1350d fs/9p/built-in.o.new 67342 984 16928 85254 14d06 fs/9p/built-in.o.old $ size net/9p/built-in.o* text data bss dec hex filename 88792 4148 22024 114964 1c114 net/9p/built-in.o.new 94072 4148 23232 121452 1da6c net/9p/built-in.o.old Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'include/net/9p')
-rw-r--r--include/net/9p/9p.h28
1 files changed, 7 insertions, 21 deletions
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 2d70b95b3b55..7184853ca360 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -63,30 +63,16 @@ enum p9_debug_flags {
63 63
64#ifdef CONFIG_NET_9P_DEBUG 64#ifdef CONFIG_NET_9P_DEBUG
65extern unsigned int p9_debug_level; 65extern unsigned int p9_debug_level;
66 66__printf(3, 4)
67#define P9_DPRINTK(level, format, arg...) \ 67void _p9_debug(enum p9_debug_flags level, const char *func,
68do { \ 68 const char *fmt, ...);
69 if ((p9_debug_level & level) == level) {\ 69#define p9_debug(level, fmt, ...) \
70 if (level == P9_DEBUG_9P) \ 70 _p9_debug(level, __func__, fmt, ##__VA_ARGS__)
71 printk(KERN_NOTICE "(%8.8d) " \
72 format , task_pid_nr(current) , ## arg); \
73 else \
74 printk(KERN_NOTICE "-- %s (%d): " \
75 format , __func__, task_pid_nr(current) , ## arg); \
76 } \
77} while (0)
78
79#else 71#else
80#define P9_DPRINTK(level, format, arg...) do { } while (0) 72#define p9_debug(level, fmt, ...) \
73 no_printk(fmt, ##__VA_ARGS__)
81#endif 74#endif
82 75
83
84#define P9_EPRINTK(level, format, arg...) \
85do { \
86 printk(level "9p: %s (%d): " \
87 format , __func__, task_pid_nr(current), ## arg); \
88} while (0)
89
90/** 76/**
91 * enum p9_msg_t - 9P message types 77 * enum p9_msg_t - 9P message types
92 * @P9_TLERROR: not used 78 * @P9_TLERROR: not used