Phase 2 Update
I waited for this update as the first half of the month just consisted of trying to get patches merged into upstream QEMU and then re-orienting myself with the main project of getting the coverage tools working. Then I got stuck and then I was on holidays for a week, so it didn’t seem like there was much to write about. Nonetheless I want to give an quick overview about what went on.
It started just going back and forth in emails with Frederic Konrad from the Couverture-Qemu project and doing a bit of testing. I struggled to fix the compile issues and Frederic solved them in a couple of hours what I couldn’t do for days. Quite impressive and it just goes to show how far I have to go to become a professional developer. It then seemed like I needed to hear back from the original patch creator just to confirm everything was as he intended now that it was rebased against current qemu master, so this was set aside for a while.
I got back to my RTEMS Tester work, initially it couldn’t find the symbol sets to run coverage on and I came up with elaborate reasons for why that was before realising the path in the config file was just wrong (I had convinced myself it was right… I need to be more careful).
It was running now, which was great to see after months of being broken. However there was some issues, it would finish with ‘Trace Block is Inconsistent with Coverage Map..’ messages, there was missing Gcov files and on occasion it would lock up in the middle of its coverage analysis runs and just hang idle indefinitely.
I spent a lot of time with the trace block inconsistent with coverage map problem and learned to use GDB in a one to one with my mentor Joel to figure it out. After a few late nights, I emailed the devel list with my understanding so far..
After a bit of back and forth email with Joel, we decided this was too restrictive a check and not really neccessary. This section was removed and I checked if we were getting sensible results. Sure enough the section marked not taken in the coverage map was the same as the branch marked ‘0x12’ by couverture-qemu which is a bitmap detailing ‘branch fully exectuted’ and ‘branch not taken’. The taken branches are op code 0x11.
This turned out to be a simple solution but it took quite a while to understand the problem so a decision could be made. That has been a recurring theme so far, I’ve spent most of my time just understanding what other people have written and how things work. The writing of my own code has been minimal, as compared to a university assignment which is nothing but coding my own solution from scratch every time.
Now as the project has passed through 2 sets of hands before me, there is an urgency for me to finally finish the job and get this merged. I’ve begun this process, the –coverage option is implemented in the wrong place, the error class is not being used to report errors, missing license, unit tests still in files, camelCase being used instead of underscores and general style issues not matching with what is around it.
I rushed to fix all of these on my main branch and ending up breaking what I had and had to start again. Surprisingly I was able to get back to where I was in about a day, which proves that I’ve come along way since the beginning of GSOC. Lesson to be learned about git workflow is never break what’s already working, create a new branch for each small change, test it and then merge it if its working. Repeat for the next problem. Anyway on the plus side the lock-up happens less frequently and the output was cleared up a bit, so I ended up with an improved version.
The main thing left to fix is the covoar lock-up problem and there could be some other merging problems after a second review so I’ll have to see. It looks like this phase 2 work will spill into phase 3 and I’m not sure what will happen to the original plans of refactoring covoar to produce XML. It’s hard to say if there will be time anymore. However it goes, I will definitely get the work merged and working to a standard that everyone is happy with. Then I could work on the XML output in my spare time post GSOC.