Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3081471pxj; Mon, 10 May 2021 18:18:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsz1bw2Afzg+mkBcA/JrpaXOjodC0iHAHBqyzSXnBqYbzl+His+Ylnt82kvyB3orjMB29S X-Received: by 2002:a17:907:1b1e:: with SMTP id mp30mr28594613ejc.532.1620695933985; Mon, 10 May 2021 18:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620695933; cv=none; d=google.com; s=arc-20160816; b=F35R2eQ4Cr5agJCtkIX2s7kB3gsnGpa7kwKXqLnmm4J0Z8tuy0tHJD/6GPZEuyDWm+ cvpgsM3XK0rCvGPjpHHYsOZSXDMy+fAuPzQT0KAjD+b6DegVGYTC37bU7kpHkEt+tw6O H4P6z92AgwQJlFEhoe+vFdpaisfWOpnqVtYYZ3RnK/x4ow4JuI4hvplHn2t8ExMdDSrb FQVBJdMrrMf07rD3KmglIxtgqaP3/a1Stj3H+7nZU8ffnGbX0JuylFD2MCPCU9k0HCNZ dlBCIx3NMYUoKw745hc/hfoJ5XR59vXiI7/LQ/5R1QaiOGGVZnr3neDKWyK9m08NmjxL pp1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=rO/GF7W72km00PU6ThkuLNjDCdkz9eYLYPWgA4N5ipU=; b=v7Mjh/DbeWdL4ugXa/3J1+8Yd+BJZzrbn5wtmkeDLoGia4ofPbhfYDdCzZqql0Wkkr nuVv2XsodS9ipy8k//6VCH9Tx7YxtuQDICgIgP31yA0sVSHpPdDIgU2L1y906PCsh0iw PXjlefRQ2I770Uc4pZGskC1Y6LNKU2morDm0zXjXaH9lJVSPalid2L80xDRc2kOiXY+f wiJ88Fe13XhNN49e/kDkLwiMCSs7e2dluMAgQWFkmDBucCbVzrs8WcsN0tXUEPDpXRTE b/4QqlsPl5FZSjkOdZJgtUDkF85PHlj3XF+GzMvyAUDcLuUW1Ls/3B1vOg2qdcHkSfIU 6HaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx5si15410502ejc.393.2021.05.10.18.18.30; Mon, 10 May 2021 18:18:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbhEKBQh (ORCPT + 99 others); Mon, 10 May 2021 21:16:37 -0400 Received: from mga04.intel.com ([192.55.52.120]:8317 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbhEKBQg (ORCPT ); Mon, 10 May 2021 21:16:36 -0400 IronPort-SDR: ZxmTUo5/SdwjWQVzsUhN5M6ow+HFzDQU5bgzHYTHTNiSKefhzWMJyRUHcJr2xt73BJXBUKg3qP oPtDt+Hwiszg== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="197343482" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="197343482" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 18:15:31 -0700 IronPort-SDR: rLv7jY/3kBuzYMTV3rx0id8R76ZofJs8fvOdYemXecoT5NHN0gChnNr9eiQiiL5ILvDVWdBjjK POTa+QcP0bdA== X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="436397817" Received: from yjin15-mobl1.ccr.corp.intel.com (HELO [10.238.4.82]) ([10.238.4.82]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 May 2021 18:15:28 -0700 Subject: Re: [PATCH v1 2/2] perf header: Support hybrid CPU_PMU_CAPS To: Jiri Olsa Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com References: <20210430074602.3028-1-yao.jin@linux.intel.com> <20210430074602.3028-2-yao.jin@linux.intel.com> <5cafb729-1dcd-ad4a-507b-1155c16a785e@linux.intel.com> From: "Jin, Yao" Message-ID: <249153c0-a560-aa78-97a9-039dee5be86b@linux.intel.com> Date: Tue, 11 May 2021 09:15:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, On 5/10/2021 9:11 PM, Jiri Olsa wrote: > On Thu, May 06, 2021 at 10:43:39PM +0800, Jin, Yao wrote: > > SNIP > >>>> 'nr of rest pmus', we know that all pmus have been processed. >>>> >>>> Otherwise, we have to continue reading data file till we find something >>>> incorrect and then finally drop the last read data. >>> >>> you have the size of the feature data right? I think we use >>> it in other cases to check if there are more data >>> >> >> The challenge for us is if we need to compatible with the old perf.data >> which was generated by old perf tool. >> >> For the old perf.data, the layout in header is: >> >> nr of caps >> caps string 1 >> caps string 2 >> ... >> caps string N >> >> It doesn't carry with any other fields such as size of caps data. >> >> To be compatible with old perf.data, so I have to extend the layout to: >> >> nr of caps for pmu 1 >> caps string 1 >> caps string 2 >> ... >> caps string N >> name of pmu 1 >> nr of rest pmus >> >> nr of caps for pmu2 >> caps string 1 >> caps string 2 >> ... >> caps string N >> name of pmu 2 >> nr of rest pmus >> >> When the new perf tool detects the string such as "cpu_", it can know that >> it's the pmu name field in new perf.data, otherwise it's the old perf.data. > > what if the cap string starts with 'cpu_' ? > I just assume the cap string would not have 'cpu_' string. Yes, I agree, that's not a very good solution. > I think it might be better to create new feature that > stores caps for multiple pmus in generic way > Yes, creating a new feature in header (such as "HYBRID_CPU_PMU_CAPS") is a better way. >> >> If we add new field such as "size" to the layout, I'm afraid the new perf >> tool can not process the old perf.data correctly. >> >> If we don't need to support old perf.data, that makes things easy. > > we need to > Yes, we need to. I'm now preparing v3. Thanks Jin Yao > jirka >