[PATCH] Add statistical printout of rank_for_schedule decisions

2014-07-13 Thread Maxim Kuvyrkov
Hi,

This patch adds dump printouts for scheduling heuristics in rank_for_schedule.  
Rank_for_schedule is one of the cornerstones of haifa scheduler, yet its 
decisions are hard to track and debug.

This patch adds statistical gathering for each branch of rank_for_schedule, and 
prints them out according to sched verbosity.  This patch helped me track down 
several bugs in rank_for_schedule that result is stupid scheduling decisions.

Bootstrapped and tested on x86_64-linux-gnu.

OK to apply?

Thank you,

--
Maxim Kuvyrkov
www.linaro.org




0002-Add-statistical-printout-of-rank_for_schedule-decisi.patch
Description: Binary data


Re: [PATCH] Add statistical printout of rank_for_schedule decisions

2014-07-17 Thread Jeff Law

On 07/13/14 22:17, Maxim Kuvyrkov wrote:

Hi,

This patch adds dump printouts for scheduling heuristics in
rank_for_schedule.  Rank_for_schedule is one of the cornerstones of
haifa scheduler, yet its decisions are hard to track and debug.

This patch adds statistical gathering for each branch of
rank_for_schedule, and prints them out according to sched verbosity.
This patch helped me track down several bugs in rank_for_schedule
that result is stupid scheduling decisions.

Bootstrapped and tested on x86_64-linux-gnu.

OK to apply?

Presmably you use the

return increment, retval;

construct to avoid the need for braces?

I can see how it's useful here, but I don't think we've generally used 
comma operators like that and it's a style that I've never liked all 
that much.


Could you go ahead and split it into two statements and add the 
necessary braces?  Approved with that change.


Jeff


Re: [PATCH] Add statistical printout of rank_for_schedule decisions

2014-08-03 Thread Maxim Kuvyrkov
On Jul 17, 2014, at 5:34 AM, Jeff Law  wrote:

> On 07/13/14 22:17, Maxim Kuvyrkov wrote:
>> Hi,
>> 
>> This patch adds dump printouts for scheduling heuristics in
>> rank_for_schedule.  Rank_for_schedule is one of the cornerstones of
>> haifa scheduler, yet its decisions are hard to track and debug.
>> 
>> This patch adds statistical gathering for each branch of
>> rank_for_schedule, and prints them out according to sched verbosity.
>> This patch helped me track down several bugs in rank_for_schedule
>> that result is stupid scheduling decisions.
>> 
>> Bootstrapped and tested on x86_64-linux-gnu.
>> 
>> OK to apply?
> Presmably you use the
> 
> return increment, retval;
> 
> construct to avoid the need for braces?
> 
> I can see how it's useful here, but I don't think we've generally used comma 
> operators like that and it's a style that I've never liked all that much.
> 
> Could you go ahead and split it into two statements and add the necessary 
> braces? Approved with that change.

Code in rank_for_schedule is difficult to understand already, so I want to keep 
amount of "extra" code to a minimum.  How about for following instead: "return 
rfs_result (RFS_xxx, )" ?

Updated patch attached (the rest of the patch is unchanged).

--
Maxim Kuvyrkov
www.linaro.org



0001-Add-statistical-printout-of-rank_for_schedule-decisi.patch
Description: Binary data



Re: [PATCH] Add statistical printout of rank_for_schedule decisions

2014-08-05 Thread Jeff Law

On 08/03/14 22:51, Maxim Kuvyrkov wrote:

On Jul 17, 2014, at 5:34 AM, Jeff Law  wrote:


On 07/13/14 22:17, Maxim Kuvyrkov wrote:

Hi,

This patch adds dump printouts for scheduling heuristics in
rank_for_schedule.  Rank_for_schedule is one of the cornerstones of
haifa scheduler, yet its decisions are hard to track and debug.

This patch adds statistical gathering for each branch of
rank_for_schedule, and prints them out according to sched verbosity.
This patch helped me track down several bugs in rank_for_schedule
that result is stupid scheduling decisions.

Bootstrapped and tested on x86_64-linux-gnu.

OK to apply?

Presmably you use the

return increment, retval;

construct to avoid the need for braces?

I can see how it's useful here, but I don't think we've generally used comma 
operators like that and it's a style that I've never liked all that much.

Could you go ahead and split it into two statements and add the necessary 
braces? Approved with that change.


Code in rank_for_schedule is difficult to understand already, so I want to keep amount of 
"extra" code to a minimum.  How about for following instead: "return rfs_result (RFS_xxx, 
)" ?

Updated patch attached (the rest of the patch is unchanged).

Yea, that seems reasonable.  Good for the trunk.

Thanks,
Jeff