From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755731AbcIVAnm (ORCPT ); Wed, 21 Sep 2016 20:43:42 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34069 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755348AbcIVAnk (ORCPT ); Wed, 21 Sep 2016 20:43:40 -0400 Reply-To: pc@us.ibm.com Subject: Re: perf event grouping for dummies (was Re: [PATCH] arc: perf: Enable generic "cache-references" and "cache-misses" events) References: <1472125647-518-1-git-send-email-abrodkin@synopsys.com> <6074e252-6e18-bb01-4de1-023bd7e82f03@synopsys.com> <5f65fa04-8d33-e525-115d-4e6991a7668e@synopsys.com> <20160901083324.GM10153@twins.programming.kicks-ass.net> <2a18ae06-3abd-c3a1-e980-f04c511b08e5@synopsys.com> To: Vineet Gupta , Peter Zijlstra Cc: "linux-perf-users@vger.kernel.org" , Alexey Brodkin , Will Deacon , "linux-kernel@vger.kernel.org" , Arnaldo Carvalho de Melo , "linux-snps-arc@lists.infradead.org" , Jiri Olsa From: Paul Clarke Date: Wed, 21 Sep 2016 19:43:28 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <2a18ae06-3abd-c3a1-e980-f04c511b08e5@synopsys.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16092200-0040-0000-0000-0000016678D5 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005800; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000185; SDB=6.00760035; UDB=6.00361453; IPR=6.00534488; BA=6.00004744; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012743; XFM=3.00000011; UTC=2016-09-22 00:43:33 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16092200-0041-0000-0000-000005598161 Message-Id: <04f6dcd2-35c6-6e28-2dcf-bc5f0bb446dc@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-21_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609220012 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/20/2016 03:56 PM, Vineet Gupta wrote: > On 09/01/2016 01:33 AM, Peter Zijlstra wrote: >>> - is that what perf event grouping is ? >> >> Again, nope. Perf event groups are single counter (so no implicit >> addition) that are co-scheduled on the PMU. > > I'm not sure I understand - does this require specific PMU/arch support - as in > multiple conditions feeding to same counter. My read is that is that what Peter meant was that each event in the perf event group is a single counter, so all the events in the group are counted simultaneously. (No multiplexing.) >> You can do it like: >> >> perf stat -e '{cycles,instructions}' >> >> Which will place the cycles event and the instructions event in a group >> and thereby guarantee they're co-scheduled. > > Again when you say co-scheduled what do you mean - why would anyone use the event > grouping - is it when they only have 1 counter and they want to count 2 > conditions/events at the same time - isn't this same as event multiplexing ? I'd say it's the converse of multiplexing. Instead of mapping multiple events to a single counter, perf event groups map a set of events each to their own counter, and they are active simultaneously. I suppose it's possible for the _groups_ to be multiplexed with other events or groups, but the group as a whole will be scheduled together, as a group. If you have a single counter, I don't believe you can support perf event groups, by definition. Regards, Paul Clarke, IBM