From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944971AbcJST0L (ORCPT ); Wed, 19 Oct 2016 15:26:11 -0400 Received: from smtprelay0140.hostedemail.com ([216.40.44.140]:51217 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933023AbcJST0K (ORCPT ); Wed, 19 Oct 2016 15:26:10 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1543:1593:1594:1605:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:3138:3139:3140:3141:3142:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:6261:6691:7875:8603:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12555:12740:12760:13439:14180:14181:14659:14721:21060:21080:21434:21451:30029:30054:30070:30083:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: plot52_17b703ad8a941 X-Filterd-Recvd-Size: 4502 Date: Wed, 19 Oct 2016 15:26:01 -0400 From: Steven Rostedt To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Honggyu Kim , linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo Subject: Re: [PATCH 1/3] tools lib traceevent: Add -O2 option to traceevent Message-ID: <20161019152601.4997c33f@gandalf.local.home> In-Reply-To: <20161019180634.GG25522@kernel.org> References: <20161017141712.11932-1-hong.gyu.kim@lge.com> <20161018020109.GA6099@danjae.aot.lge.com> <20161018112953.29e2126b@gandalf.local.home> <20161019174845.GE25522@kernel.org> <20161019180548.GF25522@kernel.org> <20161019180634.GG25522@kernel.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Oct 2016 15:06:34 -0300 Arnaldo Carvalho de Melo wrote: > Em Wed, Oct 19, 2016 at 03:05:48PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Wed, Oct 19, 2016 at 02:48:45PM -0300, Arnaldo Carvalho de Melo escreveu: > > > Em Tue, Oct 18, 2016 at 11:29:53AM -0400, Steven Rostedt escreveu: > > > > On Tue, 18 Oct 2016 11:01:09 +0900 > > > > Namhyung Kim wrote: > > > > > > > > > Hi Honggyu, > > > > > > > > > > You need to CC relevant maintainers when you send patches to LKML. > > > > > For the libtraceevent, they are Arnaldo and Steven. You can use > > > > > scripts/get_maintainer.pl for this job later. In addition running > > > > > scripts/checkpatch.pl before sending patches is a good habit. > > > > > > > > > > Arnaldo and Steve, > > > > > > > > > > This is from uftrace building libtraceevent with the optimization flag > > > > > and we want to fix the upstream as well. > > > > > > > > > > > > > Acked-by: Steven Rostedt > > > > > > So right after applying this patch I get these new warnings, investigating... > > > > Some are the compiler not grokking logic where the compiler gets > > confused with logic that tests one variable to use another and thinks it > > is using garbage (uninitialized stuff), I tried to follow the logic and > > I think it got slightly more confused than me, as I _think_ its not a > > problem, but the one on the case entry for > > > > OLD_RINGBUF_TYPE_TIME_EXTEND > > > > in old_update_pointers() looks like a bug, unless some macro magic is > > taking place that updates that 'lenght' variable. > > > > Rostedt, that -O2 unleashed some warnings, please check, I'll defer > > applying those patches till it doesn't show these warnings, i.e. till > > other patches fixing these issues or simply silencing the compiler with > > a harmless init gets submitted, > > Ah, the patch I had so far shutting off most of this is: > > > diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c > index 664c90c8e22b..449056e96fe6 100644 > --- a/tools/lib/traceevent/event-parse.c > +++ b/tools/lib/traceevent/event-parse.c > @@ -3490,7 +3490,7 @@ struct event_format * > pevent_find_event_by_name(struct pevent *pevent, > const char *sys, const char *name) > { > - struct event_format *event; > + struct event_format *event = NULL; > int i; Grumble. This is just bad gcc. I mean we have: for (i = 0; i < pevent->nr_events; i++) { event = pevent->events[i]; if (i == pevent->nr_events) event = NULL; How the hell can event be uninitialized after that? > > if (pevent->last_event && > @@ -4843,7 +4843,7 @@ static void pretty_print(struct trace_seq *s, void *data, int size, struct event > char format[32]; > int show_func; > int len_as_arg; > - int len_arg; > + int len_arg = 0; Again, silly gcc. > int len; > int ls; > > @@ -5102,8 +5102,8 @@ void pevent_data_lat_fmt(struct pevent *pevent, > static int migrate_disable_exists; > unsigned int lat_flags; > unsigned int pc; > - int lock_depth; > - int migrate_disable; > + int lock_depth = 0; > + int migrate_disable = 0; > int hardirq; > int softirq; > void *data = record->data; silly gcc. Fine, add these. -- Steve