summaryrefslogtreecommitdiffstats
path: root/runtime/stat.c
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-01-28 14:36:08 -0800
committerJosh Stone <jistone@redhat.com>2009-01-28 17:16:50 -0800
commit4c2732a1dad1de295c9219ee3afac007b2d7ba05 (patch)
treefb84977ad73f62ce57a147e9c3d6bf869376737c /runtime/stat.c
parent83e08fc5458e8196d5f0ed5790f9f7de77a80bb6 (diff)
downloadsystemtap-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/stat.c')
-rw-r--r--runtime/stat.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/stat.c b/runtime/stat.c
index e40a4f2d..689a84fe 100644
--- a/runtime/stat.c
+++ b/runtime/stat.c
@@ -74,7 +74,7 @@ typedef struct _Stat *Stat;
* @param stop - An integer. The stopping value. Should be > start.
* @param interval - An integer. The interval.
*/
-Stat _stp_stat_init (int type, ...)
+static Stat _stp_stat_init (int type, ...)
{
int size, buckets=0, start=0, stop=0, interval=0;
stat *sd, *agg;
@@ -141,7 +141,7 @@ exit1:
*
* @param st Stat
*/
-void _stp_stat_del (Stat st)
+static void _stp_stat_del (Stat st)
{
if (st) {
_stp_free_percpu (st->sd);
@@ -156,7 +156,7 @@ void _stp_stat_del (Stat st)
* @param st Stat
* @param val Value to add
*/
-void _stp_stat_add (Stat st, int64_t val)
+static void _stp_stat_add (Stat st, int64_t val)
{
stat *sd = per_cpu_ptr (st->sd, get_cpu());
STAT_LOCK(sd);
@@ -175,7 +175,7 @@ void _stp_stat_add (Stat st, int64_t val)
* @param cpu CPU number
* @returns A pointer to a stat.
*/
-stat *_stp_stat_get_cpu (Stat st, int cpu)
+static stat *_stp_stat_get_cpu (Stat st, int cpu)
{
stat *sd = per_cpu_ptr (st->sd, cpu);
STAT_LOCK(sd);
@@ -203,7 +203,7 @@ static void _stp_stat_clear_data (Stat st, stat *sd)
* for polling.
* @returns A pointer to a stat.
*/
-stat *_stp_stat_get (Stat st, int clear)
+static stat *_stp_stat_get (Stat st, int clear)
{
int i, j;
stat *agg = st->agg;
@@ -242,7 +242,7 @@ stat *_stp_stat_get (Stat st, int clear)
*
* @param st Stat
*/
-void _stp_stat_clear (Stat st)
+static void _stp_stat_clear (Stat st)
{
int i;
stp_for_each_cpu(i) {