Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933205AbbEEQg6 (ORCPT ); Tue, 5 May 2015 12:36:58 -0400 Received: from mga09.intel.com ([134.134.136.24]:3990 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752235AbbEEQg4 convert rfc822-to-8bit (ORCPT ); Tue, 5 May 2015 12:36:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,373,1427785200"; d="scan'208";a="489666753" From: "Liang, Kan" To: Peter Zijlstra CC: "mingo@kernel.org" , "acme@infradead.org" , "eranian@google.com" , "andi@firstfloor.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH V7 3/6] perf, x86: handle multiple records in PEBS buffer Thread-Topic: [PATCH V7 3/6] perf, x86: handle multiple records in PEBS buffer Thread-Index: AQHQe310Bv0vIV2rhEqFiZATlJXnO51s68KAgAAC3ICAALweQA== Date: Tue, 5 May 2015 16:36:51 +0000 Message-ID: <37D7C6CF3E00A74B8858931C1DB2F0770180BC7E@SHSMSX103.ccr.corp.intel.com> References: <1429517270-8079-1-git-send-email-kan.liang@intel.com> <1429517270-8079-4-git-send-email-kan.liang@intel.com> <20150505130723.GN23123@twins.programming.kicks-ass.net> <20150505131737.GC16478@twins.programming.kicks-ass.net> In-Reply-To: <20150505131737.GC16478@twins.programming.kicks-ass.net> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1711 Lines: 56 > On Tue, May 05, 2015 at 03:07:23PM +0200, Peter Zijlstra wrote: > > On Mon, Apr 20, 2015 at 04:07:47AM -0400, Kan Liang wrote: > > > From: Yan, Zheng > > > +static void perf_log_lost(struct perf_event *event) { > > > + struct perf_output_handle handle; > > > + struct perf_sample_data sample; > > > + int ret; > > > + > > > + struct { > > > + struct perf_event_header header; > > > + u64 id; > > > + u64 lost; > > > + } lost_event = { > > > + .header = { > > > + .type = PERF_RECORD_LOST, > > > + .misc = 0, > > > + .size = sizeof(lost_event), > > > + }, > > > + .id = event->id, > > > + .lost = 1, > > > + }; > > > + > > > + perf_event_header__init_id(&lost_event.header, &sample, > event); > > > + > > > + ret = perf_output_begin(&handle, event, > > > + lost_event.header.size); > > > + if (ret) > > > + return; > > > + > > > + perf_output_put(&handle, lost_event); > > > + perf_event__output_id_sample(event, &handle, &sample); > > > + perf_output_end(&handle); > > > +} > > > > RECORDs are generic, and should live in the core code. > > > > Also, you should introduce this RECORD in a separate patch. > > On that, this is lacking a RECORD definition in > include/uapi/linux/perf_event.h:perf_event_type The PERF_RECORD_LOST already defined in perf_event_type. Are you suggesting to add a new dedicated RECORD type, like PERF_RECORD_COLLISION? Or update the definition about PERF_RECORD_LOST? Thanks, Kan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/