Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2008438pxk; Tue, 1 Sep 2020 13:14:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrzpxv8VRshRXnBm8Zc4UOjeiDGgeQ3DONf3hI5v5qF4lh5WQzgUdidliXQwJ1qAqB5nS3 X-Received: by 2002:aa7:c7c1:: with SMTP id o1mr3576160eds.368.1598991291606; Tue, 01 Sep 2020 13:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598991291; cv=none; d=google.com; s=arc-20160816; b=iyTbGoHOkpJVwGxSCYrPnLNUmM3Qdl2I7TbF3nX1r+mO+BbunbQ7vZkpg2ELQRSd/X ZJNrYSwyiLKHL54p+LVncTM+c6vX+5l3I2wbnkZVJnIQfRQgqA1FFcXKqo+uquwjcAop mjBs6bnMoMWzyjqiCu9wYIgvRqkqWej0PqFaXJVEt3YeRuEQAeXYm5QXN5H3zlM5h7NW NQPPK0AcVp8OxFUSRg1GuudZtihl6S4dqILhYONLT4fJGOx3tYEaGxhLIhHu8gMYr56R 8E896vPRiN0OYzl+XOtchiC392XuWji+Q03o+NuxuklVLXznKfwwC2lurQX4Kag8bqdX b4RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xUuZ6mEXauP3gq+OoIUq+Lrp43JbuOxI9ofegT73lio=; b=CkLgnXAlbgBnfVJSnXjgdeCEPpkveWn4ESl2ODngiRiTZIIaMUBZfbgQPrETbS/ChZ 6xZfbsYLs2n89ZdyMele//3tXexTXKz37gPbeWB9DcgpolKRcZpNwTWJd0EtqWvDwrN6 f0B6Cys/XO1QuSWsnTDYDSMQbeXQuRB8zMx6RYeBKcgsj+XVxtY3iEQGa/L2v6ul3l0k O/eka5cMj2v4bFDaSOdPam7Y/yErgKahyLuZA2BPSWTXcbTZt7k9OeVphzR4jJuWkt10 xvNRsPdoD6IUuGDe2XYXwfDuH/Q5ewfBGQU43YhwORetYqw+Yvh+v0SAke1M9mu97l/X 2yBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iRbUhJv8; 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 a10si1367407ejf.666.2020.09.01.13.14.28; Tue, 01 Sep 2020 13:14:51 -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=iRbUhJv8; 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 S1728911AbgIAUNj (ORCPT + 99 others); Tue, 1 Sep 2020 16:13:39 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:51454 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726323AbgIAUNi (ORCPT ); Tue, 1 Sep 2020 16:13:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598991217; 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=xUuZ6mEXauP3gq+OoIUq+Lrp43JbuOxI9ofegT73lio=; b=iRbUhJv8HTMS2ciW+v6xaNhM+qMZlcvmuuk4n//OxuTniK+i+MCuISz4Zpf81f6d9ve1MD OGXy+N7VHxP+BBEnO5fYMi2HPxtL6vfPePcVMyExIQvYGsmeKRhX+NtK4Nz8I2SP+bkH+P TvpLcGqKFw8PnjCcq8OTkR0J4BxQQ8E= 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-400-I_8VKxF5PEu_dC1dfSID1g-1; Tue, 01 Sep 2020 16:09:17 -0400 X-MC-Unique: I_8VKxF5PEu_dC1dfSID1g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 711D71074651; Tue, 1 Sep 2020 20:09:15 +0000 (UTC) Received: from krava (unknown [10.40.193.186]) by smtp.corp.redhat.com (Postfix) with SMTP id 490EA5D9CC; Tue, 1 Sep 2020 20:09:13 +0000 (UTC) Date: Tue, 1 Sep 2020 22:09:12 +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 v4 1/7] perf util: Create streams Message-ID: <20200901200912.GD470123@krava> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4cef1f08-e1c1-3227-24f2-be3108ea4d99@linux.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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