xrmx / bootchart

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

Cleanup code #46

Closed again4you closed 11 years ago

again4you commented 11 years ago

Dear Michael Meeks

This patch set are aimed to clean up the code of 'bootchart-collector' that is written in C language. In order to do that, I add log() & assert() functions that supports the DEBUG option. I also make both likely() and unlikely() macros for branch predict optimization. IMHO, this work would improve performance since gcc compiler speculates correctly whether the branch taken or not. As you already know, this technique is wildly used in Linux Kernel or Embedded system field.

Detailed items are as below.

xrmx commented 11 years ago

Not a big fan of the likely / unlikely and log macros, but the bugfix looks correct and the compiling warning looks good too. Personally i'd just cherry pick that. Michael?

mmeeks commented 11 years ago

On Fri, 2013-05-31 at 10:31 -0700, Riccardo Magliocchetti wrote:

Not a big fan of the likely / unlikely and log macros, but the bugfix looks correct and the compiling warning looks good too. Personally i'd just cherry pick that. Michael?

Yep - it is only worth optimising some super-inner-loop with likely /

unlikely - I'd ~never do that unless a profile showed me some real win; otherwise - go for it :-)

ATB,

    Michael.

michael.meeks@suse.com <><, Pseudo Engineer, itinerant idiot

xrmx commented 11 years ago

I cherry picked e163992 , e2dcee2 , dd0a4ca . Thanks Sangjung!