aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_trace.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2011-02-22 16:42:43 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-05-06 02:16:55 -0400
commit0ea1f2ebeb217d38770aebf91c4ecaa8e01b3305 (patch)
treeef558d2eb804ca033a5166d24f5b4be7cf87727f /kernel/rcutree_trace.c
parent67b98dba474f293c389fc2b7254dcf7c0492e3bd (diff)
rcu: Add boosting to TREE_PREEMPT_RCU tracing
Includes total number of tasks boosted, number boosted on behalf of each of normal and expedited grace periods, and statistics on attempts to initiate boosting that failed for various reasons. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree_trace.c')
-rw-r--r--kernel/rcutree_trace.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c
index 1cedf94e2c4f..ead5736f99b5 100644
--- a/kernel/rcutree_trace.c
+++ b/kernel/rcutree_trace.c
@@ -157,6 +157,71 @@ static const struct file_operations rcudata_csv_fops = {
157 .release = single_release, 157 .release = single_release,
158}; 158};
159 159
160#ifdef CONFIG_RCU_BOOST
161
162static void print_one_rcu_node_boost(struct seq_file *m, struct rcu_node *rnp)
163{
164 seq_printf(m, "%d:%d tasks=%c%c%c%c ntb=%lu neb=%lu nnb=%lu "
165 "j=%04x bt=%04x\n",
166 rnp->grplo, rnp->grphi,
167 "T."[list_empty(&rnp->blkd_tasks)],
168 "N."[!rnp->gp_tasks],
169 "E."[!rnp->exp_tasks],
170 "B."[!rnp->boost_tasks],
171 rnp->n_tasks_boosted, rnp->n_exp_boosts,
172 rnp->n_normal_boosts,
173 (int)(jiffies & 0xffff),
174 (int)(rnp->boost_time & 0xffff));
175 seq_printf(m, "%s: nt=%lu egt=%lu bt=%lu nb=%lu ny=%lu nos=%lu\n",
176 " balk",
177 rnp->n_balk_blkd_tasks,
178 rnp->n_balk_exp_gp_tasks,
179 rnp->n_balk_boost_tasks,
180 rnp->n_balk_notblocked,
181 rnp->n_balk_notyet,
182 rnp->n_balk_nos);
183}
184
185static int show_rcu_node_boost(struct seq_file *m, void *unused)
186{
187 struct rcu_node *rnp;
188
189 rcu_for_each_leaf_node(&rcu_preempt_state, rnp)
190 print_one_rcu_node_boost(m, rnp);
191 return 0;
192}
193
194static int rcu_node_boost_open(struct inode *inode, struct file *file)
195{
196 return single_open(file, show_rcu_node_boost, NULL);
197}
198
199static const struct file_operations rcu_node_boost_fops = {
200 .owner = THIS_MODULE,
201 .open = rcu_node_boost_open,
202 .read = seq_read,
203 .llseek = seq_lseek,
204 .release = single_release,
205};
206
207/*
208 * Create the rcuboost debugfs entry. Standard error return.
209 */
210static int rcu_boost_trace_create_file(struct dentry *rcudir)
211{
212 return !debugfs_create_file("rcuboost", 0444, rcudir, NULL,
213 &rcu_node_boost_fops);
214}
215
216#else /* #ifdef CONFIG_RCU_BOOST */
217
218static int rcu_boost_trace_create_file(struct dentry *rcudir)
219{
220 return 0; /* There cannot be an error if we didn't create it! */
221}
222
223#endif /* #else #ifdef CONFIG_RCU_BOOST */
224
160static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp) 225static void print_one_rcu_state(struct seq_file *m, struct rcu_state *rsp)
161{ 226{
162 unsigned long gpnum; 227 unsigned long gpnum;
@@ -315,6 +380,9 @@ static int __init rcutree_trace_init(void)
315 if (!retval) 380 if (!retval)
316 goto free_out; 381 goto free_out;
317 382
383 if (rcu_boost_trace_create_file(rcudir))
384 goto free_out;
385
318 retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops); 386 retval = debugfs_create_file("rcugp", 0444, rcudir, NULL, &rcugp_fops);
319 if (!retval) 387 if (!retval)
320 goto free_out; 388 goto free_out;