Received: by 10.223.164.202 with SMTP id h10csp854896wrb; Fri, 10 Nov 2017 16:54:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMY+qg0FXVmweQdNI/1IWZquQYQTNWLWJtjCWr7D57oUOzBwFyzS2KKXnHFgicrhX51ts72C X-Received: by 10.98.60.211 with SMTP id b80mr2217447pfk.4.1510361699697; Fri, 10 Nov 2017 16:54:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510361699; cv=none; d=google.com; s=arc-20160816; b=wxRcAAlzwbomFDmSsW5WkxYb0DbW88u1oVbgrIRZ9XRBdTPRWGjDOkPg0mWTj+LNce Zwv6v5pJ+d9MqeoP/Lzyj3GmvPCRTmcF16Zzj5N6lW9IYJp4owsUdm8UjtidnlIFuFOG Yl1vgd8DG3kW7x5MljHGFG7SBo+Kl6KSLmB8EcLhOXT0yxYR+tPwwmsKj7wR8RvrhZYZ p3Nj0WfCfufksqB7IgYEasqM8g83hUJwwshpaNp1YIwXGOSLirNhWxRWFstHtR0UO973 vDYADqVA8dSXSqo59P+FuElDtNqDlnTUNe2Xvm+UTqD7c3P1sl2GXBdlhoYjVIkyCV9D GjXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=b2eLDK1RZoWVG46pW9HhnI0lNb1cfeMhPUhYAeawybw=; b=QFc1PzTjxvcCXmcwy7fW60GrNMhUKPJdo1O2PARX5JxCUDJ48gtupuKn4wVjV1ObZ+ MDxJFg/avXZQF4h+P1xFJRd8/K4fOhHu65PbIholjZp6RzwTgznr4k5ga9nqLlDptDwc 8EKYXDUlB0qRsU0agcRbR8BMd25LXBInjLDrf4DLI9s5Rr7YKCiBTvpZ8dTVkZ7PP0V1 r7rHCGx4IG3uCvuuGBrUw0dGzXa1r4Ut6XYfEmTetu9cE/nm+6GtswGhh7Gok1HVCnge urEB4piuTq9IKHBXWdxUxyKqfhzDjWHjgUQq6ZfBXXLuaWM4jXjjFBvNI5hgOZe6jW5m FhDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k184si10115724pga.340.2017.11.10.16.54.48; Fri, 10 Nov 2017 16:54:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755282AbdKKAxi convert rfc822-to-8bit (ORCPT + 83 others); Fri, 10 Nov 2017 19:53:38 -0500 Received: from mga02.intel.com ([134.134.136.20]:34284 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755243AbdKKAxf (ORCPT ); Fri, 10 Nov 2017 19:53:35 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Nov 2017 16:53:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,377,1505804400"; d="scan'208";a="6377717" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga002.jf.intel.com with ESMTP; 10 Nov 2017 16:53:34 -0800 Received: from orsmsx158.amr.corp.intel.com (10.22.240.20) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 10 Nov 2017 16:53:34 -0800 Received: from orsmsx111.amr.corp.intel.com ([169.254.12.135]) by ORSMSX158.amr.corp.intel.com ([169.254.10.25]) with mapi id 14.03.0319.002; Fri, 10 Nov 2017 16:53:33 -0800 From: "Dey, Megha" To: Jiri Olsa , Megha Dey CC: "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "andriy.shevchenko@linux.intel.com" , "kstewart@linuxfoundation.org" , "Yu, Yu-cheng" , "Brown, Len" , "gregkh@linuxfoundation.org" , "peterz@infradead.org" , "acme@kernel.org" , "alexander.shishkin@linux.intel.com" , "namhyung@kernel.org" , "vikas.shivappa@linux.intel.com" , "pombredanne@nexb.com" , "me@kylehuey.com" , "bp@suse.de" , "Andrejczuk, Grzegorz" , "Luck, Tony" , "corbet@lwn.net" , "Shankar, Ravi V" Subject: RE: [PATCH V0 2/3] perf/x86/intel/bm.c: Add Intel Branch Monitoring support Thread-Topic: [PATCH V0 2/3] perf/x86/intel/bm.c: Add Intel Branch Monitoring support Thread-Index: AQHTVMuJ78tDWbmRNES2UyAi9yp0nKMErLeAgAm3zPA= Date: Sat, 11 Nov 2017 00:53:33 +0000 Message-ID: References: <1509732006-5917-1-git-send-email-megha.dey@linux.intel.com> <1509732006-5917-3-git-send-email-megha.dey@linux.intel.com> <20171104132611.GE8454@krava> In-Reply-To: <20171104132611.GE8454@krava> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTQxNzMzNDMtMjRjZi00YzVjLTg5ODQtZGI4NDFlNTVlYzA3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkJsS041c0d4ZXMzN0FFN0xSa3JDbHdLK3g3cWdBXC9kdWluY2xkblgwRlBJPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >-----Original Message----- >From: Jiri Olsa [mailto:jolsa@redhat.com] >Sent: Saturday, November 4, 2017 6:26 AM >To: Megha Dey >Cc: x86@kernel.org; linux-kernel@vger.kernel.org; linux- >doc@vger.kernel.org; tglx@linutronix.de; mingo@redhat.com; >hpa@zytor.com; andriy.shevchenko@linux.intel.com; >kstewart@linuxfoundation.org; Yu, Yu-cheng ; >Brown, Len ; gregkh@linuxfoundation.org; >peterz@infradead.org; acme@kernel.org; >alexander.shishkin@linux.intel.com; namhyung@kernel.org; >vikas.shivappa@linux.intel.com; pombredanne@nexb.com; >me@kylehuey.com; bp@suse.de; Andrejczuk, Grzegorz >; Luck, Tony ; >corbet@lwn.net; Shankar, Ravi V ; Dey, Megha > >Subject: Re: [PATCH V0 2/3] perf/x86/intel/bm.c: Add Intel Branch >Monitoring support > >On Fri, Nov 03, 2017 at 11:00:05AM -0700, Megha Dey wrote: > >SNIP > >> + >> +static void intel_bm_event_update(struct perf_event *event) { >> + union bm_detect_status cur_stat; >> + >> + rdmsrl(BR_DETECT_STATUS_MSR, cur_stat.raw); >> + local64_set(&event->hw.prev_count, (uint64_t)cur_stat.raw); } >> + >> +static void intel_bm_event_stop(struct perf_event *event, int mode) { >> + wrmsrl(BR_DETECT_COUNTER_CONFIG_BASE + event->id, >> + (event->hw.bm_counter_conf & ~1)); >> + >> + intel_bm_event_update(event); >> +} >> + >> +static void intel_bm_event_del(struct perf_event *event, int flags) { >> + intel_bm_event_stop(event, flags); >> +} >> + >> +static void intel_bm_event_read(struct perf_event *event) { } > >should you call intel_bm_event_update in here? so the read syscall gets >updated data in case the case the event is active We do not update the event->count in the intel_bm_event_update function. We are basically saving the status register contents when a task is being scheduled out. So it has nothing to do with the read syscall. Having said that, I will probably put what stop() does in del() and get rid of the stop() function. > >jirka From 1583728787493675454@xxx Sat Nov 11 00:51:08 +0000 2017 X-GM-THRID: 1583067906559816766 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread