From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752508AbbG3P1G (ORCPT ); Thu, 30 Jul 2015 11:27:06 -0400 Received: from mga01.intel.com ([192.55.52.88]:36424 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752476AbbG3P1D (ORCPT ); Thu, 30 Jul 2015 11:27:03 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,577,1432623600"; d="scan'208";a="533111130" From: Alexander Shishkin To: Peter Zijlstra Cc: Ingo Molnar , linux-kernel@vger.kernel.org, adrian.hunter@intel.com, x86@kernel.org, hpa@zytor.com, acme@infradead.org Subject: Re: [PATCH v1] perf/x86/intel/pt: Do not force sync packets on every schedule-in In-Reply-To: <1438264104-16189-1-git-send-email-alexander.shishkin@linux.intel.com> References: <20150730121349.GI25159@twins.programming.kicks-ass.net> <1438264104-16189-1-git-send-email-alexander.shishkin@linux.intel.com> User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Thu, 30 Jul 2015 18:24:52 +0300 Message-ID: <87k2thk6rf.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Alexander Shishkin writes: > Currently, the PT driver zeroes out the status register every time before > starting the event. However, all the writable bits are already taken care > of in pt_handle_status() function, except the new PacketByteCnt field, > which in new versions of PT contains the number of packet bytes written > since the last sync (PSB) packet. Zeroing it out before enabling PT forces > a sync packet to be written. This means that, with the existing code, a > sync packet (PSB and PSBEND, 18 bytes in total) will be generated every > time a PT event is scheduled in. > > To avoid these unnecessary syncs and save a WRMSR in the fast path, this > patch changes the default behavior to not clear PacketByteCnt field, so > that the sync packets will be generated with the period specified as > "psb_period" attribute config field. This has little impact on the trace > data as the other packets that are normally sent within PSB+ (between PSB > and PSBEND) have their own generation scenarios which do not depend on the > sync packets. > > One exception where we do need to force PSB like this when tracing starts, > so that the decoder has a clear sync point in the trace. For this purpose > we aready have hw::itrace_started flag, which we are currently using to > output PERF_RECORD_ITRACE_START. This patch moves setting itrace_started > from perf core to the pmu::start, where it should still be 0 on the very > first run. > > Signed-off-by: Alexander Shishkin > > perf/x86/intel/pt: fixup with no force psb > > Signed-off-by: Alexander Shishkin Argh, it is not my day today. Regards, -- Alex