From patchwork Sat Jul 15 03:29:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Jihong X-Patchwork-Id: 120737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2447vqt; Fri, 14 Jul 2023 20:48:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlFHC1jeFmcpZd0o9HiQKKb59hBj4R0MovonY713/MUmAE0fqAgvH3GEEt7VCQrHyD+ArhBO X-Received: by 2002:a17:907:7ba8:b0:989:21e4:6c6d with SMTP id ne40-20020a1709077ba800b0098921e46c6dmr5085550ejc.28.1689392922421; Fri, 14 Jul 2023 20:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689392922; cv=none; d=google.com; s=arc-20160816; b=L2jfnvZK9GznG/S3ycacDDFI1FxusfUgM93e9RNVIrNlK5HI37TTXK8PmPs+57tDaF NvDWjFv1KjQFswPIB4JFx1WvgeyZtqJUZ+ptQdAWRw3HA/BkWhtlsH5pxCdJIMWZ3cdP cv25c2bhz6Pmoitu+yrhigsRi3qLBWFEHqwdb6QDfzsl2bdq9z8UX7noio76vYc6jMWW Ppfsw87o5LH1NEc78Fv2CNrbisz7azOwlAYydlQkIeVLPzsEY8VsnNxyOZGt7OPnzOBT ArVc4balhXQPnphU3VjThN+85eZL2a6F9QkRJx4pP+QC2BJeG6AU+DgEeSPNLbpcm+EI Ic3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KYyF7GMwdJnmcSDi3ym4N6moo/bcg8n7UAWJpc/Ey+o=; fh=Ib1wi7jRbo+eNDLEErvWCJx+cnUm87PkGFthhdFf08Y=; b=AZBczwfI0v/rFlj3s1rV+/KTPDcqYhJf5GSoXG/PPQLHoTkfxCIx6MwnF1BOkT4Sck Nb29BprbCcMdC9qTqhwoKaH4uFtC3MupreFuNkCc6dx0aUZ+C0dVKoDgvVua8E7+azsK 43hWUIUqWMwdkjVUa+JMD3y0zfenTYLaY8zXHTGVBKOgAEGdaDg1Bu2VHGTPqEkcCTY8 U9jEeTJ0iHQnG/PipOizClxnvUPL13Bq+7IyDZU8227IZyMTgTZLTRUU24NGwRdSZ3el gAxV1fOdq6UODX92elD+xNeWYU1JdYqsts1FzR5YFZx6yccBEGxluYSZbQFOMlNg6987 HQkg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz10-20020a170906f2ca00b009886b606a71si9767336ejb.696.2023.07.14.20.48.19; Fri, 14 Jul 2023 20:48: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 S230146AbjGODbq (ORCPT + 99 others); Fri, 14 Jul 2023 23:31:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbjGODbh (ORCPT ); Fri, 14 Jul 2023 23:31:37 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EB753A97; Fri, 14 Jul 2023 20:31:36 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R2v1q5TclzNm9v; Sat, 15 Jul 2023 11:28:15 +0800 (CST) Received: from localhost.localdomain (10.67.174.95) 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.27; Sat, 15 Jul 2023 11:31:33 +0800 From: Yang Jihong To: , , , , , , , , , , , , , , , CC: Subject: [PATCH v2 5/7] perf evlist: Skip dummy event sample_type check for evlist_config Date: Sat, 15 Jul 2023 03:29:13 +0000 Message-ID: <20230715032915.97146-6-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT In-Reply-To: <20230715032915.97146-1-yangjihong1@huawei.com> References: <20230715032915.97146-1-yangjihong1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.174.95] 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771456873196304336 X-GMAIL-MSGID: 1771456873196304336 The dummp event does not contain sampls data. Therefore, sample_type does not need to be checked. Currently, the sample id format of the actual sampling event may be changed after the dummy event is added. Signed-off-by: Yang Jihong --- tools/perf/util/record.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index 9eb5c6a08999..0240be3b340f 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c @@ -128,6 +128,13 @@ void evlist__config(struct evlist *evlist, struct record_opts *opts, struct call evlist__for_each_entry(evlist, evsel) { if (evsel->core.attr.sample_type == first->core.attr.sample_type) continue; + + /* + * Skip the sample_type check for the dummy event + * because it does not have any samples anyway. + */ + if (evsel__is_dummy_event(evsel)) + continue; use_sample_identifier = perf_can_sample_identifier(); break; }