struct obd_histogram cl_write_page_hist;
struct obd_histogram cl_read_offset_hist;
struct obd_histogram cl_write_offset_hist;
+ ktime_t cl_batch_stats_init;
+ struct obd_histogram cl_batch_rpc_hist;
/** LRU for osc caching pages */
struct cl_client_cache *cl_cache;
}
LPROC_SEQ_FOPS(mdc_rpc_stats);
+static ssize_t mdc_batch_stats_seq_write(struct file *file,
+ const char __user *buf,
+ size_t len, loff_t *off)
+{
+ struct seq_file *seq = file->private_data;
+ struct obd_device *obd = seq->private;
+ struct client_obd *cli = &obd->u.cli;
+
+ lprocfs_oh_clear(&cli->cl_batch_rpc_hist);
+ cli->cl_batch_stats_init = ktime_get_real();
+
+ return len;
+}
+
+static int mdc_batch_stats_seq_show(struct seq_file *seq, void *v)
+{
+ struct obd_device *obd = seq->private;
+ struct client_obd *cli = &obd->u.cli;
+ unsigned long tot;
+ unsigned long cum;
+ int i;
+
+ lprocfs_stats_header(seq, ktime_get_real(), cli->cl_batch_stats_init,
+ 25, ":", true, "");
+ seq_printf(seq, "subreqs per batch batches %% cum %%\n");
+ tot = lprocfs_oh_sum(&cli->cl_batch_rpc_hist);
+ cum = 0;
+
+ for (i = 0; i < OBD_HIST_MAX; i++) {
+ unsigned long cnt = cli->cl_batch_rpc_hist.oh_buckets[i];
+
+ cum += cnt;
+ seq_printf(seq, "%d:\t\t%10lu %3u %3u\n",
+ 1 << i, cnt, pct(cnt, tot), pct(cum, tot));
+ if (cum == tot)
+ break;
+ }
+
+ return 0;
+}
+LPROC_SEQ_FOPS(mdc_batch_stats);
+
static int mdc_stats_seq_show(struct seq_file *seq, void *v)
{
struct obd_device *obd = seq->private;
.fops = &mdc_pinger_recov_fops },
{ .name = "rpc_stats",
.fops = &mdc_rpc_stats_fops },
+ { .name = "batch_stats",
+ .fops = &mdc_batch_stats_fops },
{ .name = "unstable_stats",
.fops = &mdc_unstable_stats_fops },
{ .name = "mdc_stats",
#define DEBUG_SUBSYSTEM S_MDC
#include <linux/module.h>
+#include <obd_class.h>
#include <obd.h>
#ifdef HAVE_SERVER_SUPPORT
#include <lustre_update.h>
static int batch_send_update_req(const struct lu_env *env,
struct batch_update_head *head)
{
- struct lu_batch *bh;
+ struct obd_device *obd;
struct ptlrpc_request *req = NULL;
struct batch_update_args *aa;
+ struct lu_batch *bh;
int rc;
ENTRY;
if (head == NULL)
RETURN(0);
+ obd = class_exp2obd(head->buh_exp);
bh = head->buh_batch;
rc = batch_prep_update_req(head, &req);
if (rc) {
if (req != NULL)
ptlrpc_req_finished(req);
+ lprocfs_oh_tally_log2(&obd->u.cli.cl_batch_rpc_hist,
+ head->buh_update_count);
RETURN(rc);
}