From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935565AbdIYNC6 (ORCPT ); Mon, 25 Sep 2017 09:02:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40320 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933851AbdIYNC4 (ORCPT ); Mon, 25 Sep 2017 09:02:56 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 504FD15F4C Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Mon, 25 Sep 2017 15:02:51 +0200 From: Jiri Olsa To: Mengting Zhang Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, yao.jin@linux.intel.com, ak@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, kjlx@templeofstupid.com, milian.wolff@kdab.com, wangnan0@huawei.com, huawei.libin@huawei.com Subject: Re: [PATCH v2] perf report: Fix debug messages with --call-graph option Message-ID: <20170925130251.GA20935@krava> References: <1506154694-39691-1-git-send-email-zhangmengting@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1506154694-39691-1-git-send-email-zhangmengting@huawei.com> User-Agent: Mutt/1.9.0 (2017-09-02) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 25 Sep 2017 13:02:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 23, 2017 at 04:18:14PM +0800, Mengting Zhang wrote: > With --call-graph option, perf report can display call chains using > type, min percent threshold, optional print limit and order. And the > default call-graph parameter is 'graph,0.5,caller,function,percent'. > > Before this patch, 'perf report --call-graph' shows incorrect debug > messages as below: > [root@localhost perf]# ./perf report --call-graph > Invalid callchain mode: 0.5 > Invalid callchain order: 0.5 > Invalid callchain sort key: 0.5 > Invalid callchain config key: 0.5 > Invalid callchain mode: caller > Invalid callchain mode: function > Invalid callchain order: function > Invalid callchain mode: percent > Invalid callchain order: percent > Invalid callchain sort key: percent > > That is because in function __parse_callchain_report_opt(),each field > of the call-graph parameter is passed to parse_callchain_{mode,order, > sort_key,value} in turn until it meets the matching value. > > For example, the order field "caller" is passed to parse_callchain_mode() > firstly and obviously it doesn't match any mode field. Therefore > parse_callchain_mode() will shows the debug message "Invalid callchain > mode: caller", which could confuse users. > > The patch fixes this issue by moving the warning out of the function > parse_callchain_{mode,order,sort_key,value}. > > Signed-off-by: Mengting Zhang Acked-by: Jiri Olsa thanks, jirka