|
@@ -157,6 +157,71 @@ static const struct file_operations rcudata_csv_fops = {
|
|
|
.release = single_release,
|
|
|
};
|
|
|
|
|
|
+#ifdef CONFIG_RCU_BOOST
|
|
|
+
|
|
|
+static void print_one_rcu_node_boost(struct seq_file *m, struct rcu_node *rnp)
|
|
|
+{
|
|
|
+ seq_printf(m, "%d:%d tasks=%c%c%c%c ntb=%lu neb=%lu nnb=%lu "
|
|
|
+ "j=%04x bt=%04x\n",
|
|
|
+ rnp->grplo, rnp->grphi,
|
|
|
+ "T."[list_empty(&rnp->blkd_tasks)],
|
|
|
+ "N."[!rnp->gp_tasks],
|
|
|
+ "E."[!rnp->exp_tasks],
|
|
|
+ "B."[!rnp->boost_tasks],
|
|
|
+ rnp->n_tasks_boosted, rnp->n_exp_boosts,
|
|
|
+ rnp->n_normal_boosts,
|
|
|
+ (int)(jiffies & 0xffff),
|
|
|
+ (int)(rnp->boost_time & 0xffff));
|
|
|
+ seq_printf(m, "%s: nt=%lu egt=%lu bt=%lu nb=%lu ny=%lu nos=%lu\n",
|
|
|
+ " balk",
|
|
|
+ rnp->n_balk_blkd_tasks,
|
|
|
+ rnp->n_balk_exp_gp_tasks,
|
|
|
+ rnp->n_balk_boost_tasks,
|
|
|
+ rnp->n_balk_notblocked,
|
|
|
+ rnp->n_balk_notyet,
|
|
|
+ rnp->n_balk_nos);
|
|
|
+}
|
|
|
+
|
|
|
+static int show_rcu_node_boost(struct seq_file *m, void *unused)
|
|
|
+{
|
|
|
+ struct rcu_node *rnp;
|
|
|
+
|
|
|
+ rcu_for_each_leaf_node(&rcu_preempt_state, rnp)
|
|
|
+ print_one_rcu_node_boost(m, rnp);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static int rcu_node_boost_open(struct inode *inode, struct file *file)
|
|
|
+{
|
|
|
+ return single_open(file, show_rcu_node_boost, NULL);
|
|
|
+}
|
|
|
+
|
|
|
+static const struct file_operations rcu_node_boost_fops = {
|
|
|
+ .owner = THIS_MODULE,
|
|
|
+ .open = rcu_node_boost_open,
|
|
|
+ .read = seq_read,
|
|
|
+ .llseek = seq_lseek,
|
|
|
+ .release = single_release,
|
|
|
+};
|
|
|
+
|
|
|
+/*
|
|
|
+ * Create the rcuboost debugfs entry. Standard error return.
|
|
|
+ */
|
|
|
+static int rcu_boost_trace_create_file(struct dentry *rcudir)
|
|
|
+{
|
|
|
+ return !debugfs_create_file("rcuboost", 0444, rcudir, NULL,
|
|
|
+ &rcu_node_boost_fops);
|
|
|
+}
|
|
|
+
|
|
|
+#else /* #ifdef CONFIG_RCU_BOOST */
|
|
|
+
|
|
|
+static int rcu_boost_trace_create_file(struct dentry *rcudir)
|
|
|
+{
|
|
|
+ return 0; /* There cannot be an error if we didn't create it! */
|
|
|
+}
|
|
|
+
|
|
|
+#endif /* #else #ifdef CONFIG_RCU_BOOST */
|
|
|
+
|
|
|
static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
|
|
|
{
|
|
|
unsigned long gpnum;
|
|
@@ -315,6 +380,9 @@ static int __init rcutree_trace_init(void)
|
|
|
if (!retval)
|
|
|
goto free_out;
|
|
|
|
|
|
+ if (rcu_boost_trace_create_file(rcudir))
|
|
|
+ goto free_out;
|
|
|
+
|
|
|
retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops);
|
|
|
if (!retval)
|
|
|
goto free_out;
|