Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp14326665rwd; Sat, 24 Jun 2023 17:26:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7oVtlsn9g8Ndgubhbvt9+xu2G8S5l3M0nz4HACrBBY7GZw3rUeXYeOMoEbpnKllIKjWbP1 X-Received: by 2002:a05:6a00:14c1:b0:668:8493:2552 with SMTP id w1-20020a056a0014c100b0066884932552mr22598558pfu.18.1687652805164; Sat, 24 Jun 2023 17:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687652805; cv=none; d=google.com; s=arc-20160816; b=aDbMqZ2LZz1bfHLTYn4o+n5C1Vgq79QIZC99vsftMlYQJmIDttmipq13KG6OYZjaDb IcNiCMCHHUj1EEGSuHwl31gCDqHGSNlNq2qtm3jyfMXmsMzz0ahvbXi3i6gqMJUO5n/p Ze+wqGArxbFLGvApYdfWvRbP9IG0amxq8fAfHCUQLDp2WGeeudCzokPHEw6GuvPAMOqz x9nJ0mWCyqeZ66QYvXd4qvlnbW/j8kP9NMEqFT2MA+9OcReeGCbLzTUYgfB0h6lSyray rjYW9ewQn41fVS44QcNHaqr8Wb2G67Dbfsbn6pkJ5rg3TftNBbNLy4rjux6QMBxRDZIQ 29UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=RHkcvLoSdetHrtyfBw7I/L7KccOBPWWWlE3itOfd6VQ=; fh=fWSF/0HYUSe+9cU4VTo4aXSapxQ+UXFln+ftmWJB1cI=; b=A8ZvfDb8XPISHpWInv43p4cjvgsQ3YrGhfF2DHLZi9bLBmxZdA11nvyAKG/4yeIXIM l7JPzHWNhOoi1Oru5Y6CsADuqROV9Wlv8RrJOn4OwZmoauehmZWMKJFhq3WZ2jYv336b gQE74wxLpThmFxcBHznwUHcl8QjT/okAvl3QA9F5K5XLtM480ksJYR7Jy5dqvcaZhuf5 7+JKHA8EZKlGyyMWJze4DcOSEzmFY/8BCuot9LX99jepq6izGLQk0RmcjPDeefhRvWdM XbAm99Q7QR34/4ecxQmbAefJFExtPWKCPo4oeBtAMj86NWutTKmhE+5k0Dzw5j6Q78G9 hNVg== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y37-20020a056a001ca500b00675262821cdsi14635pfw.113.2023.06.24.17.26.33; Sat, 24 Jun 2023 17:26:45 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230154AbjFXXis convert rfc822-to-8bit (ORCPT + 99 others); Sat, 24 Jun 2023 19:38:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbjFXXir (ORCPT ); Sat, 24 Jun 2023 19:38:47 -0400 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E39C510F4; Sat, 24 Jun 2023 16:38:45 -0700 (PDT) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-77e3267477cso93915639f.2; Sat, 24 Jun 2023 16:38:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687649925; x=1690241925; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kclJXC+Bq2uT41Q+wyyqTLX4Fp+GEJKwJIlMwNfsZ9Q=; b=deBRVpa/xMK3YdiaRg7X5oJvJL55GdHDRBev0AEQ0n+BKnpseJ1vwZ/bQIUG6EAy+d tbN6olzIyAlKmwiws5wpcYbTUaCKIITPaHB/z1mtSmU+Nq6HhEo/wvwRCJ/vw8FecXIu vdWPxL1YUKykX5KCmVIswHxLE4k7bC0iulaSimUD6Plnnvq/ckhXGiOF8Bzs+2EGsDom p6ejBK5apllm50ejLeWXzc7AHa19fzY+JRIkPM6peEKzbuvCpS3zK7GwqOmAtsAmD7TZ IvousUBHcQjAwCcU5hWCyX5dcO+zMs560i6qLuBZsNHg6vDqDvnJhYT2r9e2qnYyQ2ms Wsqg== X-Gm-Message-State: AC+VfDyvE/Z7p7J+C7Tw2hOEKtj5WDSWgBfUXUMF3VDVm80wsf516e/7 ih1FY+mV/h2OCTpnesVSSVZeWBGWCohfB0sncLY= X-Received: by 2002:a5e:8909:0:b0:776:f6d7:f5b6 with SMTP id k9-20020a5e8909000000b00776f6d7f5b6mr22891794ioj.9.1687649925049; Sat, 24 Jun 2023 16:38:45 -0700 (PDT) MIME-Version: 1.0 References: <20230623054416.160858-1-yangjihong1@huawei.com> In-Reply-To: <20230623054416.160858-1-yangjihong1@huawei.com> From: Namhyung Kim Date: Sat, 24 Jun 2023 16:38:32 -0700 Message-ID: Subject: Re: [PATCH v5 0/4] perf tools: Add printing perf_event_attr `config` and `id` symbol in perf_event_attr__fprintf() To: Yang Jihong Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, anshuman.khandual@arm.com, jesussanp@google.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, 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 On Thu, Jun 22, 2023 at 10:46 PM 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,mem:0x0 -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 = 5 > ------------------------------------------------------------ > 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 = 6 > ------------------------------------------------------------ > perf_event_attr: > type 2 > size 136 > config 0x143 > { 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 = 7 > ------------------------------------------------------------ > 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 = 9 > ------------------------------------------------------------ > 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 = 10 > ------------------------------------------------------------ > perf_event_attr: > type 5 > size 136 > { sample_period, sample_freq } 1 > sample_type IP|TID|TIME|CPU|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > sample_id_all 1 > exclude_guest 1 > bp_type 3 > { bp_len, config2 } 0x4 > ------------------------------------------------------------ > > > After: > > # perf --debug verbose=2 record -e cycles,cpu-clock,sched:sched_switch,branch-load-misses,r101,mem:0x0 -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 = 5 > ------------------------------------------------------------ > 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 = 6 > ------------------------------------------------------------ > perf_event_attr: > type 2 (PERF_TYPE_TRACEPOINT) > size 136 > config 0x143 (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 = 7 > ------------------------------------------------------------ > 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 = 9 > ------------------------------------------------------------ > 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 = 10 > ------------------------------------------------------------ > perf_event_attr: > type 5 (PERF_TYPE_BREAKPOINT) > size 136 > config 0 > { sample_period, sample_freq } 1 > sample_type IP|TID|TIME|CPU|IDENTIFIER > read_format ID > disabled 1 > inherit 1 > sample_id_all 1 > exclude_guest 1 > bp_type 3 > { bp_len, config2 } 0x4 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 11 > ------------------------------------------------------------ > perf_event_attr: > type 1 (PERF_TYPE_SOFTWARE) > size 136 > config 0x9 (PERF_COUNT_SW_DUMMY) > { sample_period, sample_freq } 4000 > sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER > read_format ID > inherit 1 > mmap 1 > comm 1 > freq 1 > task 1 > sample_id_all 1 > mmap2 1 > comm_exec 1 > ksymbol 1 > bpf_event 1 > ------------------------------------------------------------ > sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 12 > > > 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() Applied to perf-tools-next after fixing 4/4, thanks!