Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp971836pxp; Wed, 16 Mar 2022 23:04:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmRAvHldIBaqKAKaH0AAzSYACPTRz4x137M1J1B3u9OPE+ukPdZk25cFl37DNnmAbg4zdL X-Received: by 2002:a17:902:f650:b0:14f:139e:aef2 with SMTP id m16-20020a170902f65000b0014f139eaef2mr3016033plg.151.1647497075097; Wed, 16 Mar 2022 23:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497075; cv=none; d=google.com; s=arc-20160816; b=biYc5pJMC1d/yPcYMkwBQNhNguv5RSov0J6lNu5bqsWJsHUR/IhBDUEXOMqSUm34Ij n1ijWL3BoGRjXM7Lne8veJvrAQxVfAIuSabpCTyfumWAjM0Vjym7d+w9htx+fE5vhVCg RW4bSMKyXji6zQW1wJ0CaNj0UBTd8ESxTF837PNeOTZWfYPdDVgOOZ2fXW3vN6uTGBVV +ce+MOF4o+XOUucoT6ndkZ/fzt5XVk3F+OzAJPs801czLLZd44QqDVsxR5KVc98tYdZm whZVLTdr9c9hLcnNQWLPcZLy3pZkN48Ei/YkQK8mn7toy6CjpHlW8xCNea3ljbkJzG23 O8Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=U6V1vFN28MYrEAJ7ozrUkXlcStkue1e9ZcCneSgcHLk=; b=ydYJpbdIF+O92NJ0EzYHnynbBeslvWUc20d0rL3ZdH2QVqHp7kb9zGKj4zAfaPAfqK aoSwgm16jSRqY8qC/gCg399RJqGHDJFxuDzVHT+v6EcF9evB/sBBHSf+BGltQdZ6zrWd 2+OrrfMiscAu3DSa/IFPdG6epgkv9sACZTMxsamiMLbQ4Ne2+7Hbf9RDsq01ZcbAYh5r tc9vqBwlO+oqEBAoz4IDVcE5IQgZWJpLFgxRqZg/dMcFWAK27zEpHJWdnJ2a7bhwweUS f8LxHIiSNpc8lZblqshOYr9sOPK7T0x7kynVSFw/DhSkXa/RmJJbn66jZ05CNS2JZ1/8 yKLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d3RgezXL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z14-20020a170903018e00b00152fefff534si3997968plg.556.2022.03.16.23.04.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 23:04:35 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=d3RgezXL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A4D7C1C025E; Wed, 16 Mar 2022 22:08:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351603AbiCOUNS (ORCPT + 99 others); Tue, 15 Mar 2022 16:13:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236582AbiCOUNR (ORCPT ); Tue, 15 Mar 2022 16:13:17 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 749D65469E; Tue, 15 Mar 2022 13:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647375124; x=1678911124; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=P0igHsy0agyY40a+InXlXjEkpY6Jf+LU2yEKK5b9mdI=; b=d3RgezXLuKRrI24gkmG4Hewc2RaGh7c0r0bEIW+CEzKk97kXxS+pGn5J vkyFl82K2rVTTQ/rFXbeqWRCeYskEE09UDpZKSHDh/NtL/cX7fsyF1xS4 cE/vF/79BAEOb9sejsa3NxEvKlNnI/JUcfOPpSeBX2ya0IWl6dk3J2gLB bbURiBd1VI7rXjg2NgZ4PjFjujhvFSaFAMRvEWmxNB+kYsmYFm2CIdtT8 ZSfGi+BxwU7bH6Ykm9aBfOyf59E/DhiS0xy1h62IZa0cAepYARnRkXWxH KSJmF7DPqaScEsmOh8jzyHu9rt23P0+OdsSy2VVRVpYv3SQkbLi3cK9Ov g==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="342843389" X-IronPort-AV: E=Sophos;i="5.90,184,1643702400"; d="scan'208";a="342843389" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2022 13:12:04 -0700 X-IronPort-AV: E=Sophos;i="5.90,184,1643702400"; d="scan'208";a="557092735" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.35.111]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2022 13:12:00 -0700 Message-ID: <52903e58-e74c-5ea0-36b4-277ea3610af4@intel.com> Date: Tue, 15 Mar 2022 22:11:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.5.0 Subject: Re: [PATCH] perf intel-pt: Synthesize cycle events Content-Language: en-US To: "Steinar H. Gunderson" Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220310093844.982656-1-sesse@google.com> <586de5fc-858b-2693-1986-5c77e8c0e3d0@intel.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15.3.2022 20.00, Steinar H. Gunderson wrote: > On Tue, Mar 15, 2022 at 01:32:38PM +0200, Adrian Hunter wrote: >>> I think the structure looks good, but I'm not sure about updating >>> e.g. ptq->last_cy_insn_cnt in both functions? Does that make sense? >> It should only be updated in the new intel_pt_synth_cycle_sample(). >> intel_pt_synth_instruction_sample() should be unchanged. > > Hm, OK. But something definitely changed between my original patch and > your change. (The first patch; I didn't try the last one yet.) With my > patch, I got (on a specific trace, synthing cycles only with perf report > --itrace=y0nse): > > Samples: 4M of event 'cycles:uH', Event count (approx.): 4844309 > > With yours on the same file: > > Samples: 2M of event 'cycles:uH', Event count (approx.): 77622449 > > The relative times between functions are also pretty different (although > none of them are obviously crazy), so one of them has to be wrong. > Is this to be expected, ie., would you expect your change to fix some > bad bug on cycle-only synth? For reference, “perf script --itrace=i0ns > -F +ipc | grep -c IPC:” (a quick proxy for the number of CYC packets :-) ) > yields 4836782, so I'm a bit surprised why there are only 2M events > being emitted from that. Sorry, my first suggestion has issues, but the second is better.