Received: by 10.223.185.116 with SMTP id b49csp1031550wrg; Sun, 11 Feb 2018 03:01:14 -0800 (PST) X-Google-Smtp-Source: AH8x227tz41sPAMLYgdg+Xpq/KZBACtMKW4nZ4PowfQYcUZQcMfuTt//mLx7enUmGhYuMACJlneF X-Received: by 2002:a17:902:4683:: with SMTP id p3-v6mr7848931pld.408.1518346874227; Sun, 11 Feb 2018 03:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518346874; cv=none; d=google.com; s=arc-20160816; b=JX7PDpEUc/J0Kb0Q0jufQmk0D3hvht8jDUTTsVz9fvfS3CFspcc0/t+qtQRGpMMl8C YtfI3cQn3OLvOiXjL8ssQ3fDSqk9J1yJBXhZCaDaW7qpzKddwZdaIcSSfXAyWniw+X9j JVABrRE8R5XznWZwKsgMEPWW7rM7V+2EmmvI3x4ZLhabiIHyIgGu9C3HQDNa01llUC/N 59Y4ry1DjTmyXyw6W1W/NHx+AaRYxCuYCiosUPwnCF2B4B/SgP1DS7rukSRN1awBkiEa n6LfukUKNajSokMZE53BGEVVsExcLB39xarNbrTBYkYCB5TtSGqpgT9Xvso7curOy4hA tCzA== 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:arc-authentication-results; bh=g5PMx4h013y5HV8JIn+vdQ60hMxxz3xuGZkacLmqJXw=; b=pCkzhofRjbhSFdaUXGC5HS4ft8y7MBKPrzILwaahUiKep81K7zCLxUOEsF5Sgz/FY8 FHTA5y2WCTggG2rwD8lhuJH5OVa9uTmImG/om+EMWuss1Ydq4MAwaeB3bgHgW1xqV+QB NcW87VbbGh0onBjG2tVY6D7OzKDCwt0nVQmm6eOeBIh7Py4g67tQktKkKqVHYOhIbY+8 FFTG3Cror7/rHN0JMNfFIw+oJZ0yudtBemgXOOQIm6zvREGjomRmh0pRN+vEwdQTKlFe cVvz6/2aOwkQV2V5ikx709QMmejYwNc65uErmfSiiUnCO/pQcRjpJJ6n4pvqghvJOfO1 MLww== ARC-Authentication-Results: i=1; mx.google.com; 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 t10-v6si2163483plh.350.2018.02.11.03.01.00; Sun, 11 Feb 2018 03:01:14 -0800 (PST) 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; 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 S1753162AbeBKLAT (ORCPT + 99 others); Sun, 11 Feb 2018 06:00:19 -0500 Received: from mga09.intel.com ([134.134.136.24]:28766 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752922AbeBKLAS (ORCPT ); Sun, 11 Feb 2018 06:00:18 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2018 03:00:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,495,1511856000"; d="scan'208";a="19045986" Received: from gvt-dell.bj.intel.com (HELO intel.com) ([10.238.154.59]) by fmsmga002.fm.intel.com with SMTP; 11 Feb 2018 03:00:15 -0800 Date: Sun, 11 Feb 2018 18:51:36 +0800 From: "Du, Changbin" To: changbin.du@intel.com Cc: rostedt@goodmis.org, mingo@redhat.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH] tracing/fgraph: Missed irq return mark for leaf entry Message-ID: <20180211105135.6imp6wpawftfqd3f@intel.com> References: <1517413729-20411-1-git-send-email-changbin.du@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1517413729-20411-1-git-send-email-changbin.du@intel.com> User-Agent: NeoMutt/20171027-42-ad8712 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rostedt, What abount this fix? Thanks! On Wed, Jan 31, 2018 at 11:48:49PM +0800, changbin.du@intel.com wrote: > From: Changbin Du > > The fgraph forget to print irq return mark for leaf entry. Then we can see > unbalanced irq mark in the trace. This patch fix this. > > Before: > 1) | SyS_write() { > 1) | __fdget_pos() { > 1) 0.061 us | __fget_light(); > 1) 0.289 us | } > 1) | vfs_write() { > 1) 0.049 us | rw_verify_area(); > 1) + 15.424 us | __vfs_write(); > 1) ==========> | > 1) 6.003 us | smp_apic_timer_interrupt(); > 1) 0.055 us | __fsnotify_parent(); > 1) 0.073 us | fsnotify(); > 1) + 23.665 us | } > 1) + 24.501 us | } > > After: > 0) | SyS_write() { > 0) | __fdget_pos() { > 0) 0.052 us | __fget_light(); > 0) 0.328 us | } > 0) | vfs_write() { > 0) 0.057 us | rw_verify_area(); > 0) | __vfs_write() { > 0) ==========> | > 0) 8.548 us | smp_apic_timer_interrupt(); > 0) <========== | > 0) + 36.507 us | } /* __vfs_write */ > 0) 0.049 us | __fsnotify_parent(); > 0) 0.066 us | fsnotify(); > 0) + 50.064 us | } > 0) + 50.952 us | } > > Signed-off-by: Changbin Du > --- > kernel/trace/trace_functions_graph.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c > index 23c0b0c..169b3c4 100644 > --- a/kernel/trace/trace_functions_graph.c > +++ b/kernel/trace/trace_functions_graph.c > @@ -831,6 +831,7 @@ print_graph_entry_leaf(struct trace_iterator *iter, > struct ftrace_graph_ret *graph_ret; > struct ftrace_graph_ent *call; > unsigned long long duration; > + int cpu = iter->cpu; > int i; > > graph_ret = &ret_entry->ret; > @@ -839,7 +840,6 @@ print_graph_entry_leaf(struct trace_iterator *iter, > > if (data) { > struct fgraph_cpu_data *cpu_data; > - int cpu = iter->cpu; > > cpu_data = per_cpu_ptr(data->cpu_data, cpu); > > @@ -869,6 +869,9 @@ print_graph_entry_leaf(struct trace_iterator *iter, > > trace_seq_printf(s, "%ps();\n", (void *)call->func); > > + print_graph_irq(iter, graph_ret->func, TRACE_GRAPH_RET, > + cpu, iter->ent->pid, flags); > + > return trace_handle_return(s); > } > > -- > 2.7.4 > -- Thanks, Changbin Du