From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755304AbcFQQur (ORCPT ); Fri, 17 Jun 2016 12:50:47 -0400 Received: from smtprelay0137.hostedemail.com ([216.40.44.137]:51946 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752316AbcFQQuq (ORCPT ); Fri, 17 Jun 2016 12:50:46 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::,RULES_HIT:41:355:379:541:599:800:960:966:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2525:2553:2560:2563:2682:2685:2693:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4385:5007:6261:7875:7903:9025:10004:10400:10848:10967:11026:11232:11658:11914:12043:12517:12519:12555:12698:12737:12740:13069:13311:13357:13439:14181:14659:14721:21080:30054: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:4,LUA_SUMMARY:none X-HE-Tag: river62_237f4e4e8412f X-Filterd-Recvd-Size: 2481 Date: Fri, 17 Jun 2016 12:50:42 -0400 From: Steven Rostedt To: Jeremy Linton Cc: linux-kernel@vger.kernel.org, acme@redhat.com, namhyung@kernel.org, kapileshwar.singh@arm.com, scottwood@freescale.com, hekuang@huawei.com Subject: Re: [RFC/PATCH] perf: Add sizeof operator support Message-ID: <20160617125042.24c554a7@gandalf.local.home> In-Reply-To: <57642608.9070504@arm.com> References: <1465922312-30064-1-git-send-email-jeremy.linton@arm.com> <20160617121736.023f009f@gandalf.local.home> <57642608.9070504@arm.com> 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 Fri, 17 Jun 2016 11:32:08 -0500 Jeremy Linton wrote: > >> + > >> + if (strcmp(token, "__u64") == 0) { > >> + if (asprintf(&arg->atom.atom, "%zd", sizeof(__u64)) < 0) > >> + goto out_free_atom; > >> + } else if (strcmp(token, "__u32") == 0) { > >> + if (asprintf(&arg->atom.atom, "%zd", sizeof(__u32)) < 0) > >> + goto out_free_atom; > > > > What events are doing sizeof(__u64) and sizeof(__u32)? > > > > First, that's useless, as sizeof(__u64) will always be 8, and > > sizeof(__u32) will always be 4. > > > > What exactly is this fixing? > > It starts to fix things like: > > kmem:mm_page_alloc > Warning: [kmem:mm_page_alloc] function sizeof not defined I don't see any sizeof() calls in my format files. And still, its useless to add sizeof() for __u64 and __u32 unless perhaps a type is a macro defined to that. Ah, this is arm64 (as I don't see it in x86). No the real fix is to nuke the sizeof(__u64) in the TP_printk(), it's useless because it will always be 8. -- Steve > > or: > > # perf stat -e kvm:kvm_arm_set_regset -- true > Warning: [kvm:kvm_arm_set_regset] function sizeof not defined > Warning: Error: expected type 5 but read 0 > *** Error in `perf': double free or corruption (fasttop): > 0x00000000303f5930 *** > > There is a RH bug about it (and the "~" operator, which has been fixed) > here: https://bugzilla.redhat.com/show_bug.cgi?id=1298229 > > Thanks for taking a look at this,