Whamcloud - gitweb
LU-2459 osd: add LMA incompat flag check
[fs/lustre-release.git] / lustre / include / lprocfs_status.h
1 /*
2  * GPL HEADER START
3  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 only,
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License version 2 for more details (a copy is included
14  * in the LICENSE file that accompanied this code).
15  *
16  * You should have received a copy of the GNU General Public License
17  * version 2 along with this program; If not, see
18  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
19  *
20  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21  * CA 95054 USA or visit www.sun.com if you need additional information or
22  * have any questions.
23  *
24  * GPL HEADER END
25  */
26 /*
27  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28  * Use is subject to license terms.
29  *
30  * Copyright (c) 2011, 2012, Intel Corporation.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  *
36  * lustre/include/lprocfs_status.h
37  *
38  * Top level header file for LProc SNMP
39  *
40  * Author: Hariharan Thantry thantry@users.sourceforge.net
41  */
42 #ifndef _LPROCFS_SNMP_H
43 #define _LPROCFS_SNMP_H
44
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>
51 #else
52 #error Unsupported operating system.
53 #endif
54 #include <lustre/lustre_idl.h>
55 #include <libcfs/params_tree.h>
56
57 struct lprocfs_vars {
58         const char             *name;
59         cfs_read_proc_t        *read_fptr;
60         cfs_write_proc_t       *write_fptr;
61         void                   *data;
62         struct file_operations *fops;
63         /**
64          * /proc file mode.
65          */
66         mode_t                  proc_mode;
67 };
68
69 struct lprocfs_static_vars {
70         struct lprocfs_vars *module_vars;
71         struct lprocfs_vars *obd_vars;
72 };
73
74 /* if we find more consumers this could be generalized */
75 #define OBD_HIST_MAX 32
76 struct obd_histogram {
77         spinlock_t      oh_lock;
78         unsigned long   oh_buckets[OBD_HIST_MAX];
79 };
80
81 enum {
82         BRW_R_PAGES = 0,
83         BRW_W_PAGES,
84         BRW_R_RPC_HIST,
85         BRW_W_RPC_HIST,
86         BRW_R_IO_TIME,
87         BRW_W_IO_TIME,
88         BRW_R_DISCONT_PAGES,
89         BRW_W_DISCONT_PAGES,
90         BRW_R_DISCONT_BLOCKS,
91         BRW_W_DISCONT_BLOCKS,
92         BRW_R_DISK_IOSIZE,
93         BRW_W_DISK_IOSIZE,
94         BRW_R_DIO_FRAGS,
95         BRW_W_DIO_FRAGS,
96         BRW_LAST,
97 };
98
99 struct brw_stats {
100         struct obd_histogram hist[BRW_LAST];
101 };
102
103 enum {
104         RENAME_SAMEDIR_SIZE = 0,
105         RENAME_CROSSDIR_SRC_SIZE,
106         RENAME_CROSSDIR_TGT_SIZE,
107         RENAME_LAST,
108 };
109
110 struct rename_stats {
111         struct obd_histogram hist[RENAME_LAST];
112 };
113
114 /* An lprocfs counter can be configured using the enum bit masks below.
115  *
116  * LPROCFS_CNTR_EXTERNALLOCK indicates that an external lock already
117  * protects this counter from concurrent updates. If not specified,
118  * lprocfs an internal per-counter lock variable. External locks are
119  * not used to protect counter increments, but are used to protect
120  * counter readout and resets.
121  *
122  * LPROCFS_CNTR_AVGMINMAX indicates a multi-valued counter samples,
123  * (i.e. counter can be incremented by more than "1"). When specified,
124  * the counter maintains min, max and sum in addition to a simple
125  * invocation count. This allows averages to be be computed.
126  * If not specified, the counter is an increment-by-1 counter.
127  * min, max, sum, etc. are not maintained.
128  *
129  * LPROCFS_CNTR_STDDEV indicates that the counter should track sum of
130  * squares (for multi-valued counter samples only). This allows
131  * external computation of standard deviation, but involves a 64-bit
132  * multiply per counter increment.
133  */
134
135 enum {
136         LPROCFS_CNTR_EXTERNALLOCK = 0x0001,
137         LPROCFS_CNTR_AVGMINMAX    = 0x0002,
138         LPROCFS_CNTR_STDDEV       = 0x0004,
139
140         /* counter data type */
141         LPROCFS_TYPE_REGS         = 0x0100,
142         LPROCFS_TYPE_BYTES        = 0x0200,
143         LPROCFS_TYPE_PAGES        = 0x0400,
144         LPROCFS_TYPE_CYCLE        = 0x0800,
145 };
146
147 #define LC_MIN_INIT ((~(__u64)0) >> 1)
148
149 struct lprocfs_counter_header {
150         unsigned int            lc_config;
151         const char              *lc_name;   /* must be static */
152         const char              *lc_units;  /* must be static */
153 };
154
155 struct lprocfs_counter {
156         __s64   lc_count;
157         __s64   lc_min;
158         __s64   lc_max;
159         __s64   lc_sumsquare;
160         /*
161          * Every counter has lc_array_sum[0], while lc_array_sum[1] is only
162          * for irq context counter, i.e. stats with
163          * LPROCFS_STATS_FLAG_IRQ_SAFE flag, its counter need
164          * lc_array_sum[1]
165          */
166         __s64   lc_array_sum[1];
167 };
168 #define lc_sum          lc_array_sum[0]
169 #define lc_sum_irq      lc_array_sum[1]
170
171 struct lprocfs_percpu {
172 #ifndef __GNUC__
173         __s64                   pad;
174 #endif
175         struct lprocfs_counter lp_cntr[0];
176 };
177
178 #define LPROCFS_GET_NUM_CPU 0x0001
179 #define LPROCFS_GET_SMP_ID  0x0002
180
181 enum lprocfs_stats_flags {
182         LPROCFS_STATS_FLAG_NONE     = 0x0000, /* per cpu counter */
183         LPROCFS_STATS_FLAG_NOPERCPU = 0x0001, /* stats have no percpu
184                                                * area and need locking */
185         LPROCFS_STATS_FLAG_IRQ_SAFE = 0x0002, /* alloc need irq safe */
186 };
187
188 enum lprocfs_fields_flags {
189         LPROCFS_FIELDS_FLAGS_CONFIG     = 0x0001,
190         LPROCFS_FIELDS_FLAGS_SUM        = 0x0002,
191         LPROCFS_FIELDS_FLAGS_MIN        = 0x0003,
192         LPROCFS_FIELDS_FLAGS_MAX        = 0x0004,
193         LPROCFS_FIELDS_FLAGS_AVG        = 0x0005,
194         LPROCFS_FIELDS_FLAGS_SUMSQUARE  = 0x0006,
195         LPROCFS_FIELDS_FLAGS_COUNT      = 0x0007,
196 };
197
198 struct lprocfs_stats {
199         /* # of counters */
200         unsigned short                  ls_num;
201         /* 1 + the biggest cpu # whose ls_percpu slot has been allocated */
202         unsigned short                  ls_biggest_alloc_num;
203         enum lprocfs_stats_flags        ls_flags;
204         /* Lock used when there are no percpu stats areas; For percpu stats,
205          * it is used to protect ls_biggest_alloc_num change */
206         spinlock_t                      ls_lock;
207
208         /* has ls_num of counter headers */
209         struct lprocfs_counter_header   *ls_cnt_header;
210         struct lprocfs_percpu           *ls_percpu[0];
211 };
212
213 #define OPC_RANGE(seg) (seg ## _LAST_OPC - seg ## _FIRST_OPC)
214
215 /* Pack all opcodes down into a single monotonically increasing index */
216 static inline int opcode_offset(__u32 opc) {
217         if (opc < OST_LAST_OPC) {
218                  /* OST opcode */
219                 return (opc - OST_FIRST_OPC);
220         } else if (opc < MDS_LAST_OPC) {
221                 /* MDS opcode */
222                 return (opc - MDS_FIRST_OPC +
223                         OPC_RANGE(OST));
224         } else if (opc < LDLM_LAST_OPC) {
225                 /* LDLM Opcode */
226                 return (opc - LDLM_FIRST_OPC +
227                         OPC_RANGE(MDS) +
228                         OPC_RANGE(OST));
229         } else if (opc < MGS_LAST_OPC) {
230                 /* MGS Opcode */
231                 return (opc - MGS_FIRST_OPC +
232                         OPC_RANGE(LDLM) +
233                         OPC_RANGE(MDS) +
234                         OPC_RANGE(OST));
235         } else if (opc < OBD_LAST_OPC) {
236                 /* OBD Ping */
237                 return (opc - OBD_FIRST_OPC +
238                         OPC_RANGE(MGS) +
239                         OPC_RANGE(LDLM) +
240                         OPC_RANGE(MDS) +
241                         OPC_RANGE(OST));
242         } else if (opc < LLOG_LAST_OPC) {
243                 /* LLOG Opcode */
244                 return (opc - LLOG_FIRST_OPC +
245                         OPC_RANGE(OBD) +
246                         OPC_RANGE(MGS) +
247                         OPC_RANGE(LDLM) +
248                         OPC_RANGE(MDS) +
249                         OPC_RANGE(OST));
250         } else if (opc < QUOTA_LAST_OPC) {
251                 /* LQUOTA Opcode */
252                 return (opc - QUOTA_FIRST_OPC +
253                         OPC_RANGE(LLOG) +
254                         OPC_RANGE(OBD) +
255                         OPC_RANGE(MGS) +
256                         OPC_RANGE(LDLM) +
257                         OPC_RANGE(MDS) +
258                         OPC_RANGE(OST));
259         } else if (opc < SEQ_LAST_OPC) {
260                 /* SEQ opcode */
261                 return (opc - SEQ_FIRST_OPC +
262                         OPC_RANGE(QUOTA) +
263                         OPC_RANGE(LLOG) +
264                         OPC_RANGE(OBD) +
265                         OPC_RANGE(MGS) +
266                         OPC_RANGE(LDLM) +
267                         OPC_RANGE(MDS) +
268                         OPC_RANGE(OST));
269         } else if (opc < SEC_LAST_OPC) {
270                 /* SEC opcode */
271                 return (opc - SEC_FIRST_OPC +
272                         OPC_RANGE(SEQ) +
273                         OPC_RANGE(QUOTA) +
274                         OPC_RANGE(LLOG) +
275                         OPC_RANGE(OBD) +
276                         OPC_RANGE(MGS) +
277                         OPC_RANGE(LDLM) +
278                         OPC_RANGE(MDS) +
279                         OPC_RANGE(OST));
280         } else if (opc < FLD_LAST_OPC) {
281                 /* FLD opcode */
282                  return (opc - FLD_FIRST_OPC +
283                         OPC_RANGE(SEC) +
284                         OPC_RANGE(SEQ) +
285                         OPC_RANGE(QUOTA) +
286                         OPC_RANGE(LLOG) +
287                         OPC_RANGE(OBD) +
288                         OPC_RANGE(MGS) +
289                         OPC_RANGE(LDLM) +
290                         OPC_RANGE(MDS) +
291                         OPC_RANGE(OST));
292         } else if (opc < UPDATE_LAST_OPC) {
293                 /* update opcode */
294                 return (opc - UPDATE_FIRST_OPC +
295                         OPC_RANGE(FLD) +
296                         OPC_RANGE(SEC) +
297                         OPC_RANGE(SEQ) +
298                         OPC_RANGE(QUOTA) +
299                         OPC_RANGE(LLOG) +
300                         OPC_RANGE(OBD) +
301                         OPC_RANGE(MGS) +
302                         OPC_RANGE(LDLM) +
303                         OPC_RANGE(MDS) +
304                         OPC_RANGE(OST));
305         } else {
306                 /* Unknown Opcode */
307                 return -1;
308         }
309 }
310
311
312 #define LUSTRE_MAX_OPCODES (OPC_RANGE(OST)  + \
313                             OPC_RANGE(MDS)  + \
314                             OPC_RANGE(LDLM) + \
315                             OPC_RANGE(MGS)  + \
316                             OPC_RANGE(OBD)  + \
317                             OPC_RANGE(LLOG) + \
318                             OPC_RANGE(SEC)  + \
319                             OPC_RANGE(SEQ)  + \
320                             OPC_RANGE(SEC)  + \
321                             OPC_RANGE(FLD)  + \
322                             OPC_RANGE(UPDATE))
323
324 #define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR)  + \
325                             OPC_RANGE(EXTRA))
326
327 enum {
328         PTLRPC_REQWAIT_CNTR = 0,
329         PTLRPC_REQQDEPTH_CNTR,
330         PTLRPC_REQACTIVE_CNTR,
331         PTLRPC_TIMEOUT,
332         PTLRPC_REQBUF_AVAIL_CNTR,
333         PTLRPC_LAST_CNTR
334 };
335
336 #define PTLRPC_FIRST_CNTR PTLRPC_REQWAIT_CNTR
337
338 enum {
339         LDLM_GLIMPSE_ENQUEUE = 0,
340         LDLM_PLAIN_ENQUEUE,
341         LDLM_EXTENT_ENQUEUE,
342         LDLM_FLOCK_ENQUEUE,
343         LDLM_IBITS_ENQUEUE,
344         MDS_REINT_SETATTR,
345         MDS_REINT_CREATE,
346         MDS_REINT_LINK,
347         MDS_REINT_UNLINK,
348         MDS_REINT_RENAME,
349         MDS_REINT_OPEN,
350         MDS_REINT_SETXATTR,
351         BRW_READ_BYTES,
352         BRW_WRITE_BYTES,
353         EXTRA_LAST_OPC
354 };
355
356 #define EXTRA_FIRST_OPC LDLM_GLIMPSE_ENQUEUE
357 /* class_obd.c */
358 extern cfs_proc_dir_entry_t *proc_lustre_root;
359
360 struct obd_device;
361 struct obd_histogram;
362
363 /* Days / hours / mins / seconds format */
364 struct dhms {
365         int d,h,m,s;
366 };
367 static inline void s2dhms(struct dhms *ts, time_t secs)
368 {
369         ts->d = secs / 86400;
370         secs = secs % 86400;
371         ts->h = secs / 3600;
372         secs = secs % 3600;
373         ts->m = secs / 60;
374         ts->s = secs % 60;
375 }
376 #define DHMS_FMT "%dd%dh%02dm%02ds"
377 #define DHMS_VARS(x) (x)->d, (x)->h, (x)->m, (x)->s
378
379 #define JOBSTATS_JOBID_VAR_MAX_LEN      20
380 #define JOBSTATS_DISABLE                "disable"
381 #define JOBSTATS_PROCNAME_UID           "procname_uid"
382
383 typedef void (*cntr_init_callback)(struct lprocfs_stats *stats);
384
385 struct obd_job_stats {
386         cfs_hash_t        *ojs_hash;
387         cfs_list_t         ojs_list;
388         rwlock_t       ojs_lock; /* protect the obj_list */
389         cntr_init_callback ojs_cntr_init_fn;
390         int                ojs_cntr_num;
391         int                ojs_cleanup_interval;
392         time_t             ojs_last_cleanup;
393 };
394
395 #ifdef LPROCFS
396
397 extern int lprocfs_stats_alloc_one(struct lprocfs_stats *stats,
398                                    unsigned int cpuid);
399 /*
400  * \return value
401  *      < 0     : on error (only possible for opc as LPROCFS_GET_SMP_ID)
402  */
403 static inline int lprocfs_stats_lock(struct lprocfs_stats *stats, int opc,
404                                      unsigned long *flags)
405 {
406         int             rc = 0;
407
408         switch (opc) {
409         default:
410                 LBUG();
411
412         case LPROCFS_GET_SMP_ID:
413                 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
414                         if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE)
415                                 spin_lock_irqsave(&stats->ls_lock, *flags);
416                         else
417                                 spin_lock(&stats->ls_lock);
418                         return 0;
419                 } else {
420                         unsigned int cpuid = cfs_get_cpu();
421
422                         if (unlikely(stats->ls_percpu[cpuid] == NULL)) {
423                                 rc = lprocfs_stats_alloc_one(stats, cpuid);
424                                 if (rc < 0) {
425                                         cfs_put_cpu();
426                                         return rc;
427                                 }
428                         }
429                         return cpuid;
430                 }
431
432         case LPROCFS_GET_NUM_CPU:
433                 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
434                         if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE)
435                                 spin_lock_irqsave(&stats->ls_lock, *flags);
436                         else
437                                 spin_lock(&stats->ls_lock);
438                         return 1;
439                 } else {
440                         return stats->ls_biggest_alloc_num;
441                 }
442         }
443 }
444
445 static inline void lprocfs_stats_unlock(struct lprocfs_stats *stats, int opc,
446                                         unsigned long *flags)
447 {
448         switch (opc) {
449         default:
450                 LBUG();
451
452         case LPROCFS_GET_SMP_ID:
453                 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
454                         if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) {
455                                 spin_unlock_irqrestore(&stats->ls_lock,
456                                                            *flags);
457                         } else {
458                                 spin_unlock(&stats->ls_lock);
459                         }
460                 } else {
461                         cfs_put_cpu();
462                 }
463                 return;
464
465         case LPROCFS_GET_NUM_CPU:
466                 if (stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) {
467                         if (stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) {
468                                 spin_unlock_irqrestore(&stats->ls_lock,
469                                                            *flags);
470                         } else {
471                                 spin_unlock(&stats->ls_lock);
472                         }
473                 }
474                 return;
475         }
476 }
477
478 static inline unsigned int
479 lprocfs_stats_counter_size(struct lprocfs_stats *stats)
480 {
481         unsigned int percpusize;
482
483         percpusize = offsetof(struct lprocfs_percpu, lp_cntr[stats->ls_num]);
484
485         /* irq safe stats need lc_array_sum[1] */
486         if ((stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
487                 percpusize += stats->ls_num * sizeof(__s64);
488
489         if ((stats->ls_flags & LPROCFS_STATS_FLAG_NOPERCPU) == 0)
490                 percpusize = CFS_L1_CACHE_ALIGN(percpusize);
491
492         return percpusize;
493 }
494
495 static inline struct lprocfs_counter *
496 lprocfs_stats_counter_get(struct lprocfs_stats *stats, unsigned int cpuid,
497                           int index)
498 {
499         struct lprocfs_counter *cntr;
500
501         cntr = &stats->ls_percpu[cpuid]->lp_cntr[index];
502
503         if ((stats->ls_flags & LPROCFS_STATS_FLAG_IRQ_SAFE) != 0)
504                 cntr = (void *)cntr + index * sizeof(__s64);
505
506         return cntr;
507 }
508
509 /* Two optimized LPROCFS counter increment functions are provided:
510  *     lprocfs_counter_incr(cntr, value) - optimized for by-one counters
511  *     lprocfs_counter_add(cntr) - use for multi-valued counters
512  * Counter data layout allows config flag, counter lock and the
513  * count itself to reside within a single cache line.
514  */
515
516 extern void lprocfs_counter_add(struct lprocfs_stats *stats, int idx,
517                                 long amount);
518 extern void lprocfs_counter_sub(struct lprocfs_stats *stats, int idx,
519                                 long amount);
520
521 #define lprocfs_counter_incr(stats, idx) \
522         lprocfs_counter_add(stats, idx, 1)
523 #define lprocfs_counter_decr(stats, idx) \
524         lprocfs_counter_sub(stats, idx, 1)
525
526 extern __s64 lprocfs_read_helper(struct lprocfs_counter *lc,
527                                  struct lprocfs_counter_header *header,
528                                  enum lprocfs_stats_flags flags,
529                                  enum lprocfs_fields_flags field);
530 static inline __u64 lprocfs_stats_collector(struct lprocfs_stats *stats,
531                                             int idx,
532                                             enum lprocfs_fields_flags field)
533 {
534         int           i;
535         unsigned int  num_cpu;
536         unsigned long flags     = 0;
537         __u64         ret       = 0;
538
539         LASSERT(stats != NULL);
540
541         num_cpu = lprocfs_stats_lock(stats, LPROCFS_GET_NUM_CPU, &flags);
542         for (i = 0; i < num_cpu; i++) {
543                 if (stats->ls_percpu[i] == NULL)
544                         continue;
545                 ret += lprocfs_read_helper(
546                                 lprocfs_stats_counter_get(stats, i, idx),
547                                 &stats->ls_cnt_header[idx], stats->ls_flags,
548                                 field);
549         }
550         lprocfs_stats_unlock(stats, LPROCFS_GET_NUM_CPU, &flags);
551         return ret;
552 }
553
554 extern struct lprocfs_stats *
555 lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags);
556 extern void lprocfs_clear_stats(struct lprocfs_stats *stats);
557 extern void lprocfs_free_stats(struct lprocfs_stats **stats);
558 extern void lprocfs_init_ops_stats(int num_private_stats,
559                                    struct lprocfs_stats *stats);
560 extern void lprocfs_init_mps_stats(int num_private_stats,
561                                    struct lprocfs_stats *stats);
562 extern void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats);
563 extern int lprocfs_alloc_obd_stats(struct obd_device *obddev,
564                                    unsigned int num_private_stats);
565 extern int lprocfs_alloc_md_stats(struct obd_device *obddev,
566                                   unsigned int num_private_stats);
567 extern void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
568                                  unsigned conf, const char *name,
569                                  const char *units);
570 extern void lprocfs_free_obd_stats(struct obd_device *obddev);
571 extern void lprocfs_free_md_stats(struct obd_device *obddev);
572 struct obd_export;
573 struct nid_stat;
574 extern int lprocfs_add_clear_entry(struct obd_device * obd,
575                                    cfs_proc_dir_entry_t *entry);
576 extern int lprocfs_exp_setup(struct obd_export *exp,
577                              lnet_nid_t *peer_nid, int *newnid);
578 extern int lprocfs_exp_cleanup(struct obd_export *exp);
579 extern cfs_proc_dir_entry_t *lprocfs_add_simple(struct proc_dir_entry *root,
580                                                 char *name,
581                                                 cfs_read_proc_t *read_proc,
582                                                 cfs_write_proc_t *write_proc,
583                                                 void *data,
584                                                 struct file_operations *fops);
585 extern struct proc_dir_entry *
586 lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
587                     const char *format, ...);
588 extern void lprocfs_free_per_client_stats(struct obd_device *obd);
589 extern int
590 lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
591                               unsigned long count, void *data);
592 extern int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
593                                         int count, int *eof,  void *data);
594
595 extern int lprocfs_register_stats(cfs_proc_dir_entry_t *root, const char *name,
596                                   struct lprocfs_stats *stats);
597
598 /* lprocfs_status.c */
599 extern int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
600                             struct lprocfs_vars *var,
601                             void *data);
602
603 extern cfs_proc_dir_entry_t *lprocfs_register(const char *name,
604                                               cfs_proc_dir_entry_t *parent,
605                                               struct lprocfs_vars *list,
606                                               void *data);
607
608 extern void lprocfs_remove(cfs_proc_dir_entry_t **root);
609 extern void lprocfs_remove_proc_entry(const char *name,
610                                       struct proc_dir_entry *parent);
611 extern void lprocfs_try_remove_proc_entry(const char *name,
612                                           struct proc_dir_entry *parent);
613
614 extern cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *root,
615                                           const char *name);
616
617 extern int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list);
618 extern int lprocfs_obd_cleanup(struct obd_device *obd);
619 extern struct file_operations lprocfs_evict_client_fops;
620
621 extern int lprocfs_seq_create(cfs_proc_dir_entry_t *parent, const char *name,
622                               mode_t mode,
623                               const struct file_operations *seq_fops,
624                               void *data);
625 extern int lprocfs_obd_seq_create(struct obd_device *dev, const char *name,
626                                   mode_t mode,
627                                   const struct file_operations *seq_fops,
628                                   void *data);
629
630 /* Generic callbacks */
631
632 extern int lprocfs_rd_u64(char *page, char **start, off_t off,
633                           int count, int *eof, void *data);
634 extern int lprocfs_rd_atomic(char *page, char **start, off_t off,
635                              int count, int *eof, void *data);
636 extern int lprocfs_wr_atomic(struct file *file, const char *buffer,
637                              unsigned long count, void *data);
638 extern int lprocfs_rd_uint(char *page, char **start, off_t off,
639                            int count, int *eof, void *data);
640 extern int lprocfs_wr_uint(struct file *file, const char *buffer,
641                            unsigned long count, void *data);
642 extern int lprocfs_rd_uuid(char *page, char **start, off_t off,
643                            int count, int *eof, void *data);
644 extern int lprocfs_rd_name(char *page, char **start, off_t off,
645                            int count, int *eof, void *data);
646 extern int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
647                                   int count, int *eof, void *data);
648 extern int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
649                                 int count, int *eof, void *data);
650 extern int lprocfs_rd_import(char *page, char **start, off_t off, int count,
651                              int *eof, void *data);
652 extern int lprocfs_rd_state(char *page, char **start, off_t off, int count,
653                             int *eof, void *data);
654 extern int lprocfs_rd_connect_flags(char *page, char **start, off_t off,
655                                     int count, int *eof, void *data);
656 extern int lprocfs_rd_num_exports(char *page, char **start, off_t off,
657                                   int count, int *eof, void *data);
658 extern int lprocfs_rd_numrefs(char *page, char **start, off_t off,
659                               int count, int *eof, void *data);
660 struct adaptive_timeout;
661 extern int lprocfs_at_hist_helper(char *page, int count, int rc,
662                                   struct adaptive_timeout *at);
663 extern int lprocfs_rd_timeouts(char *page, char **start, off_t off,
664                                int count, int *eof, void *data);
665 extern int lprocfs_wr_timeouts(struct file *file, const char *buffer,
666                                unsigned long count, void *data);
667 extern int lprocfs_wr_evict_client(struct file *file, const char *buffer,
668                                    unsigned long count, void *data);
669 extern int lprocfs_wr_ping(struct file *file, const char *buffer,
670                            unsigned long count, void *data);
671 extern int lprocfs_wr_import(struct file *file, const char *buffer,
672                              unsigned long count, void *data);
673 extern int lprocfs_rd_pinger_recov(char *page, char **start, off_t off,
674                                    int count, int *eof, void *data);
675 extern int lprocfs_wr_pinger_recov(struct file *file, const char *buffer,
676                                    unsigned long count, void *data);
677
678 /* Statfs helpers */
679 extern int lprocfs_rd_blksize(char *page, char **start, off_t off,
680                               int count, int *eof, void *data);
681 extern int lprocfs_rd_kbytestotal(char *page, char **start, off_t off,
682                                   int count, int *eof, void *data);
683 extern int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
684                                  int count, int *eof, void *data);
685 extern int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
686                                  int count, int *eof, void *data);
687 extern int lprocfs_rd_filestotal(char *page, char **start, off_t off,
688                                  int count, int *eof, void *data);
689 extern int lprocfs_rd_filesfree(char *page, char **start, off_t off,
690                                 int count, int *eof, void *data);
691 extern int lprocfs_rd_filegroups(char *page, char **start, off_t off,
692                                  int count, int *eof, void *data);
693 extern int lprocfs_osd_rd_blksize(char *page, char **start, off_t off,
694                                 int count, int *eof, void *data);
695 extern int lprocfs_osd_rd_kbytesfree(char *page, char **start, off_t off,
696                                 int count, int *eof, void *data);
697 extern int lprocfs_osd_rd_kbytesavail(char *page, char **start, off_t off,
698                                 int count, int *eof, void *data);
699 extern int lprocfs_osd_rd_filestotal(char *page, char **start, off_t off,
700                                 int count, int *eof, void *data);
701 extern int lprocfs_osd_rd_filesfree(char *page, char **start, off_t off,
702                                 int count, int *eof, void *data);
703 extern int lprocfs_osd_rd_kbytestotal(char *page, char **start, off_t off,
704                                 int count, int *eof, void *data);
705
706
707 extern int lprocfs_write_helper(const char *buffer, unsigned long count,
708                                 int *val);
709 extern int lprocfs_write_frac_helper(const char *buffer, unsigned long count,
710                                      int *val, int mult);
711 extern int lprocfs_read_frac_helper(char *buffer, unsigned long count,
712                                     long val, int mult);
713 extern int lprocfs_write_u64_helper(const char *buffer, unsigned long count,
714                                     __u64 *val);
715 extern int lprocfs_write_frac_u64_helper(const char *buffer,
716                                          unsigned long count,
717                                          __u64 *val, int mult);
718 char *lprocfs_find_named_value(const char *buffer, const char *name,
719                                 unsigned long *count);
720 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value);
721 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value);
722 void lprocfs_oh_clear(struct obd_histogram *oh);
723 unsigned long lprocfs_oh_sum(struct obd_histogram *oh);
724
725 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
726                            struct lprocfs_counter *cnt);
727
728 /* lprocfs_status.c: recovery status */
729 int lprocfs_obd_rd_recovery_status(char *page, char **start, off_t off,
730                                    int count, int *eof, void *data);
731
732 /* lprocfs_statuc.c: hash statistics */
733 int lprocfs_obd_rd_hash(char *page, char **start, off_t off,
734                         int count, int *eof, void *data);
735
736 /* lprocfs_status.c: IR factor */
737 int lprocfs_obd_rd_ir_factor(char *page, char **start, off_t off,
738                              int count, int *eof, void *data);
739 int lprocfs_obd_wr_ir_factor(struct file *file, const char *buffer,
740                              unsigned long count, void *data);
741
742 extern int lprocfs_single_release(cfs_inode_t *, struct file *);
743 extern int lprocfs_seq_release(cfs_inode_t *, struct file *);
744
745 /* You must use these macros when you want to refer to
746  * the import in a client obd_device for a lprocfs entry */
747 #define LPROCFS_CLIMP_CHECK(obd) do {           \
748         typecheck(struct obd_device *, obd);    \
749         down_read(&(obd)->u.cli.cl_sem);    \
750         if ((obd)->u.cli.cl_import == NULL) {   \
751              up_read(&(obd)->u.cli.cl_sem); \
752              return -ENODEV;                    \
753         }                                       \
754 } while(0)
755 #define LPROCFS_CLIMP_EXIT(obd)                 \
756         up_read(&(obd)->u.cli.cl_sem);
757
758
759 /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only
760   proc entries; otherwise, you will define name##_seq_write function also for
761   a read-write proc entry, and then call LPROC_SEQ_SEQ instead. Finally,
762   call lprocfs_obd_seq_create(obd, filename, 0444, &name#_fops, data); */
763 #define __LPROC_SEQ_FOPS(name, custom_seq_write)                           \
764 static int name##_single_open(cfs_inode_t *inode, struct file *file) {     \
765         struct proc_dir_entry *dp = PDE(inode);                            \
766         int rc;                                                            \
767         LPROCFS_ENTRY_AND_CHECK(dp);                                       \
768         rc = single_open(file, name##_seq_show, dp->data);                 \
769         if (rc) {                                                          \
770                 LPROCFS_EXIT();                                            \
771                 return rc;                                                 \
772         }                                                                  \
773         return 0;                                                          \
774 }                                                                          \
775 struct file_operations name##_fops = {                                     \
776         .owner   = THIS_MODULE,                                            \
777         .open    = name##_single_open,                                     \
778         .read    = seq_read,                                               \
779         .write   = custom_seq_write,                                       \
780         .llseek  = seq_lseek,                                              \
781         .release = lprocfs_single_release,                                 \
782 }
783
784 #define LPROC_SEQ_FOPS_RO(name)         __LPROC_SEQ_FOPS(name, NULL)
785 #define LPROC_SEQ_FOPS(name)            __LPROC_SEQ_FOPS(name, name##_seq_write)
786
787 /* lprocfs_jobstats.c */
788 int lprocfs_job_stats_log(struct obd_device *obd, char *jobid,
789                           int event, long amount);
790 void lprocfs_job_stats_fini(struct obd_device *obd);
791 int lprocfs_job_stats_init(struct obd_device *obd, int cntr_num,
792                            cntr_init_callback fn);
793 int lprocfs_rd_job_interval(char *page, char **start, off_t off,
794                             int count, int *eof, void *data);
795 int lprocfs_wr_job_interval(struct file *file, const char *buffer,
796                             unsigned long count, void *data);
797
798 /* lproc_ptlrpc.c */
799 struct ptlrpc_request;
800 extern void target_print_req(void *seq_file, struct ptlrpc_request *req);
801
802 /* lproc_status.c */
803 int lprocfs_obd_rd_recovery_time_soft(char *page, char **start, off_t off,
804                                       int count, int *eof, void *data);
805 int lprocfs_obd_wr_recovery_time_soft(struct file *file,
806                                       const char *buffer,
807                                       unsigned long count, void *data);
808 int lprocfs_obd_rd_recovery_time_hard(char *page, char **start, off_t off,
809                                       int count, int *eof, void *data);
810 int lprocfs_obd_wr_recovery_time_hard(struct file *file,
811                                       const char *buffer,
812                                       unsigned long count, void *data);
813 int lprocfs_obd_rd_mntdev(char *page, char **start, off_t off,
814                           int count, int *eof, void *data);
815 int lprocfs_obd_rd_max_pages_per_rpc(char *page, char **start, off_t off,
816                                      int count, int *eof, void *data);
817 int lprocfs_obd_wr_max_pages_per_rpc(struct file *file, const char *buffer,
818                                      unsigned long count, void *data);
819 int lprocfs_target_rd_instance(char *page, char **start, off_t off,
820                                int count, int *eof, void *data);
821
822 /* all quota proc functions */
823 extern int lprocfs_quota_rd_bunit(char *page, char **start,
824                                   off_t off, int count,
825                                   int *eof, void *data);
826 extern int lprocfs_quota_wr_bunit(struct file *file, const char *buffer,
827                                   unsigned long count, void *data);
828 extern int lprocfs_quota_rd_btune(char *page, char **start,
829                                   off_t off, int count,
830                                   int *eof, void *data);
831 extern int lprocfs_quota_wr_btune(struct file *file, const char *buffer,
832                                   unsigned long count, void *data);
833 extern int lprocfs_quota_rd_iunit(char *page, char **start,
834                                   off_t off, int count,
835                                   int *eof, void *data);
836 extern int lprocfs_quota_wr_iunit(struct file *file, const char *buffer,
837                                   unsigned long count, void *data);
838 extern int lprocfs_quota_rd_itune(char *page, char **start,
839                                   off_t off, int count,
840                                   int *eof, void *data);
841 extern int lprocfs_quota_wr_itune(struct file *file, const char *buffer,
842                                   unsigned long count, void *data);
843 extern int lprocfs_quota_rd_type(char *page, char **start, off_t off, int count,
844                                  int *eof, void *data);
845 extern int lprocfs_quota_wr_type(struct file *file, const char *buffer,
846                                  unsigned long count, void *data);
847 extern int lprocfs_quota_rd_switch_seconds(char *page, char **start, off_t off,
848                                            int count, int *eof, void *data);
849 extern int lprocfs_quota_wr_switch_seconds(struct file *file,
850                                            const char *buffer,
851                                            unsigned long count, void *data);
852 extern int lprocfs_quota_rd_sync_blk(char *page, char **start, off_t off,
853                                      int count, int *eof, void *data);
854 extern int lprocfs_quota_wr_sync_blk(struct file *file, const char *buffer,
855                                      unsigned long count, void *data);
856 extern int lprocfs_quota_rd_switch_qs(char *page, char **start, off_t off,
857                                       int count, int *eof, void *data);
858 extern int lprocfs_quota_wr_switch_qs(struct file *file,
859                                       const char *buffer,
860                                       unsigned long count, void *data);
861 extern int lprocfs_quota_rd_boundary_factor(char *page, char **start, off_t off,
862                                             int count, int *eof, void *data);
863 extern int lprocfs_quota_wr_boundary_factor(struct file *file,
864                                             const char *buffer,
865                                             unsigned long count, void *data);
866 extern int lprocfs_quota_rd_least_bunit(char *page, char **start, off_t off,
867                                         int count, int *eof, void *data);
868 extern int lprocfs_quota_wr_least_bunit(struct file *file,
869                                         const char *buffer,
870                                         unsigned long count, void *data);
871 extern int lprocfs_quota_rd_least_iunit(char *page, char **start, off_t off,
872                                         int count, int *eof, void *data);
873 extern int lprocfs_quota_wr_least_iunit(struct file *file,
874                                         const char *buffer,
875                                         unsigned long count, void *data);
876 extern int lprocfs_quota_rd_qs_factor(char *page, char **start, off_t off,
877                                       int count, int *eof, void *data);
878 extern int lprocfs_quota_wr_qs_factor(struct file *file,
879                                       const char *buffer,
880                                       unsigned long count, void *data);
881
882
883
884 #else
885 /* LPROCFS is not defined */
886
887 #define proc_lustre_root NULL
888
889 static inline void lprocfs_counter_add(struct lprocfs_stats *stats,
890                                        int index, long amount)
891 { return; }
892 static inline void lprocfs_counter_incr(struct lprocfs_stats *stats,
893                                         int index)
894 { return; }
895 static inline void lprocfs_counter_sub(struct lprocfs_stats *stats,
896                                        int index, long amount)
897 { return; }
898 static inline void lprocfs_counter_decr(struct lprocfs_stats *stats,
899                                         int index)
900 { return; }
901 static inline void lprocfs_counter_init(struct lprocfs_stats *stats,
902                                         int index, unsigned conf,
903                                         const char *name, const char *units)
904 { return; }
905
906 static inline __u64 lc_read_helper(struct lprocfs_counter *lc,
907                                    enum lprocfs_fields_flags field)
908 { return 0; }
909
910 /* NB: we return !NULL to satisfy error checker */
911 static inline struct lprocfs_stats *
912 lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags)
913 { return (struct lprocfs_stats *)1; }
914 static inline void lprocfs_clear_stats(struct lprocfs_stats *stats)
915 { return; }
916 static inline void lprocfs_free_stats(struct lprocfs_stats **stats)
917 { return; }
918 static inline int lprocfs_register_stats(cfs_proc_dir_entry_t *root,
919                                          const char *name,
920                                          struct lprocfs_stats *stats)
921 { return 0; }
922 static inline void lprocfs_init_ops_stats(int num_private_stats,
923                                           struct lprocfs_stats *stats)
924 { return; }
925 static inline void lprocfs_init_mps_stats(int num_private_stats,
926                                           struct lprocfs_stats *stats)
927 { return; }
928 static inline void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
929 { return; }
930 static inline int lprocfs_alloc_obd_stats(struct obd_device *obddev,
931                                           unsigned int num_private_stats)
932 { return 0; }
933 static inline int lprocfs_alloc_md_stats(struct obd_device *obddev,
934                                          unsigned int num_private_stats)
935 { return 0; }
936 static inline void lprocfs_free_obd_stats(struct obd_device *obddev)
937 { return; }
938 static inline void lprocfs_free_md_stats(struct obd_device *obddev)
939 { return; }
940
941 struct obd_export;
942 static inline int lprocfs_add_clear_entry(struct obd_export *exp)
943 { return 0; }
944 static inline int lprocfs_exp_setup(struct obd_export *exp,lnet_nid_t *peer_nid,
945                                     int *newnid)
946 { return 0; }
947 static inline int lprocfs_exp_cleanup(struct obd_export *exp)
948 { return 0; }
949 static inline cfs_proc_dir_entry_t *
950 lprocfs_add_simple(struct proc_dir_entry *root, char *name,
951                    cfs_read_proc_t *read_proc, cfs_write_proc_t *write_proc,
952                    void *data, struct file_operations *fops)
953 {return 0; }
954 static inline struct proc_dir_entry *
955 lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
956                     const char *format, ...)
957 {return NULL; }
958 static inline void lprocfs_free_per_client_stats(struct obd_device *obd)
959 { return; }
960 static inline
961 int lprocfs_nid_stats_clear_write(struct file *file, const char *buffer,
962                                   unsigned long count, void *data)
963 {return count;}
964 static inline
965 int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
966                                  int count, int *eof,  void *data)
967 {return count;}
968
969 static inline cfs_proc_dir_entry_t *
970 lprocfs_register(const char *name, cfs_proc_dir_entry_t *parent,
971                  struct lprocfs_vars *list, void *data)
972 { return NULL; }
973 static inline int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
974                                    struct lprocfs_vars *var,
975                                    void *data)
976 { return 0; }
977 static inline void lprocfs_remove(cfs_proc_dir_entry_t **root)
978 { return; }
979 static inline void lprocfs_remove_proc_entry(const char *name,
980                                              struct proc_dir_entry *parent)
981 { return; }
982 static inline void lprocfs_try_remove_proc_entry(const char *name,
983                                                  struct proc_dir_entry *parent)
984 { return; }
985 static inline cfs_proc_dir_entry_t *lprocfs_srch(cfs_proc_dir_entry_t *head,
986                                                  const char *name)
987 { return 0; }
988 static inline int lprocfs_obd_setup(struct obd_device *dev,
989                                     struct lprocfs_vars *list)
990 { return 0; }
991 static inline int lprocfs_obd_cleanup(struct obd_device *dev)
992 { return 0; }
993 static inline int lprocfs_rd_u64(char *page, char **start, off_t off,
994                                  int count, int *eof, void *data)
995 { return 0; }
996 static inline int lprocfs_rd_uuid(char *page, char **start, off_t off,
997                                   int count, int *eof, void *data)
998 { return 0; }
999 static inline int lprocfs_rd_name(char *page, char **start, off_t off,
1000                                   int count, int *eof, void *data)
1001 { return 0; }
1002 static inline int lprocfs_rd_server_uuid(char *page, char **start, off_t off,
1003                                          int count, int *eof, void *data)
1004 { return 0; }
1005 static inline int lprocfs_rd_conn_uuid(char *page, char **start, off_t off,
1006                                        int count, int *eof, void *data)
1007 { return 0; }
1008 static inline int lprocfs_rd_import(char *page, char **start, off_t off,
1009                                     int count, int *eof, void *data)
1010 { return 0; }
1011 static inline int lprocfs_rd_pinger_recov(char *page, char **start, off_t off,
1012                                           int count, int *eof, void *data)
1013 { return 0; }
1014 static inline int lprocfs_rd_state(char *page, char **start, off_t off,
1015                                    int count, int *eof, void *data)
1016 { return 0; }
1017 static inline int lprocfs_rd_connect_flags(char *page, char **start, off_t off,
1018                                            int count, int *eof, void *data)
1019 { return 0; }
1020 static inline int lprocfs_rd_num_exports(char *page, char **start, off_t off,
1021                                          int count, int *eof, void *data)
1022 { return 0; }
1023 static inline int lprocfs_rd_numrefs(char *page, char **start, off_t off,
1024                                      int count, int *eof, void *data)
1025 { return 0; }
1026 struct adaptive_timeout;
1027 static inline int lprocfs_at_hist_helper(char *page, int count, int rc,
1028                                          struct adaptive_timeout *at)
1029 { return 0; }
1030 static inline int lprocfs_rd_timeouts(char *page, char **start, off_t off,
1031                                       int count, int *eof, void *data)
1032 { return 0; }
1033 static inline int lprocfs_wr_timeouts(struct file *file,
1034                                       const char *buffer,
1035                                       unsigned long count, void *data)
1036 { return 0; }
1037 static inline int lprocfs_wr_evict_client(struct file *file,
1038                                           const char *buffer,
1039                                           unsigned long count, void *data)
1040 { return 0; }
1041 static inline int lprocfs_wr_ping(struct file *file, const char *buffer,
1042                                   unsigned long count, void *data)
1043 { return 0; }
1044 static inline int lprocfs_wr_import(struct file *file, const char *buffer,
1045                                     unsigned long count, void *data)
1046 { return 0; }
1047 static inline int lprocfs_wr_pinger_recov(struct file *file, const char *buffer,
1048                                     unsigned long count, void *data)
1049 { return 0; }
1050
1051 /* Statfs helpers */
1052 static inline
1053 int lprocfs_rd_blksize(char *page, char **start, off_t off,
1054                        int count, int *eof, void *data)
1055 { return 0; }
1056 static inline
1057 int lprocfs_rd_kbytestotal(char *page, char **start, off_t off,
1058                            int count, int *eof, void *data)
1059 { return 0; }
1060 static inline
1061 int lprocfs_rd_kbytesfree(char *page, char **start, off_t off,
1062                           int count, int *eof, void *data)
1063 { return 0; }
1064 static inline
1065 int lprocfs_rd_kbytesavail(char *page, char **start, off_t off,
1066                            int count, int *eof, void *data)
1067 { return 0; }
1068 static inline
1069 int lprocfs_rd_filestotal(char *page, char **start, off_t off,
1070                           int count, int *eof, void *data)
1071 { return 0; }
1072 static inline
1073 int lprocfs_rd_filesfree(char *page, char **start, off_t off,
1074                          int count, int *eof, void *data)
1075 { return 0; }
1076 static inline
1077 int lprocfs_rd_filegroups(char *page, char **start, off_t off,
1078                           int count, int *eof, void *data)
1079 { return 0; }
1080 static inline
1081 void lprocfs_oh_tally(struct obd_histogram *oh, unsigned int value)
1082 { return; }
1083 static inline
1084 void lprocfs_oh_tally_log2(struct obd_histogram *oh, unsigned int value)
1085 { return; }
1086 static inline
1087 void lprocfs_oh_clear(struct obd_histogram *oh)
1088 { return; }
1089 static inline
1090 unsigned long lprocfs_oh_sum(struct obd_histogram *oh)
1091 { return 0; }
1092 static inline
1093 void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx,
1094                            struct lprocfs_counter *cnt)
1095 { return; }
1096 static inline
1097 __u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
1098                                enum lprocfs_fields_flags field)
1099 { return (__u64)0; }
1100
1101 #define LPROC_SEQ_FOPS_RO(name)
1102 #define LPROC_SEQ_FOPS(name)
1103
1104 /* lprocfs_jobstats.c */
1105 static inline
1106 int lprocfs_job_stats_log(struct obd_device *obd, char *jobid, int event,
1107                           long amount)
1108 { return 0; }
1109 static inline
1110 void lprocfs_job_stats_fini(struct obd_device *obd)
1111 { return; }
1112 static inline
1113 int lprocfs_job_stats_init(struct obd_device *obd, int cntr_num,
1114                            cntr_init_callback fn)
1115 { return 0; }
1116
1117
1118 /* lproc_ptlrpc.c */
1119 #define target_print_req NULL
1120
1121 #endif /* LPROCFS */
1122
1123 #endif /* LPROCFS_SNMP_H */