Olaf Hering
2011-May-18 09:32 UTC
[Xen-devel] [PATCH] xenalyze: fix compile errors with gcc 4.6
# HG changeset patch # User Olaf Hering <olaf@aepfle.de> # Date 1305710661 -7200 # Node ID 54ed57e6304736d566f84d5274e4076fbe9b1429 # Parent df4a4a3e8a606e274209030fe64776a971d39e5f xenalyze: fix compile errors with gcc 4.6 xenalyze.c: In function ''weighted_percentile'': xenalyze.c:2019:9: error: variable ''progress'' set but not used [-Werror=unused-but-set-variable] xenalyze.c: In function ''self_weighted_percentile'': xenalyze.c:2107:9: error: variable ''progress'' set but not used [-Werror=unused-but-set-variable] xenalyze.c: In function ''interval_domain_short_summary_output'': xenalyze.c:2731:15: error: variable ''interval_cycles'' set but not used [-Werror=unused-but-set-variable] xenalyze.c: In function ''hvm_generic_dump'': xenalyze.c:4666:15: error: variable ''d'' set but not used [-Werror=unused-but-set-variable] xenalyze.c: In function ''sched_runstate_process'': xenalyze.c:6871:9: error: variable ''old_runstate'' set but not used [-Werror=unused-but-set-variable] xenalyze.c:6870:11: error: variable ''runstate_tsc'' set but not used [-Werror=unused-but-set-variable] xenalyze.c: In function ''cmd_parser'': xenalyze.c:9287:24: error: variable ''p'' set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors Signed-off-by: Olaf Hering <olaf@aepfle.de> diff -r df4a4a3e8a60 -r 54ed57e63047 xenalyze.c --- a/xenalyze.c Wed Mar 02 20:11:40 2011 +0000 +++ b/xenalyze.c Wed May 18 11:24:21 2011 +0200 @@ -2016,8 +2016,6 @@ float weighted_percentile(float * A, /* float X, t1; unsigned long long t2; - int progress; - /* Calculate total weight */ N_weight=0; @@ -2078,17 +2076,11 @@ float weighted_percentile(float * A, /* } } while (I <= J); /* Keep going until our pointers meet or pass */ - progress = 0; - /* Re-adjust L and R, based on which element we''re looking for */ - if(J_weight<K_weight) { - progress = 1; + if(J_weight<K_weight) L=I; L_weight = I_weight; - } - if(K_weight<I_weight) { - progress = 1; + if(K_weight<I_weight) R=J; R_weight = J_weight; - } } return A[L]; @@ -2104,8 +2096,6 @@ long long self_weighted_percentile(long long long X, t1; - int progress; - /* Calculate total weight */ N_weight=0; @@ -2165,17 +2155,11 @@ long long self_weighted_percentile(long } } while (I <= J); /* Keep going until our pointers meet or pass */ - progress = 0; - /* Re-adjust L and R, based on which element we''re looking for */ - if(J_weight<K_weight) { - progress = 1; + if(J_weight<K_weight) L=I; L_weight = I_weight; - } - if(K_weight<I_weight) { - progress = 1; + if(K_weight<I_weight) R=J; R_weight = J_weight; - } } return A[L]; @@ -2728,13 +2712,10 @@ void interval_domain_short_summary_outpu if(P.interval.domain.d) { struct domain_data *d; - tsc_t interval_cycles; int i; d=P.interval.domain.d; - interval_cycles = d->total_time.interval.cycles; - interval_time_output(); interval_cycle_percent_output(&d->total_time.interval); @@ -4663,7 +4644,6 @@ void hvm_generic_dump(struct record_info } *cr = (typeof(cr))ri->d; char *evt_string, evt_number[256]; - unsigned *d; int i, evt, is_64 = 0; evt = ri->event - TRC_HVM_HANDLER; @@ -4683,7 +4663,6 @@ void hvm_generic_dump(struct record_info evt_string = evt_number; } - d = ri->d; printf("%s%s %s%s [", prefix, ri->dump_header, @@ -6867,8 +6846,6 @@ void sched_runstate_process(struct pcpu_ } sevt; int perfctrs; struct last_oldstate_struct last_oldstate; - tsc_t runstate_tsc; - int old_runstate; switch(_sevt.lo) { @@ -6938,8 +6915,6 @@ void sched_runstate_process(struct pcpu_ * be reset, it will be reset below. */ last_oldstate = v->runstate.last_oldstate; v->runstate.last_oldstate.wrong = RUNSTATE_INIT; - runstate_tsc = v->runstate.tsc; - old_runstate = v->runstate.state; /* Close vmexits when the putative reason for blocking / &c stops. * This way, we don''t account cpu contention to some other overhead. */ @@ -9284,7 +9259,7 @@ error_t cmd_parser(int key, char *arg, s case OPT_TOLERANCE: { - char * inval, *p; + char * inval; opt.tolerance = (int)strtol(arg, &inval, 0); @@ -9298,8 +9273,6 @@ error_t cmd_parser(int key, char *arg, s exit(1); } - p = inval; - printf("Tolerating errors at or below %d\n", opt.tolerance); } _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
George Dunlap
2011-May-25 16:26 UTC
[Xen-devel] Re: [PATCH] xenalyze: fix compile errors with gcc 4.6
Applied, thanks. -George On Wed, 2011-05-18 at 10:32 +0100, Olaf Hering wrote:> # HG changeset patch > # User Olaf Hering <olaf@aepfle.de> > # Date 1305710661 -7200 > # Node ID 54ed57e6304736d566f84d5274e4076fbe9b1429 > # Parent df4a4a3e8a606e274209030fe64776a971d39e5f > xenalyze: fix compile errors with gcc 4.6 > > xenalyze.c: In function ''weighted_percentile'': > xenalyze.c:2019:9: error: variable ''progress'' set but not used [-Werror=unused-but-set-variable] > xenalyze.c: In function ''self_weighted_percentile'': > xenalyze.c:2107:9: error: variable ''progress'' set but not used [-Werror=unused-but-set-variable] > xenalyze.c: In function ''interval_domain_short_summary_output'': > xenalyze.c:2731:15: error: variable ''interval_cycles'' set but not used [-Werror=unused-but-set-variable] > xenalyze.c: In function ''hvm_generic_dump'': > xenalyze.c:4666:15: error: variable ''d'' set but not used [-Werror=unused-but-set-variable] > xenalyze.c: In function ''sched_runstate_process'': > xenalyze.c:6871:9: error: variable ''old_runstate'' set but not used [-Werror=unused-but-set-variable] > xenalyze.c:6870:11: error: variable ''runstate_tsc'' set but not used [-Werror=unused-but-set-variable] > xenalyze.c: In function ''cmd_parser'': > xenalyze.c:9287:24: error: variable ''p'' set but not used [-Werror=unused-but-set-variable] > cc1: all warnings being treated as errors > > Signed-off-by: Olaf Hering <olaf@aepfle.de> > > diff -r df4a4a3e8a60 -r 54ed57e63047 xenalyze.c > --- a/xenalyze.c Wed Mar 02 20:11:40 2011 +0000 > +++ b/xenalyze.c Wed May 18 11:24:21 2011 +0200 > @@ -2016,8 +2016,6 @@ float weighted_percentile(float * A, /* > float X, t1; > unsigned long long t2; > > - int progress; > - > /* Calculate total weight */ > N_weight=0; > > @@ -2078,17 +2076,11 @@ float weighted_percentile(float * A, /* > } > } while (I <= J); /* Keep going until our pointers meet or pass */ > > - progress = 0; > - > /* Re-adjust L and R, based on which element we''re looking for */ > - if(J_weight<K_weight) { > - progress = 1; > + if(J_weight<K_weight) > L=I; L_weight = I_weight; > - } > - if(K_weight<I_weight) { > - progress = 1; > + if(K_weight<I_weight) > R=J; R_weight = J_weight; > - } > } > > return A[L]; > @@ -2104,8 +2096,6 @@ long long self_weighted_percentile(long > > long long X, t1; > > - int progress; > - > /* Calculate total weight */ > N_weight=0; > > @@ -2165,17 +2155,11 @@ long long self_weighted_percentile(long > } > } while (I <= J); /* Keep going until our pointers meet or pass */ > > - progress = 0; > - > /* Re-adjust L and R, based on which element we''re looking for */ > - if(J_weight<K_weight) { > - progress = 1; > + if(J_weight<K_weight) > L=I; L_weight = I_weight; > - } > - if(K_weight<I_weight) { > - progress = 1; > + if(K_weight<I_weight) > R=J; R_weight = J_weight; > - } > } > > return A[L]; > @@ -2728,13 +2712,10 @@ void interval_domain_short_summary_outpu > > if(P.interval.domain.d) { > struct domain_data *d; > - tsc_t interval_cycles; > int i; > > d=P.interval.domain.d; > > - interval_cycles = d->total_time.interval.cycles; > - > interval_time_output(); > > interval_cycle_percent_output(&d->total_time.interval); > @@ -4663,7 +4644,6 @@ void hvm_generic_dump(struct record_info > } *cr = (typeof(cr))ri->d; > > char *evt_string, evt_number[256]; > - unsigned *d; > int i, evt, is_64 = 0; > > evt = ri->event - TRC_HVM_HANDLER; > @@ -4683,7 +4663,6 @@ void hvm_generic_dump(struct record_info > evt_string = evt_number; > } > > - d = ri->d; > printf("%s%s %s%s [", > prefix, > ri->dump_header, > @@ -6867,8 +6846,6 @@ void sched_runstate_process(struct pcpu_ > } sevt; > int perfctrs; > struct last_oldstate_struct last_oldstate; > - tsc_t runstate_tsc; > - int old_runstate; > > switch(_sevt.lo) > { > @@ -6938,8 +6915,6 @@ void sched_runstate_process(struct pcpu_ > * be reset, it will be reset below. */ > last_oldstate = v->runstate.last_oldstate; > v->runstate.last_oldstate.wrong = RUNSTATE_INIT; > - runstate_tsc = v->runstate.tsc; > - old_runstate = v->runstate.state; > > /* Close vmexits when the putative reason for blocking / &c stops. > * This way, we don''t account cpu contention to some other overhead. */ > @@ -9284,7 +9259,7 @@ error_t cmd_parser(int key, char *arg, s > > case OPT_TOLERANCE: > { > - char * inval, *p; > + char * inval; > > opt.tolerance = (int)strtol(arg, &inval, 0); > > @@ -9298,8 +9273,6 @@ error_t cmd_parser(int key, char *arg, s > exit(1); > } > > - p = inval; > - > printf("Tolerating errors at or below %d\n", > opt.tolerance); > }_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel