Received: by 10.223.185.116 with SMTP id b49csp3798157wrg; Mon, 19 Feb 2018 06:14:04 -0800 (PST) X-Google-Smtp-Source: AH8x226KvL9wFp4TQrnfSQKEUYHVUGQNkwsiSZq4WM8jnZgLeZ+NzupYJpnFffe2KgOuAEldcoIS X-Received: by 10.99.113.94 with SMTP id b30mr12441213pgn.228.1519049644321; Mon, 19 Feb 2018 06:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519049644; cv=none; d=google.com; s=arc-20160816; b=zGLqrYZJU2rSO8zaOBr+eiR4ynYsN2M/Jgtv7a6qHiQSHx+5XSvYBBLUixX0JysP83 PeNcqYvvzwkYUTb/GGtiblszsEyO8Y8JXnX1CYeI7fiNUAInOLVzqvaVoFZxEydrGcRs 0rmns9+yNRbdJYl/ae/UTLjiS9/x30/poWg3BBaltCW/y120hkXX6bLkLEl79cdB77zF zc7duvwaACkHRT8wMgE+RkycxZpndzl+H1o901lGKARGXSC7BxYLrgE2MbAXYnCdEgGN Qm++LO6pdpC8y+kUE3byzJ5AAMp88kSUGF1BlTaHy/gljk6oZyrNSdeEdT0s8IGlreNb f1FQ== 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:dmarc-filter:arc-authentication-results; bh=P+ISWtUmQsFt4DU9mK3Hcn1idrdBa2z3KweYSbfFfkk=; b=BzG9EcOUNatm/P5rv2Y6D0V+8lRuOoLm02pGzk3hQkqOKx3PWubdikezZWSa43NSry qANmWxy2UQjuRj6zl0HKeZd3hB0rxkQ+Yy+hVCJ16/hvbGXrnW+tMJS8jMxfGylZKA+L i9jJlgkubrECkXnAgS5VLruwQozBUUXr36uViO1Q1/HoxFFCjw8etgkat9+yXZ8x7B8R ddnIPwvizx6zz8GRulwDpEUOtoOmenOtIb6Ak5diyWHatT6tnFMwgOp+lamxqPRsmXuW 3aIoCKQmv5QsM5OvJqVKyeJed+PZbm6IB0XoE+vQe7sGBK6igAZW9CGYI2quBoC9wARj TdBA== 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 l18si29553pfi.300.2018.02.19.06.13.48; Mon, 19 Feb 2018 06:14:04 -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 S1751515AbeBSONE (ORCPT + 99 others); Mon, 19 Feb 2018 09:13:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:45466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750978AbeBSOND (ORCPT ); Mon, 19 Feb 2018 09:13:03 -0500 Received: from jouet.infradead.org (unknown [190.15.121.82]) (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 74E9A2075D; Mon, 19 Feb 2018 14:13:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74E9A2075D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Received: by jouet.infradead.org (Postfix, from userid 1000) id 6FF831450E3; Mon, 19 Feb 2018 11:13:00 -0300 (-03) Date: Mon, 19 Feb 2018 11:13:00 -0300 From: Arnaldo Carvalho de Melo To: changbin.du@intel.com Cc: jolsa@redhat.com, peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH v4] perf ftrace: Append an EOL when write tracing files Message-ID: <20180219141300.GE14978@kernel.org> References: <1519007609-14551-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: <1519007609-14551-1-git-send-email-changbin.du@intel.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Feb 19, 2018 at 10:33:29AM +0800, changbin.du@intel.com escreveu: > From: Changbin Du > > Before this change, the '--graph-funcs', '--nograph-funcs' and > '--trace-funcs' options didn't work as expected when the doesn't > exist. Because the kernel side hid possible errors. > > $ sudo ./perf ftrace -a --graph-depth 1 --graph-funcs abcdefg > 0) 0.140 us | rcu_all_qs(); > 3) 0.304 us | mutex_unlock(); > 0) 0.153 us | find_vma(); > 3) 0.088 us | __fsnotify_parent(); > 0) 6.145 us | handle_mm_fault(); > 3) 0.089 us | fsnotify(); > 3) 0.161 us | __sb_end_write(); > 3) 0.710 us | SyS_close(); > 3) 7.848 us | exit_to_usermode_loop(); > > On above example, I specified function filter 'abcdefg' but all functions > are enabled. The expected error is hidden. > > The original fix is to make the kernel support '\0' as end of string: > https://lkml.org/lkml/2018/1/16/116 > > But above fix cannot be compatible with old kernels. Then Namhyung Kim > suggest adding a space after function name. > > This patch will append an '\n' when write tracing file. After this fix, > the perf will report correct error state. Also let it print an error if > reset_tracing_files() fails. Ok, now it prints: [root@jouet ~]# perf ftrace -a --graph-depth 1 --graph-funcs abcdefg failed to set tracing filters [root@jouet ~]# which is too vague, i.e. the user is left without knowing what was it that didn't work in setting the filter. It would be better to have: [root@jouet ~]# perf ftrace -a --graph-depth 1 --graph-funcs abcdefg failed to set tracing filters: function 'abcdefg' not found. [root@jouet ~]# Anyway, this improves the current situation, so I'm applying it. - Arnaldo