Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1969838ybz; Thu, 30 Apr 2020 08:35:15 -0700 (PDT) X-Google-Smtp-Source: APiQypLMCzFM9Sg6qBsOdvxOZlw+DfG3ZXzDeS+BFbjK5bsE0DAMSlyvu0N//aWc2ROhegB1ymYj X-Received: by 2002:a17:906:374b:: with SMTP id e11mr3347858ejc.283.1588260915751; Thu, 30 Apr 2020 08:35:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588260915; cv=none; d=google.com; s=arc-20160816; b=zwJrk3Jeu/8+L4RePmvdO8ykWdN9lM1lK3Zg4rJn4tlTkuCI29kFtZSC7VA2cKmPjF OfFrefKccgsBTYlGyk/y3CYwGEE5NRvasW/S8h2UK0cmePT23B43DU396CWUrXfR+llc ygjjctrCmwevqzD9xEDV4Sk7rf0V3nKp/W+s60QQBIi2QEYFN4tv45JROrxMRwV3LShf COJ1/939VUB7d2rpBssWGuPhbihvdQLn2oDB1htvlCOIn6+sHPPoupdANcFEBgbHqfLH WN3RDEEi8R7bNOzGPEt11oMGmW05tv6Y+r3GCXpDu0RoXJ+KeACeY3U3Tha7iEkW9a2+ iEag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=AAgBlx0Nlw3gaU+dOvATALPgPMDi8eTwXD0Smt+daVg=; b=johBuYfpId5vo2ti/H7PHSrc5Fn6zsFrOzA9YJyGe4OpeNWlmr1MmpvxFDIDoPZOGl lg8pbhL5cpJW+Xuzu0SPXeZO0KOOYsVjFhbAqssO514d/r/9O/d8k0foGtw1YOkGkGdC skCrRiBiAvz+qt2wSVDhsxAAYYlqU9etTI5CrOYIr50VwyUxVnxZOnvKF3mGjzKdtuQq fb12UjSed4ydgznbIQFJ4eAd3Qym+nA/L1B/Q+FiX0rB7zVWhpvajwYHn4gJ02k5M03w 68kFHjW2yp8Ewv73UqI7KVKvapi2MjZ1eImvGIjayrryDr8LyuZHuKJU28J6Vtxmut/8 XJ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WW7+LBr6; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g23si6176029ejh.337.2020.04.30.08.34.51; Thu, 30 Apr 2020 08:35:15 -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=@redhat.com header.s=mimecast20190719 header.b=WW7+LBr6; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726835AbgD3PdH (ORCPT + 99 others); Thu, 30 Apr 2020 11:33:07 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:60636 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726344AbgD3PdH (ORCPT ); Thu, 30 Apr 2020 11:33:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588260785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AAgBlx0Nlw3gaU+dOvATALPgPMDi8eTwXD0Smt+daVg=; b=WW7+LBr6WAYoYwLI1JEJo3fr+5SxQ/YeFHLreesTNsghtw5CeRKb0jHS88TCQy4H9WZG9X WlNJCc0Ew0sTuH9WR6QkA27wJoYUFbmJAJ3bEHkkMwhPF9eA1zN21kvisY3mP+6agS7T+C 0pEZ6kRqnQfQkl6glnKJdhpjzdn+l1Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-458-yQcHAZZCPAmLCnVLsJxkuA-1; Thu, 30 Apr 2020 11:33:01 -0400 X-MC-Unique: yQcHAZZCPAmLCnVLsJxkuA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A30DB8015D2; Thu, 30 Apr 2020 15:32:59 +0000 (UTC) Received: from krava (unknown [10.40.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 265D8600E5; Thu, 30 Apr 2020 15:32:55 +0000 (UTC) Date: Thu, 30 Apr 2020 17:32:53 +0200 From: Jiri Olsa To: "Jin, Yao" Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, John Garry Subject: Re: [PATCH] perf parse-events: Use strcmp to compare the PMU name Message-ID: <20200430153253.GF1694693@krava> References: <20200430003618.17002-1-yao.jin@linux.intel.com> <20200430084529.GC1681583@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 30, 2020 at 09:45:14PM +0800, Jin, Yao wrote: > Hi Jiri, > > On 4/30/2020 4:45 PM, Jiri Olsa wrote: > > On Thu, Apr 30, 2020 at 08:36:18AM +0800, Jin Yao wrote: > > > A big uncore event group is split into multiple small groups which > > > only include the uncore events from the same PMU. This has been > > > supported in the commit 3cdc5c2cb924a ("perf parse-events: Handle > > > uncore event aliases in small groups properly"). > > > > > > If the event's PMU name starts to repeat, it must be a new event. > > > That can be used to distinguish the leader from other members. > > > But now it only compares the pointer of pmu_name > > > (leader->pmu_name == evsel->pmu_name). > > > > > > If we use "perf stat -M LLC_MISSES.PCIE_WRITE -a" on cascadelakex, > > > the event list is: > > > > > > evsel->name evsel->pmu_name > > > --------------------------------------------------------------- > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_4 (as leader) > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_2 > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_0 > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_5 > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_3 > > > unc_iio_data_req_of_cpu.mem_write.part0 uncore_iio_1 > > > unc_iio_data_req_of_cpu.mem_write.part1 uncore_iio_4 > > > ...... > > > > > > For the event "unc_iio_data_req_of_cpu.mem_write.part1" with > > > "uncore_iio_4", it should be the event from PMU "uncore_iio_4". > > > It's not a new leader for this PMU. > > > > > > But if we use "(leader->pmu_name == evsel->pmu_name)", the check > > > would be failed and the event is stored to leaders[] as a new > > > PMU leader. > > > > > > So this patch uses strcmp to compare the PMU name between events. > > > > > > Fixes: 3cdc5c2cb924a ("perf parse-events: Handle uncore event aliases in small groups properly") > > > Signed-off-by: Jin Yao > > > > looks good, any chance we could have automated test > > for this uncore leader setup logic? like maybe the way > > John did the pmu-events tests? like test will trigger > > only when there's the pmu/events in the system > > > > Acked-by: Jiri Olsa > > > > thanks, > > jirka > > > > > > I'm considering to use LKP to do the sanity tests for all perf events > (core/uncore) and perf metrics periodically. It may help us to find the > regressions on time. sounds good ;) thanks jirka