From 55db6d133a92cf32aaac8bf3aec663dfd58660e0 Mon Sep 17 00:00:00 2001 From: David Höppner <0xffea@gmail.com> Date: Sat, 5 Jan 2013 11:56:55 +0000 Subject: Add TASK_EVENTS_INFO support to libps * libps/procstat.c (merge_procinfo): Also copy taskevents. * libps/procstat.c (set_procinfo_flags): Set pointer to task_events_info. * tasks: Remove TASK_EVENTS_INFO item. --- libps/procstat.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libps') diff --git a/libps/procstat.c b/libps/procstat.c index ba923780..845db6c0 100644 --- a/libps/procstat.c +++ b/libps/procstat.c @@ -226,6 +226,10 @@ merge_procinfo (struct proc_stat *ps, ps_flags_t need, ps_flags_t have) /* Task info. */ bcopy (&old_pi_hdr.taskinfo, &new_pi->taskinfo, sizeof (struct task_basic_info)); + if (have & PSTAT_TASK_EVENTS) + /* Event info. */ + bcopy (&old_pi_hdr.taskevents, &new_pi->taskevents, + sizeof (struct task_events_info)); /* That's it for now. */ if (new_pi != ps->proc_info) @@ -637,6 +641,8 @@ set_procinfo_flags (struct proc_stat *ps, ps_flags_t need, ps_flags_t have) gotten them, as the information will be newer. */ if (have & PSTAT_TASK_BASIC) ps->task_basic_info = &pi->taskinfo; + if (have & PSTAT_TASK_EVENTS) + ps->task_events_info = &pi->taskevents; if (have & PSTAT_NUM_THREADS) ps->num_threads = count_threads (pi, have); if (had & PSTAT_THREAD_BASIC) -- cgit v1.2.3