Fix task names
Created by: derkling
This series address a long standing issue with tasks names mapping.
So far we used to track at least three different task's name mapping within the Trace object:
- a
{PID: Name}
dictionary, mapping "selected" PIDs to their name - a
_tasks_by_name
dataframe, mapping all PIDs to their name - a
_tasks_by_pid
dataframe, mapping all tasknames to their PIDs
The API was even more confusing due to the fact that the Trace object can get a list of tasks which will be considered to build only the first dictionary. Moreover, each PID can be mapped to more than a task name. Indeed, when a task name is set after starting its execution, we can end up event with different task name for the same PID. However, most of the times, such an update happens right after a task has been created to set its proper name.
This series clean up all this mess by ultimately:
- using a single dataframe to map all PIDs to a unique task name
- mapping each PID to just the last name we observed for that task
- updating the existing getter method to use this single dataframe
The final code should provide a streamlined API which has also lower performance impacts both at trace parsing time as well as when the getter methods are used.