*/
void fld_cache_fini(struct fld_cache *cache)
{
- __u64 pct;
ENTRY;
LASSERT(cache != NULL);
fld_cache_flush(cache);
- if (cache->fci_stat.fst_count > 0) {
- pct = cache->fci_stat.fst_cache * 100;
- do_div(pct, cache->fci_stat.fst_count);
- } else {
- pct = 0;
- }
-
CDEBUG(D_INFO, "FLD cache statistics (%s):\n", cache->fci_name);
CDEBUG(D_INFO, " Total reqs: %llu\n", cache->fci_stat.fst_count);
CDEBUG(D_INFO, " Cache reqs: %llu\n", cache->fci_stat.fst_cache);
- CDEBUG(D_INFO, " Cache hits: %llu%%\n", pct);
+ CDEBUG(D_INFO, " Cache hits: %u%%\n",
+ pct(cache->fci_stat.fst_cache, cache->fci_stat.fst_count));
OBD_FREE_PTR(cache);
mode_t proc_mode;
};
+static inline u32 pct(s64 a, s64 b)
+{
+ return b ? a * 100 / b : 0;
+}
+
/**
* Append a space separated list of current set flags to str.
*/
}
#undef MAX_STRING_SIZE
-#define pct(a,b) (b ? a * 100 / b : 0)
-
static void ll_display_extents_info(struct ll_rw_extents_info *io_extents,
struct seq_file *seq, int which)
{
read_cum += r;
write_cum += w;
end = BIT(i + LL_HIST_START - units);
- seq_printf(seq, "%4lu%c - %4lu%c%c: %14lu %4lu %4lu | "
- "%14lu %4lu %4lu\n", start, *unitp, end, *unitp,
+ seq_printf(seq, "%4lu%c - %4lu%c%c: %14lu %4u %4u | "
+ "%14lu %4u %4u\n", start, *unitp, end, *unitp,
(i == LL_HIST_MAX - 1) ? '+' : ' ',
r, pct(r, read_tot), pct(read_cum, read_tot),
w, pct(w, write_tot), pct(write_cum, write_tot));
* 16kB: { samples: 12, pct: 3, cum_pct: 81 }
**/
-#define pct(a, b) (b ? a * 100 / b : 0)
-
static void display_rename_stats(struct seq_file *seq, char *name,
struct obd_histogram *hist)
{
else
seq_printf(seq, "%6s%d%s", " ", 1<<(i-20), "MB:");
- seq_printf(seq, " { sample: %3lu, pct: %3lu, cum_pct: %3lu }\n",
- t, pct(t, tot), pct(cum, tot));
+ seq_printf(seq, " { sample: %3lu, pct: %3u, cum_pct: %3u }\n",
+ t, pct(t, tot), pct(cum, tot));
if (cum == tot)
break;
&rename_stats->hist[RENAME_CROSSDIR_TGT_SIZE]);
}
-#undef pct
-
static int mdt_rename_stats_seq_show(struct seq_file *seq, void *v)
{
struct mdt_device *mdt = seq->private;
}
EXPORT_SYMBOL(obd_set_max_mod_rpcs_in_flight);
-
-#define pct(a, b) (b ? a * 100 / b : 0)
int obd_mod_rpc_stats_seq_show(struct client_obd *cli,
struct seq_file *seq)
{
for (i = 0; i < OBD_HIST_MAX; i++) {
unsigned long mod = cli->cl_mod_rpcs_hist.oh_buckets[i];
mod_cum += mod;
- seq_printf(seq, "%d:\t\t%10lu %3lu %3lu\n",
+ seq_printf(seq, "%d:\t\t%10lu %3u %3u\n",
i, mod, pct(mod, mod_tot),
pct(mod_cum, mod_tot));
if (mod_cum == mod_tot)
return 0;
}
EXPORT_SYMBOL(obd_mod_rpc_stats_seq_show);
-#undef pct
-
/* The number of modify RPCs sent in parallel is limited
* because the server has a finite number of slots per client to
{ NULL }
};
-#define pct(a,b) (b ? a * 100 / b : 0)
-
static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
{
struct timespec64 now;
read_cum += r;
write_cum += w;
- seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
+ seq_printf(seq, "%d:\t\t%10lu %3u %3u | %10lu %3u %3u\n",
1 << i, r, pct(r, read_tot),
pct(read_cum, read_tot), w,
pct(w, write_tot),
unsigned long w = cli->cl_write_rpc_hist.oh_buckets[i];
read_cum += r;
write_cum += w;
- seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
+ seq_printf(seq, "%d:\t\t%10lu %3u %3u | %10lu %3u %3u\n",
i, r, pct(r, read_tot),
pct(read_cum, read_tot), w,
pct(w, write_tot),
unsigned long w = cli->cl_write_offset_hist.oh_buckets[i];
read_cum += r;
write_cum += w;
- seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n",
- (i == 0) ? 0 : 1 << (i - 1),
- r, pct(r, read_tot), pct(read_cum, read_tot),
- w, pct(w, write_tot), pct(write_cum, write_tot));
+ seq_printf(seq, "%d:\t\t%10lu %3u %3u | %10lu %3u %3u\n",
+ (i == 0) ? 0 : 1 << (i - 1),
+ r, pct(r, read_tot), pct(read_cum, read_tot),
+ w, pct(w, write_tot), pct(write_cum, write_tot));
if (read_cum == read_tot && write_cum == write_tot)
break;
}
return 0;
}
-#undef pct
static ssize_t osc_rpc_stats_seq_write(struct file *file,
const char __user *buf,
lprocfs_oh_tally(&s->hist[BRW_R_DISCONT_BLOCKS+rw], discont_blocks);
}
-#define pct(a, b) (b ? a * 100 / b : 0)
-
static void display_brw_stats(struct seq_file *seq, char *name, char *units,
struct obd_histogram *read, struct obd_histogram *write, int scale)
{
else
seq_printf(seq, "%uM", scale << (i-20));
- seq_printf(seq, ":\t\t%10lu %3lu %3lu | %4lu %3lu %3lu\n",
+ seq_printf(seq, ":\t\t%10lu %3u %3u | %4lu %3u %3u\n",
r, pct(r, read_tot), pct(read_cum, read_tot),
w, pct(w, write_tot), pct(write_cum, write_tot));
&brw_stats->hist[BRW_W_DISK_IOSIZE], 1);
}
-#undef pct
-
static int osd_brw_stats_seq_show(struct seq_file *seq, void *v)
{
struct osd_device *osd = seq->private;
#ifdef CONFIG_PROC_FS
-#define pct(a, b) (b ? a * 100 / b : 0)
-
static void display_brw_stats(struct seq_file *seq, char *name, char *units,
struct obd_histogram *read,
struct obd_histogram *write, int scale)
else
seq_printf(seq, "%uM", scale << (i-20));
- seq_printf(seq, ":\t\t%10lu %3lu %3lu | %4lu %3lu %3lu\n",
+ seq_printf(seq, ":\t\t%10lu %3u %3u | %4lu %3u %3u\n",
r, pct(r, read_tot), pct(read_cum, read_tot),
w, pct(w, write_tot), pct(write_cum, write_tot));
&brw_stats->hist[BRW_W_DISK_IOSIZE], 1);
}
-#undef pct
-
static int osd_brw_stats_seq_show(struct seq_file *seq, void *v)
{
struct osd_device *osd = seq->private;