aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-06-17 19:52:41 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-06-17 19:52:41 -0400
commit6c1ae2e5a2609b8de1bbd2f6bf422eebe42d2b55 (patch)
tree6c51803ebc74bb9881c4ec1375b06a0a2b451572
parent5a0097a32a414424d91c2430bd638f62af2c8c60 (diff)
trace-cmd: Disable buffers after printing stats
If we disable the buffers before we print the stats, then the stats will be zero. That is because disabling the buffers also zeros out the stats. Print out the stats _before_ we disable the buffers. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-cmd.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/trace-cmd.c b/trace-cmd.c
index ff0389d..bd5254a 100644
--- a/trace-cmd.c
+++ b/trace-cmd.c
@@ -1696,13 +1696,6 @@ int main (int argc, char **argv)
1696 record_data(); 1696 record_data();
1697 delete_thread_data(); 1697 delete_thread_data();
1698 1698
1699 /* Turn off everything */
1700 disable_all();
1701
1702 /* If tracing_on was enabled before we started, set it on now */
1703 if (tracing_on_init_val)
1704 write_tracing_on(tracing_on_init_val);
1705
1706 printf("Kernel buffer statistics:\n" 1699 printf("Kernel buffer statistics:\n"
1707 " Note: \"entries\" are the entries left in the kernel ring buffer and are not\n" 1700 " Note: \"entries\" are the entries left in the kernel ring buffer and are not\n"
1708 " recorded in the trace data. They should all be zero.\n\n"); 1701 " recorded in the trace data. They should all be zero.\n\n");
@@ -1714,6 +1707,14 @@ int main (int argc, char **argv)
1714 printf("\n"); 1707 printf("\n");
1715 } 1708 }
1716 1709
1710 /* Turn off everything */
1711 disable_all();
1712
1713 /* If tracing_on was enabled before we started, set it on now */
1714 if (tracing_on_init_val)
1715 write_tracing_on(tracing_on_init_val);
1716
1717
1717 exit(0); 1718 exit(0);
1718 1719
1719 return 0; 1720 return 0;