12 #define FSCACHE_DEBUG_LEVEL THREAD
13 #include <linux/module.h>
27 static int fscache_histogram_show(
struct seq_file *
m,
void *
v)
32 switch ((
unsigned long) v) {
34 seq_puts(m,
"JIFS SECS OBJ INST OP RUNS OBJ RUNS "
35 " RETRV DLY RETRIEVLS\n");
38 seq_puts(m,
"===== ===== ========= ========= ========="
39 " ========= =========\n");
42 index = (
unsigned long) v - 3;
43 n[0] =
atomic_read(&fscache_obj_instantiate_histogram[index]);
46 n[3] =
atomic_read(&fscache_retrieval_delay_histogram[index]);
47 n[4] =
atomic_read(&fscache_retrieval_histogram[index]);
48 if (!(n[0] | n[1] | n[2] | n[3] | n[4]))
51 t = (index * 1000) /
HZ;
53 seq_printf(m,
"%4lu 0.%03u %9u %9u %9u %9u %9u\n",
54 index, t, n[0], n[1], n[2], n[3], n[4]);
62 static void *fscache_histogram_start(
struct seq_file *
m, loff_t *_pos)
64 if ((
unsigned long long)*_pos >=
HZ + 2)
68 return (
void *)(
unsigned long) *_pos;
74 static void *fscache_histogram_next(
struct seq_file *m,
void *
v, loff_t *
pos)
77 return (
unsigned long long)*pos >
HZ + 2 ?
78 NULL : (
void *)(
unsigned long) *
pos;
84 static void fscache_histogram_stop(
struct seq_file *m,
void *v)
89 .start = fscache_histogram_start,
90 .stop = fscache_histogram_stop,
91 .next = fscache_histogram_next,
92 .show = fscache_histogram_show,
100 return seq_open(file, &fscache_histogram_ops);
105 .open = fscache_histogram_open,