diff options
author | Josh Stone <jistone@redhat.com> | 2009-01-28 14:36:08 -0800 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-01-28 17:16:50 -0800 |
commit | 4c2732a1dad1de295c9219ee3afac007b2d7ba05 (patch) | |
tree | fb84977ad73f62ce57a147e9c3d6bf869376737c /runtime/stack.c | |
parent | 83e08fc5458e8196d5f0ed5790f9f7de77a80bb6 (diff) | |
download | systemtap-steved-4c2732a1dad1de295c9219ee3afac007b2d7ba05.tar.gz systemtap-steved-4c2732a1dad1de295c9219ee3afac007b2d7ba05.tar.xz systemtap-steved-4c2732a1dad1de295c9219ee3afac007b2d7ba05.zip |
Use 'static' as much as possible
This change just inserts 'static' on runtime, tapset, and generated C
functions and globals, so the compiler can do a better job of
optimizing.
My tests with small scripts show ~10% reduction in compile time and ~20%
reduction in module size. Larger scripts may show less benefit, but I
expect purely positive results.
Diffstat (limited to 'runtime/stack.c')
-rw-r--r-- | runtime/stack.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/stack.c b/runtime/stack.c index 23ac2edc..7ca0e316 100644 --- a/runtime/stack.c +++ b/runtime/stack.c @@ -47,7 +47,7 @@ * @param regs A pointer to the struct pt_regs. */ -void _stp_stack_print(struct pt_regs *regs, int verbose, struct kretprobe_instance *pi, int levels) +static void _stp_stack_print(struct pt_regs *regs, int verbose, struct kretprobe_instance *pi, int levels) { if (verbose) { /* print the current address */ @@ -75,7 +75,7 @@ void _stp_stack_print(struct pt_regs *regs, int verbose, struct kretprobe_instan * @param regs A pointer to the struct pt_regs. * @returns void */ -void _stp_stack_snprint(char *str, int size, struct pt_regs *regs, int verbose, struct kretprobe_instance *pi, int levels) +static void _stp_stack_snprint(char *str, int size, struct pt_regs *regs, int verbose, struct kretprobe_instance *pi, int levels) { /* To get a string, we use a simple trick. First flush the print buffer, */ /* then call _stp_stack_print, then copy the result into the output string */ @@ -93,7 +93,7 @@ void _stp_stack_snprint(char *str, int size, struct pt_regs *regs, int verbose, * @note Currently limited to a depth of two. Works from jprobes and kprobes. */ #if 0 -void _stp_ustack_print(char *str) +static void _stp_ustack_print(char *str) { struct pt_regs *nregs = ((struct pt_regs *)(THREAD_SIZE + (unsigned long)current->thread_info)) - 1; _stp_printf("%p : [user]\n", (int64_t) REG_IP(nregs)); |