Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3955915ybi; Mon, 15 Jul 2019 01:31:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDfCCerlAgqzar37EB4eSlKUNvL2Q73x0FzTKlMlZY+XMqVhGf4mJwKCBpdSX382uTwCH0 X-Received: by 2002:a17:90a:cb01:: with SMTP id z1mr27656444pjt.93.1563179464025; Mon, 15 Jul 2019 01:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563179464; cv=none; d=google.com; s=arc-20160816; b=vfsF4knc4kCge1/7smmAGSsUz7i1mBINopDbWvEeTHtsaQh5TobtQcNbPBmE408UpQ hmJ7ToZPACHNEgbE7aRzyA0MMeE0KfwyNpuVmpa7CWDlFobf0XEjY0iWGomPo9JIiOFj FHEgjHhLB7DggiFMdzuCQo1aKd2zJ3fEeGBc9BC/lvq34PeqdpcsMgxN0RvG6dh3kc2x 2yMQ18S3q/0/dxlxJ7w6PKNKf+bMQHbV7x76SkilaL8t+30//s8vV38qLED2u4IfUQcb wAyHwIR0Pz02SFKXD4es9DhXmhGiv6DhDdlLJSUBHPiLRs98p61N0XmwM5i9h2n5E/MF kJtA== 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=3twPbslIhygl88r1LRFond0xbE+kHKvu/88u4SvPjmA=; b=SuI94PLsCIY8s844BY0LhJZ/NWFYsLBYfBKdsjHbRAYo112XiwrsdwMNGbt8VfcrZC xtLXDwvrlXt+X5hj7J1LyNKjQqVlBRIPX5gkV1Jy54JfFkKhAhSWGJ07jTsrViYkMEBZ I88Y8K2t//cFHZi8fwM1hJP0ZZWyunqv5xC1FzNQV66AX1DwsV8+6FDJ2mm3jt/ygnKa qo8JxC6XQ/VWK2zg/1QAGnd6g5KVn2n03yrywZR4F+kvPYK1aHUvyzEQJFBFpq3iZo80 GkM9Ryblhb/g7JbUIGsy/oQ08eZvkc9oukQBEuJE+IacI75IrPCiqT/Hb3XGhxHifUN3 rx7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qFsCo5Fm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q32si15561929pjc.2.2019.07.15.01.30.47; Mon, 15 Jul 2019 01:31:04 -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=pass header.i=@kernel.org header.s=default header.b=qFsCo5Fm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729428AbfGOI3h (ORCPT + 99 others); Mon, 15 Jul 2019 04:29:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:54724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726996AbfGOI3g (ORCPT ); Mon, 15 Jul 2019 04:29:36 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 94BD3214C6; Mon, 15 Jul 2019 08:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563179375; bh=ayBD0Y5sJDpKf1w1/YXOS05x9dQwEx5X2dm1cMdrgQQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qFsCo5FmFQ/XW4yNKLK+yYFUVFJ6yeqU2p5lkUuyAzYVD4ZHdej4O8rwdcWywwP99 8H2G9rLMnYjZ05Wr6oXyOlvOrbSmTaXdMverFo5ceeb8J/arfaBzcQ+EqgQttO5esB so4ncBpx/M/Wh1wVM0k00MQjs0oA8obOWWm1OJqA= Date: Mon, 15 Jul 2019 09:29:30 +0100 From: Will Deacon To: Changbin Du Cc: 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: <20190715082930.uyxn2kklgw4yri5l@willie-the-truck> References: <20190713121026.11030-1-changbin.du@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190713121026.11030-1-changbin.du@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 13, 2019 at 08:10:26PM +0800, Changbin Du wrote: > This patch adds a new trace option 'funcgraph-retval' and is disabled by > default. When this option is enabled, fgraph tracer will show the return > value of each function. This is useful to find/analyze a original error > source in a call graph. > > One limitation is that the kernel doesn't know the prototype of functions. > So fgraph assumes all functions have a retvalue of type int. You must ignore > the value of *void* function. And if the retvalue looks like an error code > then both hexadecimal and decimal number are displayed. This seems like quite a significant drawback and I think it could be pretty confusing if you have to filter out bogus return values from the trace. For example, in your snippet: > 3) | kvm_vm_ioctl() { > 3) | mutex_lock() { > 3) | _cond_resched() { > 3) 0.234 us | rcu_all_qs(); /* ret=0x80000000 */ > 3) 0.704 us | } /* ret=0x0 */ > 3) 1.226 us | } /* ret=0x0 */ > 3) 0.247 us | mutex_unlock(); /* ret=0xffff8880738ed040 */ mutex_unlock() is wrongly listed as returning something. How much of this could be achieved from userspace by placing kretprobes on non-void functions instead? Will