[PATCH 09/11] libtraceeval task-eval: Do not add pdata to non RUNNING tasks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>

The pdata is used to daisy chain all the threads for each task with the
same name. But since the tasks saving is broken up for each of their
scheduling states, the pdata is saved in just the RUNNING state. But since
it also needs to be freed, each pdata only needs to be saved once in the
traceeval for tasks.

Make sure that when updating the tasks, the pdata for the task is only
saved with the RUNNING state, and all other states just have NULL.

Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
 samples/task-eval.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/samples/task-eval.c b/samples/task-eval.c
index 79039580ce78..420d87f498cc 100644
--- a/samples/task-eval.c
+++ b/samples/task-eval.c
@@ -496,6 +496,10 @@ static void update_thread(struct task_data *tdata, int pid, const char *comm,
 
 		traceeval_insert(pdata->teval_threads, thread_keys, vals);
 
+		/* Only the RUNNING state keeps pdata */
+		if (state != RUNNING)
+			pdata = NULL;
+
 		/* Also update the process */
 		assign_task_keys(task_keys, comm, state);
 		assign_task_vals(pvals, pdata, delta, ts);
-- 
2.42.0





[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux