[2.1 SUP]
    
    find_create_process() can return NULL if ruid of the process didn't match
    given uid. Work around this case.

Signed-off-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> 

---

 process/do_process.cpp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/process/do_process.cpp b/process/do_process.cpp
index bf7ea23..60a9adc 100644
--- a/process/do_process.cpp
+++ b/process/do_process.cpp
@@ -234,6 +234,10 @@ void perf_process_bundle::handle_trace_point(int type, 
void *trace, int cpu, uin
                if (consumer_depth(cpu))
                        pop_consumer(cpu);
 
+               /* If only processes with matching uid should be processed. */
+               if (!new_proc)
+                       return;
+
                push_consumer(cpu, new_proc);
 
                /* start new process */
@@ -285,6 +289,10 @@ void perf_process_bundle::handle_trace_point(int type, 
void *trace, int cpu, uin
                        from_proc = (class process *) from;
                }
 
+               /* If only processes with matching uid should be processed. */
+               if (!dest_proc)
+                       return;
+
                if (from_proc && (dest_proc->running == 0) && (dest_proc->waker 
== NULL) && (we->pid != 0) && !dont_blame_me(from_proc->comm))
                        dest_proc->waker = from;
                if (from)
@@ -945,7 +953,6 @@ double total_cpu_time(void)
                total += all_power[i]->accumulated_runtime - 
all_power[i]->child_runtime;
        }
 
-       
        total =  (total / (0.0001 + last_stamp - first_stamp));
 
        return total;

_______________________________________________
Discuss mailing list
Discuss@lesswatts.org
http://lists.lesswatts.org/listinfo/discuss

Reply via email to