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 (c) 2007, 2010, Oracle and/or its affiliates. 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 {
81 cfs_spinlock_t oh_lock;
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 {
142 cfs_atomic_t la_entry;
143 cfs_atomic_t la_exit;
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 cfs_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 cfs_spin_lock(&stats->ls_lock);
361 if (type & LPROCFS_GET_NUM_CPU)
362 rc = cfs_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 cfs_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 < cfs_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_mps_stats(int num_private_stats,
419 struct lprocfs_stats *stats);
420 extern void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats);
421 extern int lprocfs_alloc_obd_stats(struct obd_device *obddev,
422 unsigned int num_private_stats);
423 extern int lprocfs_alloc_md_stats(struct obd_device *obddev,
424 unsigned int num_private_stats);
425 extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
426 unsigned conf, const char *name,
428 extern void lprocfs_free_obd_stats(struct obd_device *obddev);
429 extern void lprocfs_free_md_stats(struct obd_device *obddev);
432 extern int lprocfs_add_clear_entry(struct obd_device * obd,
433 cfs_proc_dir_entry_t *entry);
434 extern int lprocfs_exp_setup(struct obd_export *exp,
435 lnet_nid_t *peer_nid, int reconnect, int *newnid);
436 extern int lprocfs_exp_cleanup(struct obd_export *exp);
437 extern cfs_proc_dir_entry_t *lprocfs_add_simple(struct proc_dir_entry *root,
439 cfs_read_proc_t *read_proc,
440 cfs_write_proc_t *write_proc,
442 struct file_operations *fops);
443 extern struct proc_dir_entry *lprocfs_add_symlink(const char *name,
444 struct proc_dir_entry *parent, const char *format, ...);
445 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
446 extern int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
447 unsigned long count, void *data);
448 extern int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
449 int count, int *eof, void *data);
451 extern int lprocfs_register_stats(cfs_proc_dir_entry_t *root, const char *name,
452 struct lprocfs_stats *stats);
454 /* lprocfs_status.c */
455 extern int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
456 struct lprocfs_vars *var,
459 extern cfs_proc_dir_entry_t *lprocfs_register(const char *name,
460 cfs_proc_dir_entry_t *parent,
461 struct lprocfs_vars *list,
464 extern void lprocfs_remove(cfs_proc_dir_entry_t **root);
465 extern void lprocfs_remove_proc_entry(const char *name,
466 struct proc_dir_entry *parent);
468 extern cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *root,
471 extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list);
472 extern int lprocfs_obd_cleanup(struct obd_device *obd);
473 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
474 extern struct file_operations lprocfs_evict_client_fops;
476 extern int lprocfs_seq_create(cfs_proc_dir_entry_t *parent, char *name,
477 mode_t mode, struct file_operations *seq_fops,
479 extern int lprocfs_obd_seq_create(struct obd_device *dev, char *name,
480 mode_t mode, struct file_operations *seq_fops,
483 /* Generic callbacks */
485 extern int lprocfs_rd_u64(char *page, char **start, off_t off,
486 int count, int *eof, void *data);
487 extern int lprocfs_rd_atomic(char *page, char **start, off_t off,
488 int count, int *eof, void *data);
489 extern int lprocfs_wr_atomic(struct file *file, const char *buffer,
490 unsigned long count, void *data);
491 extern int lprocfs_rd_uint(char *page, char **start, off_t off,
492 int count, int *eof, void *data);
493 extern int lprocfs_wr_uint(struct file *file, const char *buffer,
494 unsigned long count, void *data);
495 extern int lprocfs_rd_uuid(char *page, char **start, off_t off,
496 int count, int *eof, void *data);
497 extern int lprocfs_rd_name(char *page, char **start, off_t off,
498 int count, int *eof, void *data);
499 extern int lprocfs_rd_fstype(char *page, char **start, off_t off,
500 int count, int *eof, void *data);
501 extern int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
502 int count, int *eof, void *data);
503 extern int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
504 int count, int *eof, void *data);
505 extern int lprocfs_rd_import(char *page, char **start, off_t off, int count,
506 int *eof, void *data);
507 extern int lprocfs_rd_state(char *page, char **start, off_t off, int count,
508 int *eof, void *data);
509 extern int lprocfs_rd_connect_flags(char *page, char **start, off_t off,
510 int count, int *eof, void *data);
511 extern int lprocfs_rd_num_exports(char *page, char **start, off_t off,
512 int count, int *eof, void *data);
513 extern int lprocfs_rd_numrefs(char *page, char **start, off_t off,
514 int count, int *eof, void *data);
515 struct adaptive_timeout;
516 extern int lprocfs_at_hist_helper(char *page, int count, int rc,
517 struct adaptive_timeout *at);
518 extern int lprocfs_rd_timeouts(char *page, char **start, off_t off,
519 int count, int *eof, void *data);
520 extern int lprocfs_wr_timeouts(struct file *file, const char *buffer,
521 unsigned long count, void *data);
522 extern int lprocfs_wr_evict_client(struct file *file, const char *buffer,
523 unsigned long count, void *data);
524 extern int lprocfs_wr_ping(struct file *file, const char *buffer,
525 unsigned long count, void *data);
528 extern int lprocfs_rd_blksize(char *page, char **start, off_t off,
529 int count, int *eof, void *data);
530 extern int lprocfs_rd_kbytestotal(char *page, char **start, off_t off,
531 int count, int *eof, void *data);
532 extern int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
533 int count, int *eof, void *data);
534 extern int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
535 int count, int *eof, void *data);
536 extern int lprocfs_rd_filestotal(char *page, char **start, off_t off,
537 int count, int *eof, void *data);
538 extern int lprocfs_rd_filesfree(char *page, char **start, off_t off,
539 int count, int *eof, void *data);
540 extern int lprocfs_rd_filegroups(char *page, char **start, off_t off,
541 int count, int *eof, void *data);
543 extern int lprocfs_write_helper(const char *buffer, unsigned long count,
545 extern int lprocfs_write_frac_helper(const char *buffer, unsigned long count,
547 extern int lprocfs_read_frac_helper(char *buffer, unsigned long count,
549 extern int lprocfs_write_u64_helper(const char *buffer, unsigned long count,
551 extern int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count,
552 __u64 *val, int mult);
553 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value);
554 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value);
555 void lprocfs_oh_clear(struct obd_histogram *oh);
556 unsigned long lprocfs_oh_sum(struct obd_histogram *oh);
558 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
559 struct lprocfs_counter *cnt);
562 /* lprocfs_status.c: recovery status */
563 int lprocfs_obd_rd_recovery_status(char *page, char **start, off_t off,
564 int count, int *eof, void *data);
566 /* lprocfs_statuc.c: hash statistics */
567 int lprocfs_obd_rd_hash(char *page, char **start, off_t off,
568 int count, int *eof, void *data);
570 extern int lprocfs_seq_release(struct inode *, struct file *);
572 /* in lprocfs_stat.c, to protect the private data for proc entries */
573 extern cfs_rw_semaphore_t _lprocfs_lock;
574 #define LPROCFS_ENTRY() do { \
575 cfs_down_read(&_lprocfs_lock); \
577 #define LPROCFS_EXIT() do { \
578 cfs_up_read(&_lprocfs_lock); \
581 #ifdef HAVE_PROCFS_DELETED
583 int LPROCFS_ENTRY_AND_CHECK(struct proc_dir_entry *dp)
594 int LPROCFS_ENTRY_AND_CHECK(struct proc_dir_entry *dp)
601 #define LPROCFS_WRITE_ENTRY() do { \
602 cfs_down_write(&_lprocfs_lock); \
604 #define LPROCFS_WRITE_EXIT() do { \
605 cfs_up_write(&_lprocfs_lock); \
609 /* You must use these macros when you want to refer to
610 * the import in a client obd_device for a lprocfs entry */
611 #define LPROCFS_CLIMP_CHECK(obd) do { \
612 typecheck(struct obd_device *, obd); \
613 cfs_down_read(&(obd)->u.cli.cl_sem); \
614 if ((obd)->u.cli.cl_import == NULL) { \
615 cfs_up_read(&(obd)->u.cli.cl_sem); \
619 #define LPROCFS_CLIMP_EXIT(obd) \
620 cfs_up_read(&(obd)->u.cli.cl_sem);
623 /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only
624 proc entries; otherwise, you will define name##_seq_write function also for
625 a read-write proc entry, and then call LPROC_SEQ_SEQ instead. Finally,
626 call lprocfs_obd_seq_create(obd, filename, 0444, &name#_fops, data); */
627 #define __LPROC_SEQ_FOPS(name, custom_seq_write) \
628 static int name##_seq_open(struct inode *inode, struct file *file) { \
629 struct proc_dir_entry *dp = PDE(inode); \
631 LPROCFS_ENTRY_AND_CHECK(dp); \
632 rc = single_open(file, name##_seq_show, dp->data); \
639 struct file_operations name##_fops = { \
640 .owner = THIS_MODULE, \
641 .open = name##_seq_open, \
643 .write = custom_seq_write, \
644 .llseek = seq_lseek, \
645 .release = lprocfs_seq_release, \
648 #define LPROC_SEQ_FOPS_RO(name) __LPROC_SEQ_FOPS(name, NULL)
649 #define LPROC_SEQ_FOPS(name) __LPROC_SEQ_FOPS(name, name##_seq_write)
652 struct ptlrpc_request;
653 extern void target_print_req(void *seq_file, struct ptlrpc_request *req);
656 int lprocfs_obd_rd_recovery_time_soft(char *page, char **start, off_t off,
657 int count, int *eof, void *data);
658 int lprocfs_obd_wr_recovery_time_soft(struct file *file, const char *buffer,
659 unsigned long count, void *data);
660 int lprocfs_obd_rd_recovery_time_hard(char *page, char **start, off_t off,
661 int count, int *eof, void *data);
662 int lprocfs_obd_wr_recovery_time_hard(struct file *file, const char *buffer,
663 unsigned long count, void *data);
664 int lprocfs_obd_rd_mntdev(char *page, char **start, off_t off,
665 int count, int *eof, void *data);
666 /* all quota proc functions */
667 extern int lprocfs_quota_rd_bunit(char *page, char **start, off_t off, int count,
668 int *eof, void *data);
669 extern int lprocfs_quota_wr_bunit(struct file *file, const char *buffer,
670 unsigned long count, void *data);
671 extern int lprocfs_quota_rd_btune(char *page, char **start, off_t off, int count,
672 int *eof, void *data);
673 extern int lprocfs_quota_wr_btune(struct file *file, const char *buffer,
674 unsigned long count, void *data);
675 extern int lprocfs_quota_rd_iunit(char *page, char **start, off_t off, int count,
676 int *eof, void *data);
677 extern int lprocfs_quota_wr_iunit(struct file *file, const char *buffer,
678 unsigned long count, void *data);
679 extern int lprocfs_quota_rd_itune(char *page, char **start, off_t off, int count,
680 int *eof, void *data);
681 extern int lprocfs_quota_wr_itune(struct file *file, const char *buffer,
682 unsigned long count, void *data);
683 extern int lprocfs_quota_rd_type(char *page, char **start, off_t off, int count,
684 int *eof, void *data);
685 extern int lprocfs_quota_wr_type(struct file *file, const char *buffer,
686 unsigned long count, void *data);
687 extern int lprocfs_quota_rd_switch_seconds(char *page, char **start, off_t off,
688 int count, int *eof, void *data);
689 extern int lprocfs_quota_wr_switch_seconds(struct file *file, const char *buffer,
690 unsigned long count, void *data);
691 extern int lprocfs_quota_rd_sync_blk(char *page, char **start, off_t off,
692 int count, int *eof, void *data);
693 extern int lprocfs_quota_wr_sync_blk(struct file *file, const char *buffer,
694 unsigned long count, void *data);
695 extern int lprocfs_quota_rd_switch_qs(char *page, char **start, off_t off,
696 int count, int *eof, void *data);
697 extern int lprocfs_quota_wr_switch_qs(struct file *file, const char *buffer,
698 unsigned long count, void *data);
699 extern int lprocfs_quota_rd_boundary_factor(char *page, char **start, off_t off,
700 int count, int *eof, void *data);
701 extern int lprocfs_quota_wr_boundary_factor(struct file *file, const char *buffer,
702 unsigned long count, void *data);
703 extern int lprocfs_quota_rd_least_bunit(char *page, char **start, off_t off,
704 int count, int *eof, void *data);
705 extern int lprocfs_quota_wr_least_bunit(struct file *file, const char *buffer,
706 unsigned long count, void *data);
707 extern int lprocfs_quota_rd_least_iunit(char *page, char **start, off_t off,
708 int count, int *eof, void *data);
709 extern int lprocfs_quota_wr_least_iunit(struct file *file, const char *buffer,
710 unsigned long count, void *data);
711 extern int lprocfs_quota_rd_qs_factor(char *page, char **start, off_t off,
712 int count, int *eof, void *data);
713 extern int lprocfs_quota_wr_qs_factor(struct file *file, const char *buffer,
714 unsigned long count, void *data);
719 /* LPROCFS is not defined */
723 static inline void lprocfs_counter_add(struct lprocfs_stats *stats,
724 int index, long amount) { return; }
725 static inline void lprocfs_counter_incr(struct lprocfs_stats *stats,
726 int index) { return; }
727 static inline void lprocfs_counter_sub(struct lprocfs_stats *stats,
728 int index, long amount) { return; }
729 static inline void lprocfs_counter_init(struct lprocfs_stats *stats,
730 int index, unsigned conf,
731 const char *name, const char *units)
734 static inline __u64 lc_read_helper(struct lprocfs_counter *lc,
735 enum lprocfs_fields_flags field)
738 static inline struct lprocfs_stats* lprocfs_alloc_stats(unsigned int num,
739 enum lprocfs_stats_flags flags)
741 static inline void lprocfs_clear_stats(struct lprocfs_stats *stats)
743 static inline void lprocfs_free_stats(struct lprocfs_stats **stats)
745 static inline int lprocfs_register_stats(cfs_proc_dir_entry_t *root,
747 struct lprocfs_stats *stats)
749 static inline void lprocfs_init_ops_stats(int num_private_stats,
750 struct lprocfs_stats *stats)
752 static inline void lprocfs_init_mps_stats(int num_private_stats,
753 struct lprocfs_stats *stats)
755 static inline void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
757 static inline int lprocfs_alloc_obd_stats(struct obd_device *obddev,
758 unsigned int num_private_stats)
760 static inline int lprocfs_alloc_md_stats(struct obd_device *obddev,
761 unsigned int num_private_stats)
763 static inline void lprocfs_free_obd_stats(struct obd_device *obddev)
765 static inline void lprocfs_free_md_stats(struct obd_device *obddev)
769 static inline int lprocfs_add_clear_entry(struct obd_export *exp)
771 static inline int lprocfs_exp_setup(struct obd_export *exp,lnet_nid_t *peer_nid,
772 int reconnect, int *newnid)
774 static inline int lprocfs_exp_cleanup(struct obd_export *exp)
776 static inline cfs_proc_dir_entry_t *lprocfs_add_simple(struct proc_dir_entry *root,
778 cfs_read_proc_t *read_proc,
779 cfs_write_proc_t *write_proc,
781 struct file_operations *fops)
783 static inline struct proc_dir_entry *lprocfs_add_symlink(const char *name,
784 struct proc_dir_entry *parent, const char *format, ...)
786 static inline void lprocfs_free_per_client_stats(struct obd_device *obd)
789 int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
790 unsigned long count, void *data)
793 int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
794 int count, int *eof, void *data)
797 static inline cfs_proc_dir_entry_t *
798 lprocfs_register(const char *name, cfs_proc_dir_entry_t *parent,
799 struct lprocfs_vars *list, void *data) { return NULL; }
800 static inline int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
801 struct lprocfs_vars *var,
802 void *data) { return 0; }
803 static inline void lprocfs_remove(cfs_proc_dir_entry_t **root) {};
804 static inline void lprocfs_remove_proc_entry(const char *name,
805 struct proc_dir_entry *parent) {};
806 static inline cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *head,
807 const char *name) {return 0;}
808 static inline int lprocfs_obd_setup(struct obd_device *dev,
809 struct lprocfs_vars *list) { return 0; }
810 static inline int lprocfs_obd_cleanup(struct obd_device *dev) { return 0; }
811 static inline int lprocfs_rd_u64(char *page, char **start, off_t off,
812 int count, int *eof, void *data) { return 0; }
813 static inline int lprocfs_rd_uuid(char *page, char **start, off_t off,
814 int count, int *eof, void *data) { return 0; }
815 static inline int lprocfs_rd_name(char *page, char **start, off_t off,
816 int count, int *eof, void *data) { return 0; }
817 static inline int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
818 int count, int *eof, void *data)
820 static inline int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
821 int count, int *eof, void *data)
823 static inline int lprocfs_rd_import(char *page, char **start, off_t off,
824 int count, int *eof, void *data)
826 static inline int lprocfs_rd_state(char *page, char **start, off_t off,
827 int count, int *eof, void *data)
829 static inline int lprocfs_rd_connect_flags(char *page, char **start, off_t off,
830 int count, int *eof, void *data)
832 static inline int lprocfs_rd_num_exports(char *page, char **start, off_t off,
833 int count, int *eof, void *data)
835 static inline int lprocfs_rd_numrefs(char *page, char **start, off_t off,
836 int count, int *eof, void *data)
838 struct adaptive_timeout;
839 static inline int lprocfs_at_hist_helper(char *page, int count, int rc,
840 struct adaptive_timeout *at)
842 static inline int lprocfs_rd_timeouts(char *page, char **start, off_t off,
843 int count, int *eof, void *data)
845 static inline int lprocfs_wr_timeouts(struct file *file, const char *buffer,
846 unsigned long count, void *data)
848 static inline int lprocfs_wr_evict_client(struct file *file, const char *buffer,
849 unsigned long count, void *data)
851 static inline int lprocfs_wr_ping(struct file *file, const char *buffer,
852 unsigned long count, void *data)
858 int lprocfs_rd_blksize(char *page, char **start, off_t off,
859 int count, int *eof, void *data) { return 0; }
861 int lprocfs_rd_kbytestotal(char *page, char **start, off_t off,
862 int count, int *eof, void *data) { return 0; }
864 int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
865 int count, int *eof, void *data) { return 0; }
867 int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
868 int count, int *eof, void *data) { return 0; }
870 int lprocfs_rd_filestotal(char *page, char **start, off_t off,
871 int count, int *eof, void *data) { return 0; }
873 int lprocfs_rd_filesfree(char *page, char **start, off_t off,
874 int count, int *eof, void *data) { return 0; }
876 int lprocfs_rd_filegroups(char *page, char **start, off_t off,
877 int count, int *eof, void *data) { return 0; }
879 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value) {}
881 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value) {}
883 void lprocfs_oh_clear(struct obd_histogram *oh) {}
885 unsigned long lprocfs_oh_sum(struct obd_histogram *oh) { return 0; }
887 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
888 struct lprocfs_counter *cnt) {}
891 __u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
892 enum lprocfs_fields_flags field)
895 #define LPROCFS_ENTRY()
896 #define LPROCFS_EXIT()
897 #define LPROCFS_ENTRY_AND_CHECK(dp)
898 #define LPROC_SEQ_FOPS_RO(name)
899 #define LPROC_SEQ_FOPS(name)
902 #define target_print_req NULL
906 #endif /* LPROCFS_SNMP_H */