aboutsummaryrefslogtreecommitdiffstats
path: root/trace-view-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace-view-store.c')
-rw-r--r--trace-view-store.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/trace-view-store.c b/trace-view-store.c
index 04debbb..1f1e952 100644
--- a/trace-view-store.c
+++ b/trace-view-store.c
@@ -1075,6 +1075,43 @@ guint64 trace_view_store_get_offset_from_row(TraceViewStore *store, gint row)
1075 return store->rows[row]->offset; 1075 return store->rows[row]->offset;
1076} 1076}
1077 1077
1078void trace_view_store_filter_tasks(TraceViewStore *store, struct filter_task *filter)
1079{
1080 struct tracecmd_input *handle;
1081 struct pevent *pevent;
1082 struct record *record;
1083 gint pid;
1084 gint cpu;
1085 gint i;
1086
1087 g_return_if_fail (TRACE_VIEW_IS_LIST (store));
1088
1089 handle = store->handle;
1090 pevent = tracecmd_get_pevent(store->handle);
1091
1092 for (cpu = 0; cpu < store->cpus; cpu++) {
1093 record = tracecmd_read_cpu_first(handle, cpu);
1094
1095 for (i = 0; i < store->cpu_items[cpu]; i++) {
1096
1097 g_assert(record->offset == store->cpu_list[cpu][i].offset);
1098
1099 /* TODO: put event filter check here */
1100 pid = pevent_data_pid(pevent, record);
1101 if (!filter || filter_task_find_pid(filter, pid))
1102 store->cpu_list[cpu][i].visible = 1;
1103 else
1104 store->cpu_list[cpu][i].visible = 0;
1105
1106 free_record(record);
1107 record = tracecmd_read_data(handle, cpu);
1108 }
1109 g_assert(record == NULL);
1110 }
1111
1112 merge_sort_rows_ts(store);
1113}
1114
1078/***************************************************************************** 1115/*****************************************************************************
1079 * 1116 *
1080 * trace_view_store_append_record: Empty lists are boring. This function can 1117 * trace_view_store_append_record: Empty lists are boring. This function can