Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2195881pxb; Fri, 25 Mar 2022 12:49:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiY3s7Ek/qsBeB32Fyf2i5dxH/MjwL4UxjH9wkHhdFP3V4+LSga20jt0SKqDO7+RYJh4jf X-Received: by 2002:a05:6a00:438b:b0:4fa:a67c:7ca0 with SMTP id bt11-20020a056a00438b00b004faa67c7ca0mr11686328pfb.5.1648237794947; Fri, 25 Mar 2022 12:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648237794; cv=none; d=google.com; s=arc-20160816; b=vraqge+DVm0dKSfo7BesHbKxzH5arRLjjlbySYy/ucJjRn1yNYUP6Jl/wznx5PrDKj 6HHDNRfsRIswVKcg1quB1P5VpIClkBgbwi9tA42Ff5XyV8bKcmLhZfJCeoPl2vY31RAS 6jw/HwgpJoEi49zy50xESeeoKF4qM4ykR4Fe9lA8VYUI0fWQ45ycYn0OaqOkc5Q5YCZn WV1F3J0A4xuQOTHQAhEpUsE4a+85XlBvSpq7YYtZl3F++moAjJmP6BWojpDu94umKe/p ybkCLTM590z7VtUZ8a4FXp3bCGg5SrN+p2vKBdzcqPn9AccSRegxgxebfmsAwry+KW1L iKrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=C9tbv66W2OtYilQv3LgUoRg/P0U5ePo0BYQDkRAsMF0=; b=ribDLxbD36aLjPf7LE9OYBSfUR9YSwIGPpjMLcjV5T19JiJYK3r+UczY7siIJm6AoF v/s9++YFP3My41nKS4leFwsIBSbYVeM97zglqRXz6xpH+aCafMxTAvxRaZQhuprZcgGa llwoU4bm9pC4wmoWg4evl3lNnhS3uiGxUXe48+kzq2SDTWLCZMdeZ3FwjPqS9S1EI1C5 qG988sTwgavUqgjrVoSifSB1MYiC/KfltzE3cX512zuA6vWqfXJ67saPhHSw/mV1yvku v2p4o6ETgwxGtn4+KODDj3E40LcuK1GEG3OH5HIo4X5oxlunUpjIwR4nKDd0LzoVMYlZ ZruQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q5-20020a17090a2e0500b001c63f43cc82si3219933pjd.24.2022.03.25.12.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:49:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7A1792C809C; Fri, 25 Mar 2022 11:39:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238961AbiCYBoG (ORCPT + 99 others); Thu, 24 Mar 2022 21:44:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356161AbiCYBks (ORCPT ); Thu, 24 Mar 2022 21:40:48 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D565517DF; Thu, 24 Mar 2022 18:39:02 -0700 (PDT) Received: from kwepemi500021.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KPl7R4CLTzCrYt; Fri, 25 Mar 2022 09:36:51 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by kwepemi500021.china.huawei.com (7.221.188.245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 25 Mar 2022 09:39:00 +0800 Received: from [10.67.111.205] (10.67.111.205) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 25 Mar 2022 09:38:59 +0800 Subject: Re: [PATCH] perf/x86: Unify format of events sysfs show To: Peter Zijlstra CC: , , , , , , , , , , , , References: <20220324031957.135595-1-yangjihong1@huawei.com> <20220324101107.GC8939@worktop.programming.kicks-ass.net> From: Yang Jihong Message-ID: Date: Fri, 25 Mar 2022 09:38:47 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20220324101107.GC8939@worktop.programming.kicks-ass.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.111.205] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Peter, On 2022/3/24 18:11, Peter Zijlstra wrote: > On Thu, Mar 24, 2022 at 11:19:57AM +0800, Yang Jihong wrote: >> Sysfs show formats of files in /sys/devices/cpu/events/ are not unified, >> some end with "\n", and some do not. Modify sysfs show format of events >> defined by EVENT_ATTR_STR to end with "\n". > > Did you test all the userspace that consumes these fields to make sure > none of them break? I suppose it's mostly perf tool, but I'm fairly sure > there's others out there as well. > Yes, I tested "perf record" and "perf stat" commands on my machine against the modified events, and the results are as follows: $ perf stat -e topdown-fetch-bubbles,topdown-recovery-bubbles,topdown-slots-issued,topdown-slots-retired,topdown-total-slots -a sleep 1 Performance counter stats for 'system wide': 2356235 topdown-fetch-bubbles # 1211.9% frontend bound 226132 topdown-recovery-bubbles # 182.9% bad speculation 1073595 topdown-slots-issued # -1780.4% backend bound 944133 topdown-slots-retired # 485.6% retiring 194420 topdown-total-slots 0.987394388 seconds time elapsed $ perf record -e topdown-fetch-bubbles,topdown-recovery-bubbles,topdown-slots-issued,topdown-slots-retired,topdown-total-slots -a sleep 1 Lowering default frequency rate from 4000 to 3000. Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate. Couldn't synthesize bpf events. [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.300 MB perf.data (2620 samples) ] $ perf evlist topdown-fetch-bubbles topdown-recovery-bubbles topdown-slots-issued topdown-slots-retired topdown-total-slots dummy:HG . Thanks, Jihong > . >