added and fixed code to read processes and threads as well from procfs