Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1355161pxy; Thu, 6 May 2021 06:26:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0Ee7n+CQ1pMAdBI4FCVUzlpE9pYOtGnUe7x/zJ+IsungH6dqQF+6MZyFVwj9QzgliuWXW X-Received: by 2002:a17:90b:915:: with SMTP id bo21mr4413844pjb.27.1620307579532; Thu, 06 May 2021 06:26:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620307579; cv=none; d=google.com; s=arc-20160816; b=WiexQQFQEKp9kYicwliY0yh0jSQyHmT8rKN/7sPEhrrGGKLZ2THFzYNRbIL4IDc34i MsR+w346WI8BjGRqaDcGAiOvfhZPMWLu1lFp0lnC/xqf5yif0H9Kk/KyGHBESWC85VT4 /8t4Tn7KlqHgeppD1AKH4b/ztijU8ryZDnJqfYHO5TYvLpCUMGfIRaqez4ZkyClYBMoX sVgAiDrcQGIXWH5BuXTijCtcajCYpZgJ8TR4k5nGNT2lnxUHPNE6X2kNzGunUsZ/Itri Ct4aerZoF6J8BB3pRKmVronGniysHB9Y1yEMwGgoBUbrOWPu+mSGj5qIsQXtuRe/388S B/sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FQjaa15o2fK61wUjT8Q/Wis3ZEDIoJxzmVyjAFUonbA=; b=v1oH3oXd0IEsSP4gIuwkynS0rg0aSlyMwos/+bPF5zLekLjOLQRSNnqhNObpjA3Dgy nCIDDRcntEobz67W07moJVaarVKL+juFugJ1dqIgNuf54UjlmDh/zr6pYwiICfKg0Q5C TFW9ZzqFlx0LtmJWgV0X4vWPJDBihNPHzVjShoHUwLBRrTewdXR/L3nmuic/H9LfJZEy ss9mUIVMZLb02hJT8M/vRyTXIJ04Y4DMHSAoN+Cz6ywe4+Rwywsylc9LVuACFJQXb/if rmkk6AlS/Hlzksy+ppOV1Tcc5TIdXxuKYb9pnywGg23XVjaGRW2Gxt40cPPALMqxEgx9 Dyjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IRlFeZpS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b10si3374719pgw.174.2021.05.06.06.26.07; Thu, 06 May 2021 06:26:19 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IRlFeZpS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233993AbhEFNXn (ORCPT + 99 others); Thu, 6 May 2021 09:23:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32870 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230381AbhEFNXm (ORCPT ); Thu, 6 May 2021 09:23:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620307364; 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=FQjaa15o2fK61wUjT8Q/Wis3ZEDIoJxzmVyjAFUonbA=; b=IRlFeZpSw5yrbhugRA/IA+uNMXcK618VZIoUQ3Z5XsQQEx6bqjwiLCDFxIG+knR6ZoZOYd 2jySzmcRg5sUNy24ScZXtUsHB8f6H4pmK4T50j1I0kL4V5LDN/1sH5eV6paklD6bZIDo63 ykAdTg24rAYoddS19+uHHsgxCDWW2Rg= 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-31-CNlBKJxgNJuRGfAj_TJ8tg-1; Thu, 06 May 2021 09:22:40 -0400 X-MC-Unique: CNlBKJxgNJuRGfAj_TJ8tg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B2AC1801817; Thu, 6 May 2021 13:22:38 +0000 (UTC) Received: from krava (unknown [10.40.193.227]) by smtp.corp.redhat.com (Postfix) with SMTP id 6DD8219D9F; Thu, 6 May 2021 13:22:36 +0000 (UTC) Date: Thu, 6 May 2021 15:22:35 +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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 06, 2021 at 12:59:08PM +0800, Jin, Yao wrote: > Hi Jiri, > > On 5/4/2021 11:07 PM, Jiri Olsa wrote: > > On Fri, Apr 30, 2021 at 03:46:02PM +0800, Jin Yao wrote: > > > On hybrid platform, it may have several cpu pmus, such as, > > > "cpu_core" and "cpu_atom". The CPU_PMU_CAPS feature in perf > > > header needs to be improved to support multiple cpu pmus. > > > > > > The new layout in header is defined as: > > > > > > > > > > > > > > > > > > > > > > not sure why is the 'nr of rest pmus' needed > > > > The 'nr of rest pmus' indicates the remaining pmus which are waiting for process. > > For example, > > > > "cpu_core" > 1 > > > "cpu_atom" > 0 > > When we see '0' in data file processing, we know all the pmu have been processed yet. > > > the current format is: > > > > u32 nr_cpu_pmu_caps; > > { > > char name[]; > > char value[]; > > } [nr_cpu_pmu_caps] > > > > > > I guess we could extend it to: > > > > u32 nr_cpu_pmu_caps; > > { > > char name[]; > > char value[]; > > } [nr_cpu_pmu_caps] > > char pmu_name[] > > > > u32 nr_cpu_pmu_caps; > > { > > char name[]; > > char value[]; > > } [nr_cpu_pmu_caps] > > char pmu_name[] > > > > ... > > > > and we could detect the old format by checking that there's no > > pmu name.. but maybe I'm missing something, I did not check deeply, > > please let me know > > > > Actually we do the same thing, but I just add an extra 'nr of rest pmus' > after the pmu_name. The purpose of 'nr of rest pmus' is when we see '0' at > '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 > > So is this solution acceptable? > > > also would be great to move the format change and storing hybrid > > pmus in separate patches > > > > Maybe we have to put the storing and processing into one patch. > > Say patch 1 contains the format change and storing hybrid pmus. And patch 2 > contains the processing for the new format. If the repo only contains the > patch 1, I'm afraid that may introduce the compatible issue. maybe you can have change of caps format in one patch and storing/processing hybrid pmus in another? jirka