Hello Dave,
The patch is used to fix the output of trace.c.
When I was using trace command to display function tracer's data. The
following information is displayed.
<cut>
crash> trace show
version = 6
cpus=2
<idle>-0 [001] 20067.827943: function:
0xffffffff81089fa40xffffffff8109e423
<idle>-0 [001] 20067.827944: function:
0xffffffff811115a40xffffffff8109e4cd
<idle>-0 [001] 20067.827944: function:
0xffffffff81097a140xffffffff8109e44f
<idle>-0 [001] 20067.827945: function:
0xffffffff81089fa40xffffffff8109e479
<idle>-0 [001] 20067.827945: function:
0xffffffff81089fa40xffffffff8109e482
...
<cut>
In tmp_fprintf, function snprintf is used to output data. However, if
the following situation happends, the last character is omitted which
causes the above bug.
<cut>
snprintf(buf, 10, "123456789\n"); /* '\n' is omitted */
<cut>
With the patch, the output is like below.
<cut>
crash> trace show
version = 6
cpus=2
<idle>-0 [001] 20067.827943: function:
debug_lockdep_rcu_enabled <-- walk_tg_tree_from
<idle>-0 [001] 20067.827944: function:
rcu_is_cpu_idle <-- walk_tg_tree_from
<idle>-0 [001] 20067.827944: function: tg_nop
<-- walk_tg_tree_from
<idle>-0 [001] 20067.827945: function:
debug_lockdep_rcu_enabled <-- walk_tg_tree_from
<idle>-0 [001] 20067.827945: function:
debug_lockdep_rcu_enabled <-- walk_tg_tree_from
...
<cut>
--
--
Regards
Qiao Nuohan