spin_lock(&sbi->ll_lock);
sbi->ll_async_page_max = pages_number ;
spin_unlock(&sbi->ll_lock);
-
+
if (!sbi->ll_dt_exp)
/* Not set up yet, don't call llap_shrink_cache */
return count;
unsigned long total_budget = 0;
int n = 0, cpu;
- n += snprintf(page +n, count - n,
+ n += snprintf(page +n, count - n,
"cpu\tpage count\tbudget\t\treblnc count\tgen\thit\tmiss\tcross\n");
for_each_online_cpu(cpu) {
pd = LL_PGLIST_DATA_CPU(sbi, cpu);
- n += snprintf(page + n, count - n,
- "%d\t%-8lu\t%-8lu\t%-8lu\t%lu\t%lu\t%lu\t%lu\n",
+ n += snprintf(page + n, count - n,
+ "%d\t%-8lu\t%-8lu\t%-8lu\t%lu\t%lu\t%lu\t%lu\n",
cpu, pd->llpd_count, pd->llpd_budget,
- pd->llpd_reblnc_count, pd->llpd_gen,
+ pd->llpd_reblnc_count, pd->llpd_gen,
pd->llpd_hit, pd->llpd_miss, pd->llpd_cross);
total_budget += pd->llpd_budget;
}
- n += snprintf(page + n, count - n,
- "Total budget: %lu, page max: %lu, rebalance cnt: %lu\n",
- total_budget, sbi->ll_async_page_max,
+ n += snprintf(page + n, count - n,
+ "Total budget: %lu, page max: %lu, rebalance cnt: %lu\n",
+ total_budget, sbi->ll_async_page_max,
sbi->ll_async_page_reblnc_count);
*eof = 1;
return n;
return count;
}
-static int ll_rd_track_id(char *page, int count, void *data,
+static int ll_rd_track_id(char *page, int count, void *data,
enum stats_track_type type)
{
struct super_block *sb = data;
if (ll_s2sbi(sb)->ll_stats_track_type == type) {
return snprintf(page, count, "%d\n",
ll_s2sbi(sb)->ll_stats_track_id);
-
+
} else if (ll_s2sbi(sb)->ll_stats_track_type == STATS_TRACK_ALL) {
return snprintf(page, count, "0 (all)\n");
} else {
static int ll_wr_track_gid(struct file *file, const char *buffer,
unsigned long count, void *data)
-{
+{
return (ll_wr_track_id(buffer, count, data, STATS_TRACK_GID));
}
len = strlen(lsi->lsi_lmd->lmd_profile);
ptr = strrchr(lsi->lsi_lmd->lmd_profile, '-');
if (ptr && (strcmp(ptr, "-client") == 0))
- len -= 7;
-
+ len -= 7;
+
/* Mount info */
snprintf(name, MAX_STRING_SIZE, "%.*s-%p", len,
lsi->lsi_lmd->lmd_profile, sb);
-
+
sbi->ll_proc_root = lprocfs_register(name, parent, NULL, NULL);
if (IS_ERR(sbi->ll_proc_root)) {
err = PTR_ERR(sbi->ll_proc_root);
CWARN("Error adding the offset_stats file\n");
/* File operations stats */
- sbi->ll_stats = lprocfs_alloc_stats(LPROC_LL_FILE_OPCODES,
+ sbi->ll_stats = lprocfs_alloc_stats(LPROC_LL_FILE_OPCODES,
LPROCFS_STATS_FLAG_PERCPU);
if (sbi->ll_stats == NULL)
GOTO(out, err = -ENOMEM);
for (id = 0; id < LL_RA_STAT; id++)
lprocfs_counter_init(sbi->ll_ra_stats, id, 0,
ra_stats_string[id], "pages");
- err = lprocfs_register_stats(sbi->ll_proc_root, "read_ahead_stats",
+ err = lprocfs_register_stats(sbi->ll_proc_root, "read_ahead_stats",
sbi->ll_ra_stats);
if (err)
GOTO(out, err);
return 0;
}
-static void *llite_dump_pgcache_seq_next(struct seq_file *seq, void *v,
+static void *llite_dump_pgcache_seq_next(struct seq_file *seq, void *v,
loff_t *pos)
{
struct ll_async_page *llap, *dummy_llap = seq->private;
* we advance to a position beyond it, returning null if there
* isn't another llap in the list beyond that new position. */
pd = ll_pglist_cpu_lock(sbi, cpu);
- llap = llite_pglist_next_llap(&pd->llpd_list,
+ llap = llite_pglist_next_llap(&pd->llpd_list,
&dummy_llap->llap_pglist_item);
list_del_init(&dummy_llap->llap_pglist_item);
if (llap) {
ll_pglist_cpu_unlock(sbi, i);
}
if (next != NULL) {
- list_move(&dummy_llap->llap_pglist_item,
+ list_move(&dummy_llap->llap_pglist_item,
&next->llpd_list);
dummy_llap->llap_pglist_cpu = i;
ll_pglist_cpu_unlock(sbi, cpu);
do_gettimeofday(&now);
if (!sbi->ll_rw_stats_on) {
- seq_printf(seq, "Disabled\n"
- "Write anything in this file to activate\n");
+ seq_printf(seq, "disabled\n"
+ "write anything in this file to activate, "
+ "then 0 or \"[D/d]isabled\" to deactivate\n");
return 0;
}
seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
now.tv_sec, now.tv_usec);
seq_printf(seq, "%15s %19s | %20s\n", " ", "read", "write");
- seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n",
+ seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n",
"extents", "calls", "%", "cum%",
"calls", "%", "cum%");
spin_lock(&sbi->ll_pp_extent_lock);
struct ll_sb_info *sbi = seq->private;
struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info;
int i;
+ int value = 1, rc = 0;
+
+ rc = lprocfs_write_helper(buf, len, &value);
+ if (rc < 0 && (strcmp(buf, "disabled") == 0 ||
+ strcmp(buf, "Disabled") == 0))
+ value = 0;
+
+ if (value == 0)
+ sbi->ll_rw_stats_on = 0;
+ else
+ sbi->ll_rw_stats_on = 1;
- sbi->ll_rw_stats_on = 1;
spin_lock(&sbi->ll_pp_extent_lock);
for(i = 0; i < LL_PROCESS_HIST_MAX; i++) {
io_extents->pp_extents[i].pid = 0;
do_gettimeofday(&now);
if (!sbi->ll_rw_stats_on) {
- seq_printf(seq, "Disabled\n"
- "Write anything in this file to activate\n");
+ seq_printf(seq, "disabled\n"
+ "write anything in this file to activate, "
+ "then 0 or \"[D/d]isabled\" to deactivate\n");
return 0;
}
seq_printf(seq, "snapshot_time: %lu.%lu (secs.usecs)\n",
now.tv_sec, now.tv_usec);
seq_printf(seq, "%15s %19s | %20s\n", " ", "read", "write");
- seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n",
+ seq_printf(seq, "%13s %14s %4s %4s | %14s %4s %4s\n",
"extents", "calls", "%", "cum%",
"calls", "%", "cum%");
spin_lock(&sbi->ll_lock);
struct ll_sb_info *sbi = seq->private;
struct ll_rw_extents_info *io_extents = &sbi->ll_rw_extents_info;
int i;
+ int value = 1, rc = 0;
- sbi->ll_rw_stats_on = 1;
+ rc = lprocfs_write_helper(buf, len, &value);
+ if (rc < 0 && (strcmp(buf, "disabled") == 0 ||
+ strcmp(buf, "Disabled") == 0))
+ value = 0;
+
+ if (value == 0)
+ sbi->ll_rw_stats_on = 0;
+ else
+ sbi->ll_rw_stats_on = 1;
spin_lock(&sbi->ll_pp_extent_lock);
for(i = 0; i <= LL_PROCESS_HIST_MAX; i++)
{
if (cur == -1) {
/* new process */
- sbi->ll_extent_process_count =
+ sbi->ll_extent_process_count =
(sbi->ll_extent_process_count + 1) % LL_PROCESS_HIST_MAX;
cur = sbi->ll_extent_process_count;
io_extents->pp_extents[cur].pid = pid;
lprocfs_oh_clear(&io_extents->pp_extents[cur].pp_w_hist);
}
- for(i = 0; (count >= (1 << LL_HIST_START << i)) &&
+ for(i = 0; (count >= (1 << LL_HIST_START << i)) &&
(i < (LL_HIST_MAX - 1)); i++);
if (rw == 0) {
io_extents->pp_extents[cur].pp_r_hist.oh_buckets[i]++;
do_gettimeofday(&now);
if (!sbi->ll_rw_stats_on) {
- seq_printf(seq, "Disabled\n"
- "Write anything in this file to activate\n");
+ seq_printf(seq, "disabled\n"
+ "write anything in this file to activate, "
+ "then 0 or \"[D/d]isabled\" to deactivate\n");
return 0;
}
spin_lock(&sbi->ll_process_lock);
struct ll_sb_info *sbi = seq->private;
struct ll_rw_process_info *process_info = sbi->ll_rw_process_info;
struct ll_rw_process_info *offset_info = sbi->ll_rw_offset_info;
+ int value = 1, rc = 0;
- sbi->ll_rw_stats_on = 1;
+ rc = lprocfs_write_helper(buf, len, &value);
+
+ if (rc < 0 && (strcmp(buf, "disabled") == 0 ||
+ strcmp(buf, "Disabled") == 0))
+ value = 0;
+
+ if (value == 0)
+ sbi->ll_rw_stats_on = 0;
+ else
+ sbi->ll_rw_stats_on = 1;
spin_lock(&sbi->ll_process_lock);
sbi->ll_offset_process_count = 0;