aboutsummaryrefslogtreecommitdiffstats
path: root/trace-hash.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-01-05 21:57:52 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-01-05 21:57:52 -0500
commit62939f1fea71b8b8edf7985033670af0dce2116a (patch)
treeaf28940cfa0a5c5eed14a62dffc44b3a12b5c70b /trace-hash.c
parentf7f4f93a3a11cec95d28d544613631b07f95d33e (diff)
trace-view: Implement event filter
This patch now implements the event filtering dialog for the trace-view (list) only. This works with kernelshark too, but only the list is filtered. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'trace-hash.c')
-rw-r--r--trace-hash.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/trace-hash.c b/trace-hash.c
index 99b9feb..8435e6c 100644
--- a/trace-hash.c
+++ b/trace-hash.c
@@ -116,3 +116,47 @@ struct filter_task *filter_task_hash_alloc(void)
116 116
117 return hash; 117 return hash;
118} 118}
119
120void filter_task_hash_free(struct filter_task *hash)
121{
122 if (!hash)
123 return;
124
125 filter_task_clear(hash);
126 g_free(hash->hash);
127 g_free(hash);
128}
129
130struct filter_task *filter_task_hash_copy(struct filter_task *hash)
131{
132 struct filter_task *new_hash;
133 struct filter_task_item *task, **ptask;
134 gint i;
135
136 if (!hash)
137 return NULL;
138
139 new_hash = filter_task_hash_alloc();
140 g_assert(new_hash);
141
142 for (i = 0; i < FILTER_TASK_HASH_SIZE; i++) {
143 task = hash->hash[i];
144 if (!task)
145 continue;
146
147 ptask = &new_hash->hash[i];
148
149 while (task) {
150
151 *ptask = g_new0(typeof(*task), 1);
152 g_assert(*ptask);
153 **ptask = *task;
154
155 ptask = &(*ptask)->next;
156 task = task->next;
157 }
158 }
159
160 return new_hash;
161}
162