Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp938641ybi; Tue, 16 Jul 2019 07:21:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMMFc6v8KR6iX7Tffe0hLGimzw2cgzeXUFTKJL5YasVeW0G4zT1FELe9ZdZzOVmX0F6upy X-Received: by 2002:a17:902:7887:: with SMTP id q7mr36376317pll.129.1563286868105; Tue, 16 Jul 2019 07:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563286868; cv=none; d=google.com; s=arc-20160816; b=Ou7fnLoRpFq7WzPQRUnfIwxcfY6j6gSLWUU6wTaJnSnr9Q/NbvYmZS2kaV+p0sNS0l 2Gbn/5J9gGi72npaAN1HMGBXwH7h4hTx3aRD3gYA7LRm/oi8u8/J0rkcxDyyrKR06KEZ VVdmbuo8VLr6EteT6ivwt2gIPPetF5Ri/4c+2NhTYc9onskS1pZyasxAIZJNF/DZ6zhp yHSZyqppCSkZQ4DIHVDmnZhmV74u71zWmhEPsjKBRzkPRTUU1jDOSZrwEl5YYTJUqO+q UgqGiro2N9q9khQZGGdPDYsVskaza8PnCDwghy+XtfpiSpS9OpwnWPdkNGWzSlr4oopy epyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=I2Ko8faRg+vaZDBH8bLxhIlf1q9Nq5Ly4jgTbtIqtH8=; b=Ahl8rzeBsrACkjLgH8JI4ZRRe+CjyyNLoZwWTuLV1IqLdngbs6i4qzlHZSKV2MXaYg Jghgq91t61t3WkOQLcqv9Pv/7qizsLSWzQzDA1NvMmQ2PCHkuV5qfdVRmr/OgN+knNLD kohX4aryKZek5nlKMtUMSvXFobL3nl8AnipcTURLLT+LnNR1SL0QCE8XCttuS2M5QEDA hlRFBDID13IFQYsCZz4ANUJftw0ZiiS1pvPlmlK87BMmMVOHN+Dh7rUoL0DplUom+iCb B4z1kVR5pmpa7naGCNmv5MERJHd4FEzmvt1Uz+931cPZMrvMmqB6UcUmnRxlOalTPExg T/0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=AmcKwH8L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si18159881pji.109.2019.07.16.07.20.51; Tue, 16 Jul 2019 07:21:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=AmcKwH8L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387770AbfGPOU0 (ORCPT + 99 others); Tue, 16 Jul 2019 10:20:26 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59202 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727849AbfGPOU0 (ORCPT ); Tue, 16 Jul 2019 10:20:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=I2Ko8faRg+vaZDBH8bLxhIlf1q9Nq5Ly4jgTbtIqtH8=; b=AmcKwH8L36gtAVtXSl/xDUGnR qZCDJ8uxjI4/col/5CmoaAovlizbhod7ZWtKaDLKMK3cbD01tUZQe7W9b2Sjx/5MatSnu+7NtriRT UyRX3G8paQOwwCDv94sMvC7niO201uuqWsbkN4lpcCiKRCy7CCpkwQXjpcBWd/2B2B5nS/P4AJPpp xqUzhGN2MvZnKl8o5C3E7h0Ht+HSLm1MEFUk3tMqLBV9WMmUXSvQuYLqyIMGyTmxWP6SLNprhaDDL Ejh2fLGM3tH4GS/p/ovfDcQUyDaSDeY69q2WoHoG7MIz9r7i4d0NuOFl791+WxpdSj6NRlZQchgKU 3Iv1zBAFQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hnOJL-0004b6-Bh; Tue, 16 Jul 2019 14:20:07 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BF744202167B8; Tue, 16 Jul 2019 16:20:05 +0200 (CEST) Date: Tue, 16 Jul 2019 16:20:05 +0200 From: Peter Zijlstra To: Changbin Du Cc: Will Deacon , rostedt@goodmis.org, mingo@redhat.com, corbet@lwn.net, linux@armlinux.org.uk, catalin.marinas@arm.com, tglx@linutronix.de, bp@alien8.de, hpa@zytor.com, x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] tracing/fgraph: support recording function return values Message-ID: <20190716142005.GE3402@hirez.programming.kicks-ass.net> References: <20190713121026.11030-1-changbin.du@gmail.com> <20190715082930.uyxn2kklgw4yri5l@willie-the-truck> <20190715101231.GB3419@hirez.programming.kicks-ass.net> <20190716140817.za4rad3hx76efqgp@mail.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190716140817.za4rad3hx76efqgp@mail.google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 16, 2019 at 10:08:18PM +0800, Changbin Du wrote: > On Mon, Jul 15, 2019 at 12:12:31PM +0200, Peter Zijlstra wrote: > > Alternatively, we can have recordmcount (or objtool) mark all functions > > with a return value when the build has DEBUG_INFO on. The dwarves know > > the function signature. > > > We can extend the recordmcount tool to search 'subprogram' tag in the DIE tree. > In below example, the 'DW_AT_type' is the type of function pidfd_create(). > > $ readelf -w kernel/pid.o > [...] > <1><1b914>: Abbrev Number: 232 (DW_TAG_subprogram) > <1b916> DW_AT_name : (indirect string, offset: 0x415e): pidfd_create > <1b91a> DW_AT_decl_file : 1 > <1b91b> DW_AT_decl_line : 471 > <1b91d> DW_AT_decl_column : 12 > <1b91e> DW_AT_prototyped : 1 > <1b91e> DW_AT_type : <0xcc> > <1b922> DW_AT_low_pc : 0x450 > <1b92a> DW_AT_high_pc : 0x50 > <1b932> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) > <1b934> DW_AT_GNU_all_call_sites: 1 > <1b934> DW_AT_sibling : <0x1b9d9> > [...] > > To that end, we need to introduce libdw library for recordmcount. I will have a > try this week. Right; but only when this config option is set. > And probably, we can also record the parameters? The 'fun' part is where to store all this information in the kernel and how fast you can find it while tracing.