From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751517AbcBKQjq (ORCPT ); Thu, 11 Feb 2016 11:39:46 -0500 Received: from outbound.smtp.vt.edu ([198.82.183.121]:38385 "EHLO omr1.cc.vt.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750997AbcBKQjp (ORCPT ); Thu, 11 Feb 2016 11:39:45 -0500 MIME-Version: 1.0 In-Reply-To: <20160211145702.GK6357@twins.programming.kicks-ass.net> References: <1455143882-3899-1-git-send-email-ztong@vt.edu> <1455143882-3899-2-git-send-email-ztong@vt.edu> <20160211145702.GK6357@twins.programming.kicks-ass.net> From: Tong Zhang Date: Thu, 11 Feb 2016 11:39:18 -0500 Message-ID: Subject: Re: [PATCH 1/1] Perf: fix overwritten of free running PEBSv3 timestamp To: Peter Zijlstra Cc: Ingo Molnar , Arnaldo Carvalho de Melo , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org How about moving `time' to the `group', Will this help? Regards, Tong Signed-off-by: Tong Zhang ------ diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 3f590de..3163598 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -797,6 +797,7 @@ struct perf_sample_data { u64 period; u64 weight; u64 txn; + u64 time; union perf_mem_data_src data_src; /* @@ -809,7 +810,6 @@ struct perf_sample_data { u32 pid; u32 tid; } tid_entry; - u64 time; u64 id; u64 stream_id; struct { On Thu, Feb 11, 2016 at 9:57 AM, Peter Zijlstra wrote: > On Wed, Feb 10, 2016 at 05:38:02PM -0500, Tong Zhang wrote: >> commit a7b58d211ba18c9175b139e18b68c86a6bcc3c3f introduced feature of >> timestamp on free running PEBSv3, however, the timestamp is later >> overwritten, which makes the effort in vain. >> >> This patch fixed this problem by detecting whether timestamp is provided. >> >> Signed-off-by: Tong Zhang >> --- >> include/linux/perf_event.h | 1 + >> kernel/events/core.c | 45 +++++++++++++++++++++++++++++++++------------ >> kernel/events/ring_buffer.c | 4 +++- >> 3 files changed, 37 insertions(+), 13 deletions(-) >> >> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h >> index f9828a4..12d7b95 100644 >> --- a/include/linux/perf_event.h >> +++ b/include/linux/perf_event.h >> @@ -815,6 +815,7 @@ static inline void perf_sample_data_init(struct perf_sample_data *data, >> data->weight = 0; >> data->data_src.val = PERF_MEM_NA; >> data->txn = 0; >> + data->time = 0; >> } > > Argh, you just touched a new cacheline and made _every_ single event > slower.