[FIX] filtering sampling messeges 88/42888/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Fri, 3 Jul 2015 12:32:55 +0000 (15:32 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 6 Jul 2015 08:38:56 +0000 (01:38 -0700)
Change-Id: I8eebb9c69929aaf29c24b194c96f7ba8e5a9f99e
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
us_manager/sspt/sspt_proc.c
us_manager/sspt/sspt_proc.h
us_manager/us_manager.c

index c4e7255..71744a8 100644 (file)
@@ -497,3 +497,20 @@ void sspt_proc_on_each_filter(struct sspt_proc *proc,
        list_for_each_entry(fl, &proc->filter_list, list)
                func(fl, data);
 }
+
+static void is_send_event(struct sspt_filter *f, void *data)
+{
+       bool *is_send = (bool *)data;
+
+       if (!*is_send && f->pfg_is_inst)
+               *is_send = !!pfg_msg_cb_get(f->pfg);
+}
+
+bool sspt_proc_is_send_event(struct sspt_proc *proc)
+{
+       bool is_send = false;
+
+       sspt_proc_on_each_filter(proc, is_send_event, (void *)&is_send);
+
+       return is_send;
+}
index 22fe786..1b0f9d2 100644 (file)
@@ -99,4 +99,6 @@ void sspt_proc_on_each_filter(struct sspt_proc *proc,
                              void (*func)(struct sspt_filter *, void *),
                              void *data);
 
+bool sspt_proc_is_send_event(struct sspt_proc *proc);
+
 #endif /* __SSPT_PROC__ */
index aa5f3c7..4328e44 100644 (file)
@@ -183,7 +183,13 @@ EXPORT_SYMBOL_GPL(get_quiet);
  */
 static int us_filter(struct task_struct *task)
 {
-       return !!sspt_proc_get_by_task(task);
+       struct sspt_proc *proc;
+
+       proc = sspt_proc_get_by_task(task);
+       if (proc)
+               return sspt_proc_is_send_event(proc);
+
+       return 0;
 }
 
 static struct ev_filter ev_us_filter = {