From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944611AbcJSSVX convert rfc822-to-8bit (ORCPT ); Wed, 19 Oct 2016 14:21:23 -0400 Received: from smtprelay0233.hostedemail.com ([216.40.44.233]:44681 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S943585AbcJSSVV (ORCPT ); Wed, 19 Oct 2016 14:21:21 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:152:355:379:541:599:800:960:967:973:982:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1431:1437:1513:1515:1516:1518:1521:1535:1544:1593:1594:1605:1711:1730:1747:1777:1792:1981:2194:2198:2199:2200:2393:2525:2553:2560:2563:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3355:3622:3865:3867:3868:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:6119:6261:7875:7903:9025:9388:10004:10848:10881:10967:11026:11232:11473:11651:11658:11914:12043:12296:12438:12555:12683:12740:12986:13161:13229:14180:14181:14659:14721:21060:21080:21094:21222:21323:21451:30054:30075: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: wax36_28b38f1334b51 X-Filterd-Recvd-Size: 5907 Date: Wed, 19 Oct 2016 14:21:18 -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: <20161019142118.72c5c6cb@gandalf.local.home> In-Reply-To: <20161019174845.GE25522@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> 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=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Oct 2016 14:48:45 -0300 Arnaldo Carvalho de Melo wrote: > 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... > > [acme@jouet linux]$ gcc -v > Using built-in specs. > COLLECT_GCC=gcc > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/6.2.1/lto-wrapper > Target: x86_64-redhat-linux > Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux > Thread model: posix > gcc version 6.2.1 20160916 (Red Hat 6.2.1-2) (GCC) > [acme@jouet linux]$ > > LD /tmp/build/perf/plugin_mac80211-in.o > kbuffer-parse.c: In function ‘__old_next_event’: > kbuffer-parse.c:339:27: warning: ‘length’ may be used uninitialized in this function [-Wmaybe-uninitialized] > kbuf->next = kbuf->index + length; > ~~~~~~~~~~~~^~~~~~~~ > kbuffer-parse.c:297:15: note: ‘length’ was declared here > unsigned int length; > ^~~~~~ Actually, that may be a bug. > CC /tmp/build/perf/plugin_sched_switch.o > CC /tmp/build/perf/run-command.o > event-parse.c: In function ‘pevent_find_event_by_name’: > event-parse.c:3513:21: warning: ‘event’ may be used uninitialized in this function [-Wmaybe-uninitialized] > pevent->last_event = event; > ~~~~~~~~~~~~~~~~~~~^~~~~~~ > CC /tmp/build/perf/sigchain.o > LD /tmp/build/perf/plugin_sched_switch-in.o > CC /tmp/build/perf/plugin_function.o > event-parse.c: In function ‘pevent_data_lat_fmt’: > event-parse.c:5156:4: warning: ‘migrate_disable’ may be used uninitialized in this function [-Wmaybe-uninitialized] > trace_seq_printf(s, "%d", migrate_disable); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > event-parse.c:5163:4: warning: ‘lock_depth’ may be used uninitialized in this function [-Wmaybe-uninitialized] > trace_seq_printf(s, "%d", lock_depth); These two don't look like bugs because they need to have both migrate_disable_exists and lock_depth_exists to be set, and when they are those variables are. Funny it only complains about the one in the trace_seq_printf() and not the compare before them. ie. if (migrate_disable < 0) which is checked before calling the trace_seq_printf(). > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > plugin_function.c: In function ‘function_handler’: > plugin_function.c:133:6: warning: ‘index’ may be used uninitialized in this function [-Wmaybe-uninitialized] > int index; > ^~~~~ Ah, this is a bug too. > CC /tmp/build/perf/subcmd-config.o > GEN perf-archive > LD /tmp/build/perf/plugin_function-in.o > GEN perf-with-kcore > CC /tmp/build/perf/plugin_xen.o > event-parse.c: In function ‘pevent_event_info’: > event-parse.c:5003:7: warning: ‘len_arg’ may be used uninitialized in this function [-Wmaybe-uninitialized] > trace_seq_printf(s, format, len_arg, (char)val); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > event-parse.c:4846:6: note: ‘len_arg’ was declared here > int len_arg; Again, the "len_as_arg" needs to be set for this to be an issue. We could just initialize len_arg to zero to shut gcc up. -- Steve > ^~~~~~~ > MKDIR /tmp/build/perf/util/