lkml.org 
[lkml]   [2011]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] perf, x86: Fix event scheduler for constraints with overlapping counters
On 19.04.11 07:29:33, Ingo Molnar wrote:
>
> * Robert Richter <robert.richter@amd.com> wrote:
>
> > + if (!state)
> > + /* no events to reschedule */
> > + goto done;
>
> Hm, that's 5 levels of indentation. Would it be possible to factor out the gist
> of the logic into a helper and such? My eyes would be much happier!

Hmm, I was thinking about this too, but it is not easy since we
control also the loops with goto's and updates of the loop
states. Refactoring out the inner block would mean to update state
varables via pointers and to introduce return codes which contains
control flow information. Don't think this will become easier.

We could probably merge both for-loops in one while-loop but also on
costs of code readability.

-Robert

--
Advanced Micro Devices, Inc.
Operating System Research Center



\
 
 \ /
  Last update: 2011-04-19 15:59    [W:0.124 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site