stats.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * linux/include/linux/sunrpc/stats.h
  3. *
  4. * Client statistics collection for SUN RPC
  5. *
  6. * Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de>
  7. */
  8. #ifndef _LINUX_SUNRPC_STATS_H
  9. #define _LINUX_SUNRPC_STATS_H
  10. #include <linux/proc_fs.h>
  11. struct rpc_stat {
  12. const struct rpc_program *program;
  13. unsigned int netcnt,
  14. netudpcnt,
  15. nettcpcnt,
  16. nettcpconn,
  17. netreconn;
  18. unsigned int rpccnt,
  19. rpcretrans,
  20. rpcauthrefresh,
  21. rpcgarbage;
  22. };
  23. struct svc_stat {
  24. struct svc_program * program;
  25. unsigned int netcnt,
  26. netudpcnt,
  27. nettcpcnt,
  28. nettcpconn;
  29. unsigned int rpccnt,
  30. rpcbadfmt,
  31. rpcbadauth,
  32. rpcbadclnt;
  33. };
  34. struct net;
  35. #ifdef CONFIG_PROC_FS
  36. int rpc_proc_init(struct net *);
  37. void rpc_proc_exit(struct net *);
  38. #else
  39. static inline int rpc_proc_init(struct net *net)
  40. {
  41. return 0;
  42. }
  43. static inline void rpc_proc_exit(struct net *net)
  44. {
  45. }
  46. #endif
  47. #ifdef MODULE
  48. void rpc_modcount(struct inode *, int);
  49. #endif
  50. #ifdef CONFIG_PROC_FS
  51. struct proc_dir_entry * rpc_proc_register(struct net *,struct rpc_stat *);
  52. void rpc_proc_unregister(struct net *,const char *);
  53. void rpc_proc_zero(const struct rpc_program *);
  54. struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *,
  55. const struct file_operations *);
  56. void svc_proc_unregister(struct net *, const char *);
  57. void svc_seq_show(struct seq_file *,
  58. const struct svc_stat *);
  59. #else
  60. static inline struct proc_dir_entry *rpc_proc_register(struct net *net, struct rpc_stat *s) { return NULL; }
  61. static inline void rpc_proc_unregister(struct net *net, const char *p) {}
  62. static inline void rpc_proc_zero(const struct rpc_program *p) {}
  63. static inline struct proc_dir_entry *svc_proc_register(struct net *net, struct svc_stat *s,
  64. const struct file_operations *f) { return NULL; }
  65. static inline void svc_proc_unregister(struct net *net, const char *p) {}
  66. static inline void svc_seq_show(struct seq_file *seq,
  67. const struct svc_stat *st) {}
  68. #endif
  69. #endif /* _LINUX_SUNRPC_STATS_H */