Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3979852pxv; Mon, 19 Jul 2021 13:30:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5DxYaWF/B6i53fYtJ/DS65xWaeUYRFZVS1MKGD+kHsfr0Of9w3XQAtN9W3LPk3UDq54G8 X-Received: by 2002:a05:6402:895:: with SMTP id e21mr36189882edy.9.1626726619411; Mon, 19 Jul 2021 13:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626726619; cv=none; d=google.com; s=arc-20160816; b=CvWDtIC2h6YpiyCZArK+pWRXaelltQj+Xk/kMqIV+WhBVvB9Phq6DHbvM/66jKJkTH +0lPbe1wI+yAx++0TWM1+ZaQav3gS9wRQJLEJPSKW4bjaRiqQL8Ywp59qcCv7Ma3MkYD OwvPAi84/6jga/qJwAHsUfRIgRxkrZh3+h4oqY2lYfU6h8RHh+1VGTuPJBKd4GsTNk7K 5QVX7Yz+uAFR7crAcosHjmn5kGvLyGCpo09YIbk6K7tPyW9D29n+L5ZdKFgVC+dezSGa Fr9KQsJ5LQo5xj5X2D2aCUSN7HbCq5q45Q1x31duDfTS1UZZq3JbvzpDZPD2dUcaTfgk 9XeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Q+irJqMZyT8vVhzSQzlGF5zo6NtSqPMaVnw68sUk3dQ=; b=GlDYlPuvQ0c2naBOCfUFAg844PJYT/27jXPbrVusZSyDLjW0yGoGMj3S9ipGwGPcZz zywbfsbKKbNEKY0ywpfqk4PXHVGG48E+RvU18h8S2ZjosFtrcwLfC9YzDHn29JJ0dRJi JKb2tBJDLR0VQoAG5TYtS+CmrEE9eA9D+qm2MlRl/RUC+b3loR7sufsgC7NT7u0c0/kb xcmGC5yl+N6OlAbjIKzB2/ICdRzwb6a0+9s6TRR5dNJwZsK2JkTOCk1iR4OVq9ovANrG gR+l2fkzcbUTlTvmlTW/AAjBzphDmjvtturO4NZkZxMMWoPqFct4wzst2BWO3dRpE5nT lubQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MmwQBagM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv2si21424554ejb.569.2021.07.19.13.29.56; Mon, 19 Jul 2021 13:30:19 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MmwQBagM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386982AbhGSTpA (ORCPT + 99 others); Mon, 19 Jul 2021 15:45:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:40268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358191AbhGSTVR (ORCPT ); Mon, 19 Jul 2021 15:21:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 95B6D610FB; Mon, 19 Jul 2021 20:01:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626724891; bh=AtilYTYAIi/v289g3hvYA7Xnfh/9TR5jTuUQdlcooaU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MmwQBagM86Zvha3FDzTeqpfHrhaaF8hafQyEBNKW+VVwgTm4955iNjsAzQGGQnmsh c/iSIyg0GLURQG0X4bBHYbqeGkpc1S3VbB/RnhU/QlCt8RNdhm+o2tMJvXuucbMZdl OCHMDUl0aXj93gj1uJpqrpP730D6VO0BVcovn5TVXYuc+CtCI78AvJdO+oJAKOY4k6 ZPFWzkGaJmmdcc0BJBV2hi1UWwIGGTNfLofgeHP+6hCvbnsCt2nxIP9v8U8E/ekE1y c+CIdEnXoPOwtERWOSb0N4ryQ9YtPEEhHCUB51N8CyacvRy5LYLEUlhzzlsnjPzmRU /wvrE+1rD7/TQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 0D5E3403F2; Mon, 19 Jul 2021 17:01:29 -0300 (-03) Date: Mon, 19 Jul 2021 17:01:28 -0300 From: Arnaldo Carvalho de Melo To: Jin Yao , John Garry Cc: Jiri Olsa , Kan Liang , Jin Yao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Zhangshaokun , "liuqi (BA)" Subject: Re: [bug report] Patch "perf tools: Fix pattern matching for same substring in different pmu type" broken Message-ID: References: <44e25825-5f23-c641-9f1c-72268d895f75@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44e25825-5f23-c641-9f1c-72268d895f75@huawei.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Jul 19, 2021 at 03:13:06PM +0100, John Garry escreveu: > Hi guys, > > The named patch has broken PMU alias matching on my arm64 system. Hi Jin, can you please address this report? Otherwise I'll have to revert the patch in my next pull req to Linus :-\ - Arnaldo > 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). > -- - Arnaldo