GSoC Project work - Week 2

Mystery bugs.
This post summarises the progress in the second week of the coding period.
After exploring all methods to fetch data from PMDA actual implementation of the pcp-pidstat started. The first step to implement pcp-pidstat was to find what information from /proc is required and to identify pcp metrics which represent those values.
As suggested, I created a table which contained mapping of the information used by pidstat to the metric that gives similar values.
After getting mapping, I started to write a basic version of pcp-pidstat. It is available here.
After writing the basic verison, I tried few test cases:
- Run
sudo dd if=/dev/zero of=/dev/nullin one terminal and thenpcp-pidstatin another terminal. Check if %user shows around 30%
output: Successful. - Run
sudo dd if=/dev/zero of=/dev/nullin one terminal and thenpcp-pidstatin another terminal. Then closeddcheck if it’s not present in thepcp-pidstatoutput.
output: Successful. - Run
pcp-pidstatin a terminal and then runsudo dd if=/dev/zero of=/dev/nullin another terminal. Check ifddis shown in thepcp-pidstatoutput.
output: Unsuccessful.
I tried to understand this behaviour ofpcp-pidstatbut couldn’t solve the mystery. So I asked this to the mentors and Nathan looked into the code and explained me the cause.
So the explanation includes that, pcp deals with the metric instance values and names in a unique way. Every fetch of the instance values only fetches the instance id and instance value but not the instance name. To get the instance name a separate fetch has to be issued to PMDA. Thus in my code, which had instance name to instance value mapping would have some empty names as keys (for the processes that are newly started).
This was a critical issue but finally, it was solved and the basic or the skeleton version of pcp-pidstat was ready.
That’s all folks.