From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB321C43600 for ; Mon, 10 May 2021 13:15:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2CD96128D for ; Mon, 10 May 2021 13:15:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236295AbhEJNPP (ORCPT ); Mon, 10 May 2021 09:15:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57390 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351739AbhEJNMz (ORCPT ); Mon, 10 May 2021 09:12:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620652310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uWguGrclwEnEpjCWx9hkfnX3Pd9bynv9MmA0sKIv9Go=; b=e8pi3fCGtEt8iKIW2yYCDLX7tItv1pgXbl3ArNPkGRqZOmTKA4M5Xdn7gq668UPGp3/09P TpUXMlSGxR7JwxWvqKt152oYjWYHnt2HcidM/3PSp6d5JYBZAqlJvM2OpCLWGPEf2wGJtG CKbyc7gCZAmom3BxxkVm/XbMLbZe8S8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-188-0veEja26NrCMkoNz6DhVhA-1; Mon, 10 May 2021 09:11:48 -0400 X-MC-Unique: 0veEja26NrCMkoNz6DhVhA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4CDCF106BB3E; Mon, 10 May 2021 13:11:47 +0000 (UTC) Received: from krava (unknown [10.40.194.219]) by smtp.corp.redhat.com (Postfix) with SMTP id ED0B45F9B0; Mon, 10 May 2021 13:11:44 +0000 (UTC) Date: Mon, 10 May 2021 15:11:44 +0200 From: Jiri Olsa To: "Jin, Yao" 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 Subject: Re: [PATCH v1 2/2] perf header: Support hybrid CPU_PMU_CAPS Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5cafb729-1dcd-ad4a-507b-1155c16a785e@linux.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 think it might be better to create new feature that stores caps for multiple pmus in generic 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 jirka