Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3724270pxv; Mon, 19 Jul 2021 07:18:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxihv+7Z+E+Qn6KARHlzRTjBD22rqjief1sHMg/aHI/OPbL+FdMeF7ef6p5q/eVtQ4V8zmo X-Received: by 2002:a17:906:5f99:: with SMTP id a25mr27867456eju.101.1626704310992; Mon, 19 Jul 2021 07:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626704310; cv=none; d=google.com; s=arc-20160816; b=SqabgFtrbPJd43rL1ueg8o9PxcAlBgwSs+c7C/fcO5tNNhc1vPZheFRiMRISBIKDDO ejLLakuQikqqwzK1HiBjjFduYVlsAIM0CYm2mSEcYkTJVe/E5juh1YWSHzZD19G0ELf7 +GlOEz4833wQjKeiyQb7kZ1xRULtpUmaXdnfVAyk1GMH69QE7WFQLW/pV7IEoLJNjadr JNwNpqttFhxKG6fyAyrkHmq2vbdyNeCLkg5Os0W+3mdrBQuAS6Ekisbg5P4t27ScTm6f 1H1NuCwWUA7+0KgW9Vq9eoWH8V55ENJHklPFIplEpDg+xz6FK+vVzlIEEsihJaR4gThp Wcvw== 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 :mime-version:user-agent:date:message-id:cc:subject:from:to; bh=x7/6PrXIslSyxVZMCaknlef5/4w3ld0KBeixdrnzOqo=; b=GBlkPq9FG+toZNkx7Gyij17JstW7UbvCQ8xBWDwjGa/Ly/CCBzqqZ0w9SGzlMtPPfu 1rY03oNKa4JXYQUaBdiNVDUvUq6JZ3ZVF/4p0YOFGhB8n30e46qLrSRs2TvP/4/Ml4B6 wQNpeQnlGaZTRUPYcJQAM77SN1UBZB7phAPbFwBTmv/fSGE+bRTa22HTNKlqvc4FwuhH qENedVxoEBcMxh7YoDz8d/XXTJIpp6mf9X2lr4tFb+Ln5cI5ztGffmcsu64yF9+c71ln QvHKzeC0wguwNjK7qrn6JgHKR2iGEZshaMtfF6EzRXptdthY3vZbDuKRLGKVAkOschJ5 bC9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si14202102ejt.296.2021.07.19.07.18.05; Mon, 19 Jul 2021 07:18:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239464AbhGSNc3 (ORCPT + 99 others); Mon, 19 Jul 2021 09:32:29 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3432 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239277AbhGSNc2 (ORCPT ); Mon, 19 Jul 2021 09:32:28 -0400 Received: from fraeml707-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4GT3Rn5Dcpz6H7SH; Mon, 19 Jul 2021 22:01:41 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml707-chm.china.huawei.com (10.206.15.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 19 Jul 2021 16:13:04 +0200 Received: from [10.47.85.214] (10.47.85.214) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 19 Jul 2021 15:13:03 +0100 To: Arnaldo Carvalho de Melo , Jiri Olsa , Kan Liang , Jin Yao From: John Garry Subject: [bug report] Patch "perf tools: Fix pattern matching for same substring in different pmu type" broken CC: "linux-kernel@vger.kernel.org" , "linux-perf-users@vger.kernel.org" , Zhangshaokun , "liuqi (BA)" Message-ID: <44e25825-5f23-c641-9f1c-72268d895f75@huawei.com> Date: Mon, 19 Jul 2021 15:13:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.85.214] X-ClientProxiedBy: lhreml712-chm.china.huawei.com (10.201.108.63) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi guys, The named patch has broken PMU alias matching on my arm64 system. Specifically it is broken for when multiple tokens are used in the alias. For example, alias "hisi_sccl,l3c" would previously match for PMU "hisi_sccl3_l3c7", but that no longer works. In my example, in looking at the code, the callchain pmu_uncore_alias_match("hisi_sccl,l3c", "hisi_sccl3_l3c7") -> per_pmu__valid_suffix("hisi_sccl3_l3c7", "hisi_sccl") fails in the following check: static bool perf_pmu__valid_suffix(char *pmu_name, char *tok) { char *p; ... p = pmu_name + strlen(tok); ... if (*p != '_') //here return false; } This check assumes the first token must be followed by a '_', but it is possibly a numeric. Please let me know how this should work. Previously it would match on the tokens, ignoring numerics and '_'. As an aside, I'll look at why our testcases don't cover this scenario and look to add a test if necessary. Thanks, john Ps, please cc linux-perf-users@vger.kernel.org as in the MAINTAINERS file in future, as not all subscribe to the open kernel list (and so cannot easily reply directly).