[1/3] kernel-shark-qt: Move declarations to top in datafilter.c example
diff mbox series

Message ID 20180703162432.177104690@goodmis.org
State New, archived
Headers show
Series
  • kernel-shark-qt: Merge kshark_load_data_records/entries()
Related show

Commit Message

Steven Rostedt July 3, 2018, 4:21 p.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

The C style for trace-cmd and KernelShark is to follow the Linux kernel
where all declarations are done at a top of a C block and not intermingled
in the code.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel-shark-qt/examples/datafilter.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/kernel-shark-qt/examples/datafilter.c b/kernel-shark-qt/examples/datafilter.c
index f8048bf62d32..13b088ebdc20 100644
--- a/kernel-shark-qt/examples/datafilter.c
+++ b/kernel-shark-qt/examples/datafilter.c
@@ -18,6 +18,8 @@  int main(int argc, char **argv)
 	size_t i, n_rows, n_tasks, n_evts, count;
 	struct kshark_context *kshark_ctx;
 	struct kshark_entry **data = NULL;
+	struct event_filter *adv_filter;
+	struct event_format *event;
 	char *entry_str;
 	bool status;
 	int *pids;
@@ -81,7 +83,6 @@  int main(int argc, char **argv)
 	puts("\n\n");
 
 	/* Show only "sched" events. */
-	struct event_format *event;
 	n_evts = kshark_ctx->pevent->nr_events;
 	for (i = 0; i < n_evts; ++i) {
 		event = kshark_ctx->pevent->events[i];
@@ -115,7 +116,7 @@  int main(int argc, char **argv)
 	kshark_filter_clear(kshark_ctx, KS_SHOW_EVENT_FILTER);
 
 	/* Use the Advanced filter to do event content based filtering. */
-	struct event_filter *adv_filter = kshark_ctx->advanced_event_filter;
+	adv_filter = kshark_ctx->advanced_event_filter;
 	pevent_filter_add_filter_str(adv_filter,
 				     "sched/sched_wakeup:target_cpu==1");