1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lustre/include/lprocfs_status.h
38 * Top level header file for LProc SNMP
40 * Author: Hariharan Thantry thantry@users.sourceforge.net
42 #ifndef _LPROCFS_SNMP_H
43 #define _LPROCFS_SNMP_H
45 #if defined(__linux__)
46 #include <linux/lprocfs_status.h>
47 #elif defined(__APPLE__)
48 #include <darwin/lprocfs_status.h>
49 #elif defined(__WINNT__)
50 #include <winnt/lprocfs_status.h>
52 #error Unsupported operating system.
54 #include <lustre/lustre_idl.h>
57 #if (defined(__KERNEL__) && defined(CONFIG_PROC_FS))
63 cfs_read_proc_t *read_fptr;
64 cfs_write_proc_t *write_fptr;
66 struct file_operations *fops;
73 struct lprocfs_static_vars {
74 struct lprocfs_vars *module_vars;
75 struct lprocfs_vars *obd_vars;
78 /* if we find more consumers this could be generalized */
79 #define OBD_HIST_MAX 32
80 struct obd_histogram {
82 unsigned long oh_buckets[OBD_HIST_MAX];
104 struct obd_histogram hist[BRW_LAST];
108 /* An lprocfs counter can be configured using the enum bit masks below.
110 * LPROCFS_CNTR_EXTERNALLOCK indicates that an external lock already
111 * protects this counter from concurrent updates. If not specified,
112 * lprocfs an internal per-counter lock variable. External locks are
113 * not used to protect counter increments, but are used to protect
114 * counter readout and resets.
116 * LPROCFS_CNTR_AVGMINMAX indicates a multi-valued counter samples,
117 * (i.e. counter can be incremented by more than "1"). When specified,
118 * the counter maintains min, max and sum in addition to a simple
119 * invocation count. This allows averages to be be computed.
120 * If not specified, the counter is an increment-by-1 counter.
121 * min, max, sum, etc. are not maintained.
123 * LPROCFS_CNTR_STDDEV indicates that the counter should track sum of
124 * squares (for multi-valued counter samples only). This allows
125 * external computation of standard deviation, but involves a 64-bit
126 * multiply per counter increment.
130 LPROCFS_CNTR_EXTERNALLOCK = 0x0001,
131 LPROCFS_CNTR_AVGMINMAX = 0x0002,
132 LPROCFS_CNTR_STDDEV = 0x0004,
134 /* counter data type */
135 LPROCFS_TYPE_REGS = 0x0100,
136 LPROCFS_TYPE_BYTES = 0x0200,
137 LPROCFS_TYPE_PAGES = 0x0400,
138 LPROCFS_TYPE_CYCLE = 0x0800,
141 struct lprocfs_atomic {
146 #define LC_MIN_INIT ((~(__u64)0) >> 1)
148 struct lprocfs_counter {
149 struct lprocfs_atomic lc_cntl; /* may need to move to per set */
150 unsigned int lc_config;
157 const char *lc_name; /* must be static */
158 const char *lc_units; /* must be static */
161 struct lprocfs_percpu {
162 struct lprocfs_counter lp_cntr[0];
165 #define LPROCFS_GET_NUM_CPU 0x0001
166 #define LPROCFS_GET_SMP_ID 0x0002
168 enum lprocfs_stats_flags {
169 LPROCFS_STATS_FLAG_NONE = 0x0000, /* per cpu counter */
170 LPROCFS_STATS_FLAG_NOPERCPU = 0x0001, /* stats have no percpu
171 * area and need locking */
172 LPROCFS_STATS_GET_SMP_ID = 0x0002, /* just record locking with
173 * LPROCFS_GET_SMP_ID flag */
176 enum lprocfs_fields_flags {
177 LPROCFS_FIELDS_FLAGS_CONFIG = 0x0001,
178 LPROCFS_FIELDS_FLAGS_SUM = 0x0002,
179 LPROCFS_FIELDS_FLAGS_MIN = 0x0003,
180 LPROCFS_FIELDS_FLAGS_MAX = 0x0004,
181 LPROCFS_FIELDS_FLAGS_AVG = 0x0005,
182 LPROCFS_FIELDS_FLAGS_SUMSQUARE = 0x0006,
183 LPROCFS_FIELDS_FLAGS_COUNT = 0x0007,
186 struct lprocfs_stats {
187 unsigned int ls_num; /* # of counters */
188 int ls_flags; /* See LPROCFS_STATS_FLAG_* */
189 spinlock_t ls_lock; /* Lock used only when there are
190 * no percpu stats areas */
191 struct lprocfs_percpu *ls_percpu[0];
194 #define OPC_RANGE(seg) (seg ## _LAST_OPC - seg ## _FIRST_OPC)
196 /* Pack all opcodes down into a single monotonically increasing index */
197 static inline int opcode_offset(__u32 opc) {
198 if (opc < OST_LAST_OPC) {
200 return (opc - OST_FIRST_OPC);
201 } else if (opc < MDS_LAST_OPC) {
203 return (opc - MDS_FIRST_OPC +
205 } else if (opc < LDLM_LAST_OPC) {
207 return (opc - LDLM_FIRST_OPC +
210 } else if (opc < MGS_LAST_OPC) {
212 return (opc - MGS_FIRST_OPC +
216 } else if (opc < OBD_LAST_OPC) {
218 return (opc - OBD_FIRST_OPC +
223 } else if (opc < LLOG_LAST_OPC) {
225 return (opc - LLOG_FIRST_OPC +
231 } else if (opc < QUOTA_LAST_OPC) {
233 return (opc - QUOTA_FIRST_OPC +
240 } else if (opc < SEQ_LAST_OPC) {
242 return (opc - SEQ_FIRST_OPC +
250 } else if (opc < SEC_LAST_OPC) {
252 return (opc - SEC_FIRST_OPC +
261 } else if (opc < FLD_LAST_OPC) {
263 return (opc - FLD_FIRST_OPC +
280 #define LUSTRE_MAX_OPCODES (OPC_RANGE(OST) + \
291 #define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR) + \
295 PTLRPC_REQWAIT_CNTR = 0,
296 PTLRPC_REQQDEPTH_CNTR,
297 PTLRPC_REQACTIVE_CNTR,
299 PTLRPC_REQBUF_AVAIL_CNTR,
303 #define PTLRPC_FIRST_CNTR PTLRPC_REQWAIT_CNTR
306 LDLM_GLIMPSE_ENQUEUE = 0,
323 #define EXTRA_FIRST_OPC LDLM_GLIMPSE_ENQUEUE
325 extern cfs_proc_dir_entry_t *proc_lustre_root;
329 struct obd_histogram;
331 /* Days / hours / mins / seconds format */
335 static inline void s2dhms(struct dhms *ts, time_t secs)
337 ts->d = secs / 86400;
344 #define DHMS_FMT "%dd%dh%02dm%02ds"
345 #define DHMS_VARS(x) (x)->d, (x)->h, (x)->m, (x)->s
350 static inline int lprocfs_stats_lock(struct lprocfs_stats *stats, int type)
354 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
355 if (type & LPROCFS_GET_NUM_CPU)
357 if (type & LPROCFS_GET_SMP_ID)
359 spin_lock(&stats->ls_lock);
361 if (type & LPROCFS_GET_NUM_CPU)
362 rc = num_possible_cpus();
363 if (type & LPROCFS_GET_SMP_ID) {
364 stats->ls_flags |= LPROCFS_STATS_GET_SMP_ID;
371 static inline void lprocfs_stats_unlock(struct lprocfs_stats *stats)
373 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU)
374 spin_unlock(&stats->ls_lock);
375 else if (stats->ls_flags & LPROCFS_STATS_GET_SMP_ID)
379 /* Two optimized LPROCFS counter increment functions are provided:
380 * lprocfs_counter_incr(cntr, value) - optimized for by-one counters
381 * lprocfs_counter_add(cntr) - use for multi-valued counters
382 * Counter data layout allows config flag, counter lock and the
383 * count itself to reside within a single cache line.
386 extern void lprocfs_counter_add(struct lprocfs_stats *stats, int idx,
388 extern void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx,
391 #define lprocfs_counter_incr(stats, idx) \
392 lprocfs_counter_add(stats, idx, 1)
393 #define lprocfs_counter_decr(stats, idx) \
394 lprocfs_counter_sub(stats, idx, 1)
396 extern __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
397 enum lprocfs_fields_flags field);
398 static inline __u64 lprocfs_stats_collector(struct lprocfs_stats *stats,
400 enum lprocfs_fields_flags field)
405 LASSERT(stats != NULL);
406 for (i = 0; i < num_possible_cpus(); i++)
407 ret += lprocfs_read_helper(&(stats->ls_percpu[i]->lp_cntr[idx]),
412 extern struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num,
413 enum lprocfs_stats_flags flags);
414 extern void lprocfs_clear_stats(struct lprocfs_stats *stats);
415 extern void lprocfs_free_stats(struct lprocfs_stats **stats);
416 extern void lprocfs_init_ops_stats(int num_private_stats,
417 struct lprocfs_stats *stats);
418 extern void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats);
419 extern int lprocfs_alloc_obd_stats(struct obd_device *obddev,
420 unsigned int num_private_stats);
421 extern int lprocfs_alloc_md_stats(struct obd_device *obddev,
422 unsigned int num_private_stats);
423 extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
424 unsigned conf, const char *name,
426 extern void lprocfs_free_obd_stats(struct obd_device *obddev);
429 extern int lprocfs_add_clear_entry(struct obd_device * obd,
430 cfs_proc_dir_entry_t *entry);
431 extern int lprocfs_exp_setup(struct obd_export *exp,
432 lnet_nid_t *peer_nid, int *newnid);
433 extern int lprocfs_exp_cleanup(struct obd_export *exp);
434 extern cfs_proc_dir_entry_t *lprocfs_add_simple(struct proc_dir_entry *root,
436 cfs_read_proc_t *read_proc,
437 cfs_write_proc_t *write_proc,
439 struct file_operations *fops);
440 extern struct proc_dir_entry *lprocfs_add_symlink(const char *name,
441 struct proc_dir_entry *parent, const char *dest);
442 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
443 extern int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
444 unsigned long count, void *data);
445 extern int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
446 int count, int *eof, void *data);
448 extern int lprocfs_register_stats(cfs_proc_dir_entry_t *root, const char *name,
449 struct lprocfs_stats *stats);
451 /* lprocfs_status.c */
452 extern int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
453 struct lprocfs_vars *var,
456 extern cfs_proc_dir_entry_t *lprocfs_register(const char *name,
457 cfs_proc_dir_entry_t *parent,
458 struct lprocfs_vars *list,
461 extern void lprocfs_remove(cfs_proc_dir_entry_t **root);
462 extern void lprocfs_remove_proc_entry(const char *name,
463 struct proc_dir_entry *parent);
465 extern cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *root,
468 extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list);
469 extern int lprocfs_obd_cleanup(struct obd_device *obd);
470 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
471 extern struct file_operations lprocfs_evict_client_fops;
473 extern int lprocfs_seq_create(cfs_proc_dir_entry_t *parent, char *name,
474 mode_t mode, struct file_operations *seq_fops,
476 extern int lprocfs_obd_seq_create(struct obd_device *dev, char *name,
477 mode_t mode, struct file_operations *seq_fops,
480 /* Generic callbacks */
482 extern int lprocfs_rd_u64(char *page, char **start, off_t off,
483 int count, int *eof, void *data);
484 extern int lprocfs_rd_atomic(char *page, char **start, off_t off,
485 int count, int *eof, void *data);
486 extern int lprocfs_wr_atomic(struct file *file, const char *buffer,
487 unsigned long count, void *data);
488 extern int lprocfs_rd_uint(char *page, char **start, off_t off,
489 int count, int *eof, void *data);
490 extern int lprocfs_wr_uint(struct file *file, const char *buffer,
491 unsigned long count, void *data);
492 extern int lprocfs_rd_uuid(char *page, char **start, off_t off,
493 int count, int *eof, void *data);
494 extern int lprocfs_rd_name(char *page, char **start, off_t off,
495 int count, int *eof, void *data);
496 extern int lprocfs_rd_fstype(char *page, char **start, off_t off,
497 int count, int *eof, void *data);
498 extern int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
499 int count, int *eof, void *data);
500 extern int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
501 int count, int *eof, void *data);
502 extern int lprocfs_rd_import(char *page, char **start, off_t off, int count,
503 int *eof, void *data);
504 extern int lprocfs_rd_state(char *page, char **start, off_t off, int count,
505 int *eof, void *data);
506 extern int lprocfs_rd_connect_flags(char *page, char **start, off_t off,
507 int count, int *eof, void *data);
508 extern int lprocfs_rd_num_exports(char *page, char **start, off_t off,
509 int count, int *eof, void *data);
510 extern int lprocfs_rd_numrefs(char *page, char **start, off_t off,
511 int count, int *eof, void *data);
512 struct adaptive_timeout;
513 extern int lprocfs_at_hist_helper(char *page, int count, int rc,
514 struct adaptive_timeout *at);
515 extern int lprocfs_rd_timeouts(char *page, char **start, off_t off,
516 int count, int *eof, void *data);
517 extern int lprocfs_wr_timeouts(struct file *file, const char *buffer,
518 unsigned long count, void *data);
519 extern int lprocfs_wr_evict_client(struct file *file, const char *buffer,
520 unsigned long count, void *data);
521 extern int lprocfs_wr_ping(struct file *file, const char *buffer,
522 unsigned long count, void *data);
524 extern int lprocfs_rd_quota_resend_count(char *page, char **start, off_t off,
525 int count, int *eof, void *data);
526 extern int lprocfs_wr_quota_resend_count(struct file *file, const char *buffer,
527 unsigned long count, void *data);
530 extern int lprocfs_rd_blksize(char *page, char **start, off_t off,
531 int count, int *eof, void *data);
532 extern int lprocfs_rd_kbytestotal(char *page, char **start, off_t off,
533 int count, int *eof, void *data);
534 extern int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
535 int count, int *eof, void *data);
536 extern int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
537 int count, int *eof, void *data);
538 extern int lprocfs_rd_filestotal(char *page, char **start, off_t off,
539 int count, int *eof, void *data);
540 extern int lprocfs_rd_filesfree(char *page, char **start, off_t off,
541 int count, int *eof, void *data);
542 extern int lprocfs_rd_filegroups(char *page, char **start, off_t off,
543 int count, int *eof, void *data);
545 extern int lprocfs_write_helper(const char *buffer, unsigned long count,
547 extern int lprocfs_write_frac_helper(const char *buffer, unsigned long count,
549 extern int lprocfs_read_frac_helper(char *buffer, unsigned long count,
551 extern int lprocfs_write_u64_helper(const char *buffer, unsigned long count,
553 extern int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count,
554 __u64 *val, int mult);
555 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value);
556 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value);
557 void lprocfs_oh_clear(struct obd_histogram *oh);
558 unsigned long lprocfs_oh_sum(struct obd_histogram *oh);
560 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
561 struct lprocfs_counter *cnt);
564 /* lprocfs_status.c: recovery status */
565 int lprocfs_obd_rd_recovery_status(char *page, char **start, off_t off,
566 int count, int *eof, void *data);
568 /* lprocfs_statuc.c: hash statistics */
569 int lprocfs_obd_rd_hash(char *page, char **start, off_t off,
570 int count, int *eof, void *data);
572 extern int lprocfs_seq_release(struct inode *, struct file *);
574 /* in lprocfs_stat.c, to protect the private data for proc entries */
575 extern struct rw_semaphore _lprocfs_lock;
576 #define LPROCFS_ENTRY() do { \
577 down_read(&_lprocfs_lock); \
579 #define LPROCFS_EXIT() do { \
580 up_read(&_lprocfs_lock); \
583 #ifdef HAVE_PROCFS_DELETED
585 int LPROCFS_ENTRY_AND_CHECK(struct proc_dir_entry *dp)
596 int LPROCFS_ENTRY_AND_CHECK(struct proc_dir_entry *dp)
603 #define LPROCFS_WRITE_ENTRY() do { \
604 down_write(&_lprocfs_lock); \
606 #define LPROCFS_WRITE_EXIT() do { \
607 up_write(&_lprocfs_lock); \
611 /* You must use these macros when you want to refer to
612 * the import in a client obd_device for a lprocfs entry */
613 #define LPROCFS_CLIMP_CHECK(obd) do { \
614 typecheck(struct obd_device *, obd); \
615 down_read(&(obd)->u.cli.cl_sem); \
616 if ((obd)->u.cli.cl_import == NULL) { \
617 up_read(&(obd)->u.cli.cl_sem); \
621 #define LPROCFS_CLIMP_EXIT(obd) \
622 up_read(&(obd)->u.cli.cl_sem);
625 /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only
626 proc entries; otherwise, you will define name##_seq_write function also for
627 a read-write proc entry, and then call LPROC_SEQ_SEQ instead. Finally,
628 call lprocfs_obd_seq_create(obd, filename, 0444, &name#_fops, data); */
629 #define __LPROC_SEQ_FOPS(name, custom_seq_write) \
630 static int name##_seq_open(struct inode *inode, struct file *file) { \
631 struct proc_dir_entry *dp = PDE(inode); \
633 LPROCFS_ENTRY_AND_CHECK(dp); \
634 rc = single_open(file, name##_seq_show, dp->data); \
641 struct file_operations name##_fops = { \
642 .owner = THIS_MODULE, \
643 .open = name##_seq_open, \
645 .write = custom_seq_write, \
646 .llseek = seq_lseek, \
647 .release = lprocfs_seq_release, \
650 #define LPROC_SEQ_FOPS_RO(name) __LPROC_SEQ_FOPS(name, NULL)
651 #define LPROC_SEQ_FOPS(name) __LPROC_SEQ_FOPS(name, name##_seq_write)
654 struct ptlrpc_request;
655 extern void target_print_req(void *seq_file, struct ptlrpc_request *req);
657 /* lprocfs_status.c: read recovery max time bz13079 */
658 int lprocfs_obd_rd_recovery_maxtime(char *page, char **start, off_t off,
659 int count, int *eof, void *data);
661 /* lprocfs_status.c: write recovery max time bz13079 */
662 int lprocfs_obd_wr_recovery_maxtime(struct file *file, const char *buffer,
663 unsigned long count, void *data);
665 /* all quota proc functions */
666 extern int lprocfs_quota_rd_bunit(char *page, char **start, off_t off, int count,
667 int *eof, void *data);
668 extern int lprocfs_quota_wr_bunit(struct file *file, const char *buffer,
669 unsigned long count, void *data);
670 extern int lprocfs_quota_rd_btune(char *page, char **start, off_t off, int count,
671 int *eof, void *data);
672 extern int lprocfs_quota_wr_btune(struct file *file, const char *buffer,
673 unsigned long count, void *data);
674 extern int lprocfs_quota_rd_iunit(char *page, char **start, off_t off, int count,
675 int *eof, void *data);
676 extern int lprocfs_quota_wr_iunit(struct file *file, const char *buffer,
677 unsigned long count, void *data);
678 extern int lprocfs_quota_rd_itune(char *page, char **start, off_t off, int count,
679 int *eof, void *data);
680 extern int lprocfs_quota_wr_itune(struct file *file, const char *buffer,
681 unsigned long count, void *data);
682 extern int lprocfs_quota_rd_type(char *page, char **start, off_t off, int count,
683 int *eof, void *data);
684 extern int lprocfs_quota_wr_type(struct file *file, const char *buffer,
685 unsigned long count, void *data);
686 extern int lprocfs_quota_rd_switch_seconds(char *page, char **start, off_t off,
687 int count, int *eof, void *data);
688 extern int lprocfs_quota_wr_switch_seconds(struct file *file, const char *buffer,
689 unsigned long count, void *data);
690 extern int lprocfs_quota_rd_sync_blk(char *page, char **start, off_t off,
691 int count, int *eof, void *data);
692 extern int lprocfs_quota_wr_sync_blk(struct file *file, const char *buffer,
693 unsigned long count, void *data);
694 extern int lprocfs_quota_rd_switch_qs(char *page, char **start, off_t off,
695 int count, int *eof, void *data);
696 extern int lprocfs_quota_wr_switch_qs(struct file *file, const char *buffer,
697 unsigned long count, void *data);
698 extern int lprocfs_quota_rd_boundary_factor(char *page, char **start, off_t off,
699 int count, int *eof, void *data);
700 extern int lprocfs_quota_wr_boundary_factor(struct file *file, const char *buffer,
701 unsigned long count, void *data);
702 extern int lprocfs_quota_rd_least_bunit(char *page, char **start, off_t off,
703 int count, int *eof, void *data);
704 extern int lprocfs_quota_wr_least_bunit(struct file *file, const char *buffer,
705 unsigned long count, void *data);
706 extern int lprocfs_quota_rd_least_iunit(char *page, char **start, off_t off,
707 int count, int *eof, void *data);
708 extern int lprocfs_quota_wr_least_iunit(struct file *file, const char *buffer,
709 unsigned long count, void *data);
710 extern int lprocfs_quota_rd_qs_factor(char *page, char **start, off_t off,
711 int count, int *eof, void *data);
712 extern int lprocfs_quota_wr_qs_factor(struct file *file, const char *buffer,
713 unsigned long count, void *data);
718 /* LPROCFS is not defined */
722 static inline void lprocfs_counter_add(struct lprocfs_stats *stats,
723 int index, long amount) { return; }
724 static inline void lprocfs_counter_incr(struct lprocfs_stats *stats,
725 int index) { return; }
726 static inline void lprocfs_counter_sub(struct lprocfs_stats *stats,
727 int index, long amount) { return; }
728 static inline void lprocfs_counter_init(struct lprocfs_stats *stats,
729 int index, unsigned conf,
730 const char *name, const char *units)
733 static inline __u64 lc_read_helper(struct lprocfs_counter *lc,
734 enum lprocfs_fields_flags field)
737 static inline struct lprocfs_stats* lprocfs_alloc_stats(unsigned int num,
738 enum lprocfs_stats_flags flags)
740 static inline void lprocfs_clear_stats(struct lprocfs_stats *stats)
742 static inline void lprocfs_free_stats(struct lprocfs_stats **stats)
744 static inline int lprocfs_register_stats(cfs_proc_dir_entry_t *root,
746 struct lprocfs_stats *stats)
748 static inline void lprocfs_init_ops_stats(int num_private_stats,
749 struct lprocfs_stats *stats)
751 static inline void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
753 static inline int lprocfs_alloc_obd_stats(struct obd_device *obddev,
754 unsigned int num_private_stats)
756 static inline int lprocfs_alloc_md_stats(struct obd_device *obddev,
757 unsigned int num_private_stats)
759 static inline void lprocfs_free_obd_stats(struct obd_device *obddev)
763 static inline int lprocfs_add_clear_entry(struct obd_export *exp)
765 static inline int lprocfs_exp_setup(struct obd_export *exp,
766 lnet_nid_t *peer_nid, int *newnid)
768 static inline int lprocfs_exp_cleanup(struct obd_export *exp)
770 static inline cfs_proc_dir_entry_t *lprocfs_add_simple(struct proc_dir_entry *root,
772 cfs_read_proc_t *read_proc,
773 cfs_write_proc_t *write_proc,
775 struct file_operations *fops)
777 static inline struct proc_dir_entry *lprocfs_add_symlink(const char *name,
778 struct proc_dir_entry *parent, const char *dest)
780 static inline void lprocfs_free_per_client_stats(struct obd_device *obd)
783 int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
784 unsigned long count, void *data)
787 int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
788 int count, int *eof, void *data)
791 static inline cfs_proc_dir_entry_t *
792 lprocfs_register(const char *name, cfs_proc_dir_entry_t *parent,
793 struct lprocfs_vars *list, void *data) { return NULL; }
794 static inline int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
795 struct lprocfs_vars *var,
796 void *data) { return 0; }
797 static inline void lprocfs_remove(cfs_proc_dir_entry_t **root) {};
798 static inline void lprocfs_remove_proc_entry(const char *name,
799 struct proc_dir_entry *parent) {};
800 static inline cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *head,
801 const char *name) {return 0;}
802 static inline int lprocfs_obd_setup(struct obd_device *dev,
803 struct lprocfs_vars *list) { return 0; }
804 static inline int lprocfs_obd_cleanup(struct obd_device *dev) { return 0; }
805 static inline int lprocfs_rd_u64(char *page, char **start, off_t off,
806 int count, int *eof, void *data) { return 0; }
807 static inline int lprocfs_rd_uuid(char *page, char **start, off_t off,
808 int count, int *eof, void *data) { return 0; }
809 static inline int lprocfs_rd_name(char *page, char **start, off_t off,
810 int count, int *eof, void *data) { return 0; }
811 static inline int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
812 int count, int *eof, void *data)
814 static inline int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
815 int count, int *eof, void *data)
817 static inline int lprocfs_rd_import(char *page, char **start, off_t off,
818 int count, int *eof, void *data)
820 static inline int lprocfs_rd_state(char *page, char **start, off_t off,
821 int count, int *eof, void *data)
823 static inline int lprocfs_rd_connect_flags(char *page, char **start, off_t off,
824 int count, int *eof, void *data)
826 static inline int lprocfs_rd_num_exports(char *page, char **start, off_t off,
827 int count, int *eof, void *data)
829 static inline int lprocfs_rd_numrefs(char *page, char **start, off_t off,
830 int count, int *eof, void *data)
832 struct adaptive_timeout;
833 static inline int lprocfs_at_hist_helper(char *page, int count, int rc,
834 struct adaptive_timeout *at)
836 static inline int lprocfs_rd_timeouts(char *page, char **start, off_t off,
837 int count, int *eof, void *data)
839 static inline int lprocfs_wr_timeouts(struct file *file, const char *buffer,
840 unsigned long count, void *data)
842 static inline int lprocfs_wr_evict_client(struct file *file, const char *buffer,
843 unsigned long count, void *data)
845 static inline int lprocfs_wr_ping(struct file *file, const char *buffer,
846 unsigned long count, void *data)
852 int lprocfs_rd_blksize(char *page, char **start, off_t off,
853 int count, int *eof, void *data) { return 0; }
855 int lprocfs_rd_kbytestotal(char *page, char **start, off_t off,
856 int count, int *eof, void *data) { return 0; }
858 int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
859 int count, int *eof, void *data) { return 0; }
861 int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
862 int count, int *eof, void *data) { return 0; }
864 int lprocfs_rd_filestotal(char *page, char **start, off_t off,
865 int count, int *eof, void *data) { return 0; }
867 int lprocfs_rd_filesfree(char *page, char **start, off_t off,
868 int count, int *eof, void *data) { return 0; }
870 int lprocfs_rd_filegroups(char *page, char **start, off_t off,
871 int count, int *eof, void *data) { return 0; }
873 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value) {}
875 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value) {}
877 void lprocfs_oh_clear(struct obd_histogram *oh) {}
879 unsigned long lprocfs_oh_sum(struct obd_histogram *oh) { return 0; }
881 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
882 struct lprocfs_counter *cnt) {}
885 __u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
886 enum lprocfs_fields_flags field)
889 #define LPROCFS_ENTRY()
890 #define LPROCFS_EXIT()
891 #define LPROCFS_ENTRY_AND_CHECK(dp)
892 #define LPROC_SEQ_FOPS_RO(name)
893 #define LPROC_SEQ_FOPS(name)
896 #define target_print_req NULL
900 #endif /* LPROCFS_SNMP_H */