xrmx / bootchart

merge of bootchart-collector and pybootchartgui
GNU General Public License v2.0
233 stars 88 forks source link

Additional error checking and other cleanups #48

Closed MattSANU closed 10 years ago

MattSANU commented 10 years ago

Hi, I've added quite a lot of additional error checking and diagnostics, and various other cleanups. Would you like to pull these, or perhaps cherry-pick them?

Also, there is one real bugfix here, unfortunately a bit buried on other changes:

freopen("/proc/kmsg", "a", stderr) => EBADF ...but... freopen("/proc/kmsg", "w", stderr) => a valid FILE *

I'm guessing that this fails in the append case because the underlying lseek call fails because /proc/kmsg is of length zero, or otherwise because it is not an on-disk file.

Best wishes, Matt

xrmx commented 10 years ago

Hi Matt, thanks for the patches! Will review in the next few days.

xrmx commented 10 years ago

Regarding freopen() issue you mention, is it some theorical issue or are you hitting that?

MattSANU commented 10 years ago

The freopen issue is real, and causes the collector to fail totally; no stats are dumped. So it's not only real, it's a show-stopper. Please cherry-pick it.

MattSANU commented 10 years ago

Heya Riccardo, I noticed the freopen fix isn't in your tree yet. It is a real bugfix for a real issue - could you please cherry-pick it? Apart from that, I think everything important has been merged. I agree with you, I don't think all of the perror/log additions are necessary. I think once the freopen fix is in, we can close this pull request. What do you think?

xrmx commented 10 years ago

Pull request still open, don't worry :)

xrmx commented 10 years ago

Pushed the freopen fix, sorry for taking so long. Closing as agreed. Thanks again!