Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6907849rwr; Wed, 10 May 2023 00:42:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5rGSo/DhrFi4VpjRXTWytgohkK2Yq+nSAMpVYq4fRMqvlehXdiVjH4JGJnZ4VB3wfCUrIh X-Received: by 2002:a05:6a00:244e:b0:634:7ba3:d142 with SMTP id d14-20020a056a00244e00b006347ba3d142mr22648626pfj.10.1683704562908; Wed, 10 May 2023 00:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683704562; cv=none; d=google.com; s=arc-20160816; b=GQOuIlpcfK0eGPIupvlY3+RjLd9RZnMMs5u2qrGuxco2Nyi0vz0t7ngdZCJ2HAvJwR PZq6iKq1s/xuvH07DN0w0t6H/nEr8jR9JTMgeFIOTs0XVjAytZ5pfTqP0Ja+lkj/o0BR ydBdFxXCeAhwcQ3SjxrIAzFu0TC4/dPZPm3KCyQ2FAizm8W771ojWd0KBkJkQ391seuw 0qEEaYdFK2fy2jrRHq7Z4v1UsPYlDSKad0C6IkBoibTfm7BmuW40D9mo4n9TBwdKSzva l8O389TtiCn1zFyOIZrpJcckJ4y2UR0/vQ25LXQF8M03GEajbkzEKZl2k1ZJ2jHJ+gjP 0chw== 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 :to:subject; bh=Fqq8N5TakfwAuAW0wM2qITVuGT+J8DX8Ba4ZD5PEP1E=; b=rLf62HJOyn+/jgwtsOnHfjq7zm8nZoGrvuk8Dj7X0+DGY0zvpPtMah3pnUVbemdXxG Fd09CD7IPRP+hrukBOPUTW3eUYQhGMHkChiUrMaHQoaJDgkH1/13hM5BnLF83nw8s5cq 985bztBKW0i9xLZMOjTlIIWJjZd1qAoyMb+GKHU7+pKkt/nq3MMBtI5L2Ic/+jc6xAYs SrZ7tmtYQzUr7a661VmZVjIle+TbzvSN4D0/F1Yl28khq0j2lRGKrFvz7vntptbGECUT 01W+YpdtTOlChYDMQlGTcgQIYDSVDPWTNShYf+jpHuRNzdRFa8uxDiMHV50qQfdbjTnY 7rig== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h26-20020aa796da000000b0063b630df52asi4398434pfq.252.2023.05.10.00.42.29; Wed, 10 May 2023 00:42:42 -0700 (PDT) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236498AbjEJHWh (ORCPT + 99 others); Wed, 10 May 2023 03:22:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236495AbjEJHWg (ORCPT ); Wed, 10 May 2023 03:22:36 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF60C26BF; Wed, 10 May 2023 00:22:33 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QGRK96qjgzpWKT; Wed, 10 May 2023 15:21:17 +0800 (CST) 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.2507.23; Wed, 10 May 2023 15:22:30 +0800 Subject: Re: [PATCH 0/4] perf tools: Add printing perf_event_attr `config` and `id` symbol in perf_event_attr__fprintf() To: , , , , , , , , , , , , References: <20230419122912.73746-1-yangjihong1@huawei.com> From: Yang Jihong Message-ID: <4f1e2c1f-8bfc-49a7-2989-55a55057e725@huawei.com> Date: Wed, 10 May 2023 15:22:30 +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: <20230419122912.73746-1-yangjihong1@huawei.com> 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: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hello, PING. Thanks, Yang. On 2023/4/19 20:29, Yang Jihong wrote: > Add printing perf_event_attr `config` and `id` symbol to improve the readability of debugging information. > > Before: > > # perf --debug verbose=2 record -e cycles,cpu-clock,sched:sched_switch,branch-load-misses,r101 -C 0 true > > ------------------------------------------------------------ > perf_event_attr: > size 136 > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > freq 1 > sample_id_all 1 > exclude_guest 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 6 > ------------------------------------------------------------ > perf_event_attr: > type 1 > size 136 > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > freq 1 > sample_id_all 1 > exclude_guest 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 7 > ------------------------------------------------------------ > perf_event_attr: > type 2 > size 136 > config 0x131 > { sample_period, sample_freq } 1 > sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > sample_id_all 1 > exclude_guest 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 8 > ------------------------------------------------------------ > perf_event_attr: > type 3 > size 136 > config 0x10005 > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > freq 1 > sample_id_all 1 > exclude_guest 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 10 > ------------------------------------------------------------ > perf_event_attr: > type 4 > size 136 > config 0x101 > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > freq 1 > sample_id_all 1 > exclude_guest 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 11 > > > After: > > # perf --debug verbose=2 record -e cycles,cpu-clock,sched:sched_switch,branch-load-misses,r101 -C 0 true > > ------------------------------------------------------------ > perf_event_attr: > type 0 (PERF_TYPE_HARDWARE) > size 136 > config 0 (PERF_COUNT_HW_CPU_CYCLES) > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > freq 1 > sample_id_all 1 > exclude_guest 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 6 > ------------------------------------------------------------ > perf_event_attr: > type 1 (PERF_TYPE_SOFTWARE) > size 136 > config 0 (PERF_COUNT_SW_CPU_CLOCK) > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > freq 1 > sample_id_all 1 > exclude_guest 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 7 > ------------------------------------------------------------ > perf_event_attr: > type 2 (PERF_TYPE_TRACEPOINT) > size 136 > config 0x131 (sched:sched_switch) > { sample_period, sample_freq } 1 > sample_type IP|TID|TIME|CPU|PERIOD|RAW|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > sample_id_all 1 > exclude_guest 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 8 > ------------------------------------------------------------ > perf_event_attr: > type 3 (PERF_TYPE_HW_CACHE) > size 136 > config 0x10005 (PERF_COUNT_HW_CACHE_RESULT_MISS | PERF_COUNT_HW_CACHE_OP_READ | PERF_COUNT_HW_CACHE_BPU) > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > freq 1 > sample_id_all 1 > exclude_guest 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 10 > ------------------------------------------------------------ > perf_event_attr: > type 4 (PERF_TYPE_RAW) > size 136 > config 0x101 > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > freq 1 > sample_id_all 1 > exclude_guest 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 11 > > > Yang Jihong (4): > perf trace-event-info: Add tracepoint_id_to_name() helper > perf tools: Extend PRINT_ATTRf to support printing of members with a > value of 0 > perf tools: Add printing perf_event_attr->type symbol in > perf_event_attr__fprintf() > perf tools: Add printing perf_event_attr->config symbol in > perf_event_attr__fprintf() > > tools/perf/util/perf_event_attr_fprintf.c | 169 ++++++++++++++++++++-- > tools/perf/util/trace-event-info.c | 13 ++ > tools/perf/util/trace-event.h | 6 + > 3 files changed, 179 insertions(+), 9 deletions(-) >