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 /tapset/nfs_proc.stp | |
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 'tapset/nfs_proc.stp')
-rw-r--r-- | tapset/nfs_proc.stp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tapset/nfs_proc.stp b/tapset/nfs_proc.stp index 4f841836..11463e9a 100644 --- a/tapset/nfs_proc.stp +++ b/tapset/nfs_proc.stp @@ -5,18 +5,18 @@ %{ /*Get rpc_clnt from inode, same as kernel function NFS_CLIENT*/ - struct rpc_clnt *_stap_NFS_CLIENT(struct inode *inode, struct context * __restrict__ c); + static struct rpc_clnt *_stap_NFS_CLIENT(struct inode *inode, struct context * __restrict__ c); /*Get ip address from a rpc_clnt*/ - __u32 _get_ip_from_client(struct rpc_clnt *clnt, struct context * __restrict__ c); + static __u32 _get_ip_from_client(struct rpc_clnt *clnt, struct context * __restrict__ c); /*Get protocol types from a rpc_clnt*/ - int _get_prot_from_client(struct rpc_clnt *clnt, struct context * __restrict__ c); + static int _get_prot_from_client(struct rpc_clnt *clnt, struct context * __restrict__ c); /*Get ip address from a rpc_task*/ - __u32 get_ip(struct rpc_task *, struct context * __restrict__); + static __u32 get_ip(struct rpc_task *, struct context * __restrict__); /*Get protocol types from a rpc_task*/ - int get_prot(struct rpc_task *, struct context * __restrict__); + static int get_prot(struct rpc_task *, struct context * __restrict__); %} %{ - struct rpc_clnt *_stap_NFS_CLIENT(struct inode *inode, struct context * __restrict__ c) { + static struct rpc_clnt *_stap_NFS_CLIENT(struct inode *inode, struct context * __restrict__ c) { struct super_block *i_sb; struct nfs_server *server; i_sb = kread(&(inode->i_sb)); @@ -26,7 +26,7 @@ return NULL; } - __u32 _get_ip_from_client(struct rpc_clnt *clnt, struct context * __restrict__ c) { + static __u32 _get_ip_from_client(struct rpc_clnt *clnt, struct context * __restrict__ c) { struct rpc_xprt * cl_xprt; struct sockaddr_in *addr; cl_xprt= kread(&(clnt->cl_xprt)); @@ -39,7 +39,7 @@ return -1; } - int _get_prot_from_client(struct rpc_clnt *clnt, struct context * __restrict__ c) { + static int _get_prot_from_client(struct rpc_clnt *clnt, struct context * __restrict__ c) { struct rpc_xprt * cl_xprt; cl_xprt= kread(&(clnt->cl_xprt)); return kread(&(cl_xprt->prot)); @@ -47,7 +47,7 @@ return -1; } - __u32 get_ip(struct rpc_task * task, struct context * __restrict__ c) { + static __u32 get_ip(struct rpc_task * task, struct context * __restrict__ c) { struct rpc_clnt * clnt; clnt = kread(&(task->tk_client)); return _get_ip_from_client(clnt, c); @@ -55,7 +55,7 @@ return -1; } - int get_prot(struct rpc_task * task, struct context * __restrict__ c) { + static int get_prot(struct rpc_task * task, struct context * __restrict__ c) { struct rpc_clnt * clnt; clnt = kread(&(task->tk_client)); return _get_prot_from_client(clnt, c); |