Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp3674703rwj; Mon, 19 Dec 2022 23:45:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXsclRmsK5J/YkhXE3YoCNvd3Cb4xAo0BJ/uFHDpoFBarv4GrbPEDHlU0Oj27Eh5jzgmzDPF X-Received: by 2002:a17:90b:203:b0:218:d638:1628 with SMTP id fy3-20020a17090b020300b00218d6381628mr14173295pjb.42.1671522335081; Mon, 19 Dec 2022 23:45:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671522335; cv=none; d=google.com; s=arc-20160816; b=abN6Ed2GzMz1JWaq0xsYthhlO447bRsDHuXV6yvcQmqV98+rZBgAbJxf7W6kk/2YmF 9+L6VbX6MYjU74brnm1aqjEIYxKoIMYAnqGVr47OcAru6AGLHidIQHG0FIVw8sfV329t lgMpmNAzxQan226JVR2JqNLtJnZfkQf3KfkAsWXKWAZpb62KhmlzQ1Fxl7TkYe+yKUuq IZz+oSQ+63oHHeBw1hayZBS8mZN1D7Zjjg79ZuL/bF5YXmACXRTboOjNPVVI62Uv1lc6 Ec2ixAZnIDu4nLtG9DY34UIaNr2F2hFlT+oipht9c3vxxw3llkZ6e2d5vd6/p8xxN9zu i0yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=ZPLLUctsSIeMKBALKh+bvyxYhH1arSEVYf1EIwBzq9Q=; b=YnbXrQUasq1NDFzk3lYL6GyK7l6a7zUFJPKikbA9Wn8wYaFeXWzKVRANfUqrH9CWM8 QxBvB9qqYNOYxlBZ5utI6LKrJiHXT4eZBFOAIGBKPLSeO58nwWf/Cs8IwixjbeEWX/oW LsrrEoHFiU5XbD0CUZ9FguyN1YyttcxCXQsjh6dMEIWRcs8tEv35sd4ZNGRspNWkGNtE Ap0F97/VMQEg7sZvjXMw2fU7kLm1xtXmjp17ukZpObD6wgK0FjlgsCbfU6uWMWli0IcO h8TAHO2Mht9kB761V31UcGQHeUo5zuf/GkNEB1Q0Nj/b95glQwMcheeCk7nbEIjxcKr5 g8pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="MZIWh/zk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y187-20020a6364c4000000b004609faa2dbesi56714pgb.285.2022.12.19.23.45.26; Mon, 19 Dec 2022 23:45:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="MZIWh/zk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233529AbiLTHfv (ORCPT + 71 others); Tue, 20 Dec 2022 02:35:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233208AbiLTHfs (ORCPT ); Tue, 20 Dec 2022 02:35:48 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84F10113A; Mon, 19 Dec 2022 23:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671521747; x=1703057747; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=Io5/0LTamGxAQ1GAoe77xZCJBzvj1G4adgYcSaVbOu4=; b=MZIWh/zk1DpcFjoSc85L3NJlUe7huV6wGF4Czpthd/Jdp/jIi/XeQygR lF+1t+VbRjFESurCe3BTWGqLw9VHCtrkfJLL5oGDBSpXGInq0r6zdm+xP NE6u/nYnLVAfticGfIXqoKiS4jPwAqePlowLxf7oSGNepodJOaREppsHO Sv/nNQ3/jY8kJY+TKvqBjj6Rf5jknL02lmEDDvmsgwgZbtwdI+bYrwCm5 hLxrum+3x/qmVmwln6joibLKNb/62AFeDDTykNTa75MH1I0OCTMfWjLVC xMbgJhfD+M5L583RF91qdXGVTsvLSxrs+giEp/9tglIKfoQlAPDZzZ0uG Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10566"; a="299892100" X-IronPort-AV: E=Sophos;i="5.96,258,1665471600"; d="scan'208";a="299892100" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 23:35:46 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10566"; a="628626396" X-IronPort-AV: E=Sophos;i="5.96,258,1665471600"; d="scan'208";a="628626396" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.45.157]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 23:35:39 -0800 Message-ID: Date: Tue, 20 Dec 2022 09:35:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.6.0 Subject: Re: [PATCH 1/3] perf tools: Set debug_peo_args and redirect_to_stderr to correct values in perf_quiet_option Content-Language: en-US To: Yang Jihong , peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, carsten.haitzler@arm.com, leo.yan@linaro.org, ravi.bangoria@amd.com, martin.lau@kernel.org, ak@linux.intel.com, masami.hiramatsu.pt@hitachi.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221220035702.188413-1-yangjihong1@huawei.com> <20221220035702.188413-2-yangjihong1@huawei.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20221220035702.188413-2-yangjihong1@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/12/22 05:57, Yang Jihong wrote: > When perf uses quiet mode, perf_quiet_option sets debug_peo_args to -1, > and display_attr incorrectly determines the value of debug_peo_args. > As a result, unexpected information is displayed. > > Before: > # perf record --quiet -- ls > /dev/null > ------------------------------------------------------------ > perf_event_attr: > size 128 > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|PERIOD > read_format ID|LOST > disabled 1 > inherit 1 > mmap 1 > comm 1 > freq 1 > enable_on_exec 1 > task 1 > precise_ip 3 > sample_id_all 1 > exclude_guest 1 > mmap2 1 > comm_exec 1 > ksymbol 1 > bpf_event 1 > ------------------------------------------------------------ > ... > > After: > # perf record --quiet -- ls > /dev/null > # > > redirect_to_stderr is a similar problem. > > Fixes: f78eaef0e049 ("perf tools: Allow to force redirect pr_debug to stderr.") > Fixes: ccd26741f5e6 ("perf tool: Provide an option to print perf_event_open args and return value") > Suggested-by: Adrian Hunter > Signed-off-by: Yang Jihong Reviewed-by: Adrian Hunter > --- > tools/perf/util/debug.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c > index 65e6c22f38e4..190e818a0717 100644 > --- a/tools/perf/util/debug.c > +++ b/tools/perf/util/debug.c > @@ -241,6 +241,10 @@ int perf_quiet_option(void) > opt++; > } > > + /* For debug variables that are used as bool types, set to 0. */ > + redirect_to_stderr = 0; > + debug_peo_args = 0; > + > return 0; > } >