kernel-shark-qt: Fix the glitches in the preemption time visualization

This problem was reported by Steven Rostedt. The reason for having
the problem was my wrong assumption that for a given task the
sched_switch event is always the last record before the task is
preempted.

The patch changes two things:
   It modifies the "match" functions used to search for sched events,
   making these functions to trigger only on sched_switch/_wakeup events.
   This eliminates the flakiness due to the fact that sometimes the
   sched_switch can happend to be in the same bin with some of the trailing
   events from the same task. This also has the side effect of simplifying
   the code.

   It introduces a second pass over the data, which is task-specific and
   gets executed only the first time the task is plotted. This second pass
   edits the "pid" field of the last trailing event making it equal to the
   "next pid" field of the sched_switch event.

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2 files changed