Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp298726pxk; Wed, 2 Sep 2020 01:20:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVoJWVG7WFrcCjIRF69uL0wxRitwWMl6IcxKT39eEIQmnep6hLU0kefy3ZJ0Wt1aCNPPcr X-Received: by 2002:a17:906:e24f:: with SMTP id gq15mr5291191ejb.395.1599034830558; Wed, 02 Sep 2020 01:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599034830; cv=none; d=google.com; s=arc-20160816; b=dXygng8FChJG16wfbCNHGcO6ah5J6KCpygq5zLAO0pmY2IETks6uXwQqvCuuahiD3r bOHYD4d6i53mGcxD/KdKtqqFOV1aZNIbmGD0eTwJgOQBHIZPvCjC3fof5cuYEC6Hamm2 zONg7SKk7o/TFfJFRhEKoWC8fWtU9k2yHUyr1qkHq+vjPutJbBjvKCxaSgWNqcTJr2TL tqjVowqs0K5TvoegC0HTS2/fjKVAfBeslLJA0o0YTmeJS1nFRwgg2sIHp33Xak/thdRj MP0uFEsER0/M/u6gZ5Z02ormhvfA4TocyuqSdTKz2RwhmsFB5wekPBoMhf/LrmlALfz7 oLUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender: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=AneiwZUVX5/EdnR0uAg92zJOdKjIheXJfnVI9tT781w=; b=xbsl4lzwBw1/0UFZXzzSw9cBdM9M7pGsM8IlbGNcZtzw9zJms04i4lmuvnulKRs5IY qFVXnAPuWCSebIFq2gQoBI8RfGnjVQvcDkbFH0WxWo5IlkbiqT/U7oKoSHgUQ96uXmwm nbwRYx0OrjGh5aKlTqZO4bmL8czXl3gu3uOz2ASqamg9/gv/+1bHo6Ik0xnejcXFOkW0 BwE2VaFShtp1Xeaw1ciEweMfUM4pH2jOkd2G376oFRWTxd1dgvu10DGOJ5/THLa7755T 7djl2z0XYWvwFhwWABPCfhVXFuq2Q2MQfM+NxbfZEYLq8L3rW2TUutwiFQDXzNDKruKl 944Q== 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 v10si1943613ejx.195.2020.09.02.01.20.07; Wed, 02 Sep 2020 01:20:30 -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 S1726979AbgIBIQm (ORCPT + 99 others); Wed, 2 Sep 2020 04:16:42 -0400 Received: from mga01.intel.com ([192.55.52.88]:32868 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbgIBIQi (ORCPT ); Wed, 2 Sep 2020 04:16:38 -0400 IronPort-SDR: DY5HX/HTcZm+fI9WkCCQCjeGgJR5pGbYEJXrmTiwsZgPtLZ6BFxyPt8/qe+7i2aKwFQZzwaTDM qPA2ibGNvOBA== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="175396498" X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="175396498" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 01:16:35 -0700 IronPort-SDR: IIlqs/v6PqqVFitMyFBmf/xu0UN4uc6GVbAfxWWzKibDDr1iq/bVDtrsMu8qhTFjXStImqeqAl 1NGoW8cQHwBA== X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="477542604" Received: from yjin15-mobl1.ccr.corp.intel.com (HELO [10.238.5.239]) ([10.238.5.239]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 01:16:32 -0700 Subject: Re: [PATCH v4 1/7] perf util: Create streams 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: <20200824233513.16930-1-yao.jin@linux.intel.com> <20200824233513.16930-2-yao.jin@linux.intel.com> <20200831135609.GE406859@krava> <4cef1f08-e1c1-3227-24f2-be3108ea4d99@linux.intel.com> <20200901200912.GD470123@krava> From: "Jin, Yao" Message-ID: <2334220f-22b5-c7eb-f9ec-ee70f41e96cb@linux.intel.com> Date: Wed, 2 Sep 2020 16:16:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200901200912.GD470123@krava> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, On 9/2/2020 4:09 AM, Jiri Olsa wrote: > On Tue, Sep 01, 2020 at 10:26:25AM +0800, Jin, Yao wrote: >> Hi Jiri, >> >> On 8/31/2020 9:56 PM, Jiri Olsa wrote: >>> On Tue, Aug 25, 2020 at 07:35:07AM +0800, Jin Yao wrote: >>> >>> SNIP >>> >>>> + int nr_streams_max, >>>> + enum stream_type type) >>>> +{ >>>> + struct evsel_streams *es; >>>> + int nr_evsel = evlist->core.nr_entries, ret = -1; >>>> + >>>> + es = create_evsel_streams(nr_evsel, nr_streams_max); >>>> + if (!es) >>>> + return NULL; >>>> + >>>> + if (type == STREAM_CALLCHAIN) >>>> + ret = evlist_init_callchain_streams(evlist, es, nr_evsel); >>>> + >>>> + if (ret) { >>>> + free_evsel_streams(es, nr_evsel); >>>> + return NULL; >>>> + } >>>> + >>>> + return es; >>>> +} >>>> diff --git a/tools/perf/util/stream.h b/tools/perf/util/stream.h >>>> new file mode 100644 >>>> index 000000000000..a8a0172b4d13 >>>> --- /dev/null >>>> +++ b/tools/perf/util/stream.h >>>> @@ -0,0 +1,30 @@ >>>> +/* SPDX-License-Identifier: GPL-2.0 */ >>>> +#ifndef __PERF_STREAM_H >>>> +#define __PERF_STREAM_H >>>> + >>>> +#include "callchain.h" >>>> + >>>> +enum stream_type { >>>> + STREAM_NONE = 0, >>>> + STREAM_CALLCHAIN >>> >>> do you plan to add more types? >>> >>> jirka >>> >> >> Thanks for looking at this patch series. >> >> So far, no more types in plan. :) > > I was wondering what's the enum for then, it could > be hardcoded and ease up the code maybe? but it's > jus a thought, I don't follow the change deeply > > jirka > Hmm, I've ever thought to add a new type such as stream_block in the future. But in order to let the patchset be simple and clear, I'm OK to remove this enum. Thanks Jin Yao