aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ring_buffer.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2009-01-09 15:27:09 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-10 21:44:16 -0500
commit34a148bf0911a4a1cae85f8ecba57affb4d76aee (patch)
tree28c6a27c48084f9457a8f24f6b1f89b8b47ae922 /kernel/trace/ring_buffer.c
parent99cd7074891f87c49660e3b2880564324a4733ac (diff)
kernel/trace/ring_buffer.c: reduce inlining
text data bss dec hex filename before: 11320 228 8 11556 2d24 kernel/trace/ring_buffer.o after: 10592 228 8 10828 2a4c kernel/trace/ring_buffer.o Also: free_page(0) is legal. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r--kernel/trace/ring_buffer.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 8b0daf0662ef..9542990f515b 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -133,7 +133,7 @@ enum {
133}; 133};
134 134
135/* inline for ring buffer fast paths */ 135/* inline for ring buffer fast paths */
136static inline unsigned 136static unsigned
137rb_event_length(struct ring_buffer_event *event) 137rb_event_length(struct ring_buffer_event *event)
138{ 138{
139 unsigned length; 139 unsigned length;
@@ -179,7 +179,7 @@ unsigned ring_buffer_event_length(struct ring_buffer_event *event)
179EXPORT_SYMBOL_GPL(ring_buffer_event_length); 179EXPORT_SYMBOL_GPL(ring_buffer_event_length);
180 180
181/* inline for ring buffer fast paths */ 181/* inline for ring buffer fast paths */
182static inline void * 182static void *
183rb_event_data(struct ring_buffer_event *event) 183rb_event_data(struct ring_buffer_event *event)
184{ 184{
185 BUG_ON(event->type != RINGBUF_TYPE_DATA); 185 BUG_ON(event->type != RINGBUF_TYPE_DATA);
@@ -229,10 +229,9 @@ static void rb_init_page(struct buffer_data_page *bpage)
229 * Also stolen from mm/slob.c. Thanks to Mathieu Desnoyers for pointing 229 * Also stolen from mm/slob.c. Thanks to Mathieu Desnoyers for pointing
230 * this issue out. 230 * this issue out.
231 */ 231 */
232static inline void free_buffer_page(struct buffer_page *bpage) 232static void free_buffer_page(struct buffer_page *bpage)
233{ 233{
234 if (bpage->page) 234 free_page((unsigned long)bpage->page);
235 free_page((unsigned long)bpage->page);
236 kfree(bpage); 235 kfree(bpage);
237} 236}
238 237
@@ -811,7 +810,7 @@ rb_event_index(struct ring_buffer_event *event)
811 return (addr & ~PAGE_MASK) - (PAGE_SIZE - BUF_PAGE_SIZE); 810 return (addr & ~PAGE_MASK) - (PAGE_SIZE - BUF_PAGE_SIZE);
812} 811}
813 812
814static inline int 813static int
815rb_is_commit(struct ring_buffer_per_cpu *cpu_buffer, 814rb_is_commit(struct ring_buffer_per_cpu *cpu_buffer,
816 struct ring_buffer_event *event) 815 struct ring_buffer_event *event)
817{ 816{
@@ -825,7 +824,7 @@ rb_is_commit(struct ring_buffer_per_cpu *cpu_buffer,
825 rb_commit_index(cpu_buffer) == index; 824 rb_commit_index(cpu_buffer) == index;
826} 825}
827 826
828static inline void 827static void
829rb_set_commit_event(struct ring_buffer_per_cpu *cpu_buffer, 828rb_set_commit_event(struct ring_buffer_per_cpu *cpu_buffer,
830 struct ring_buffer_event *event) 829 struct ring_buffer_event *event)
831{ 830{
@@ -850,7 +849,7 @@ rb_set_commit_event(struct ring_buffer_per_cpu *cpu_buffer,
850 local_set(&cpu_buffer->commit_page->page->commit, index); 849 local_set(&cpu_buffer->commit_page->page->commit, index);
851} 850}
852 851
853static inline void 852static void
854rb_set_commit_to_write(struct ring_buffer_per_cpu *cpu_buffer) 853rb_set_commit_to_write(struct ring_buffer_per_cpu *cpu_buffer)
855{ 854{
856 /* 855 /*
@@ -896,7 +895,7 @@ static void rb_reset_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
896 cpu_buffer->reader_page->read = 0; 895 cpu_buffer->reader_page->read = 0;
897} 896}
898 897
899static inline void rb_inc_iter(struct ring_buffer_iter *iter) 898static void rb_inc_iter(struct ring_buffer_iter *iter)
900{ 899{
901 struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer; 900 struct ring_buffer_per_cpu *cpu_buffer = iter->cpu_buffer;
902 901
@@ -926,7 +925,7 @@ static inline void rb_inc_iter(struct ring_buffer_iter *iter)
926 * and with this, we can determine what to place into the 925 * and with this, we can determine what to place into the
927 * data field. 926 * data field.
928 */ 927 */
929static inline void 928static void
930rb_update_event(struct ring_buffer_event *event, 929rb_update_event(struct ring_buffer_event *event,
931 unsigned type, unsigned length) 930 unsigned type, unsigned length)
932{ 931{
@@ -964,7 +963,7 @@ rb_update_event(struct ring_buffer_event *event,
964 } 963 }
965} 964}
966 965
967static inline unsigned rb_calculate_event_length(unsigned length) 966static unsigned rb_calculate_event_length(unsigned length)
968{ 967{
969 struct ring_buffer_event event; /* Used only for sizeof array */ 968 struct ring_buffer_event event; /* Used only for sizeof array */
970 969
@@ -1438,7 +1437,7 @@ int ring_buffer_write(struct ring_buffer *buffer,
1438} 1437}
1439EXPORT_SYMBOL_GPL(ring_buffer_write); 1438EXPORT_SYMBOL_GPL(ring_buffer_write);
1440 1439
1441static inline int rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer) 1440static int rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
1442{ 1441{
1443 struct buffer_page *reader = cpu_buffer->reader_page; 1442 struct buffer_page *reader = cpu_buffer->reader_page;
1444 struct buffer_page *head = cpu_buffer->head_page; 1443 struct buffer_page *head = cpu_buffer->head_page;