Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp985136pxk; Mon, 31 Aug 2020 06:57:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKiBf6sbf6rCkuZ1ZgPE8oFIu9h6FNeIclaUZGHXsnCelyqHY8J9rHEKxJFnTCbJWwGf/q X-Received: by 2002:a05:6402:10d7:: with SMTP id p23mr1345235edu.388.1598882261344; Mon, 31 Aug 2020 06:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598882261; cv=none; d=google.com; s=arc-20160816; b=UQAPmG24h+q4y0EXf6ZwaHs6hd+1/l749/rzq680+rhwlcE7JaMJdnZtwCGqKvMvKO 8X7pEuhOfj+AIy/Z9klVlPKmBQqqW3LGkmKtGbvpRn826uhyC5yy6t2q3TOqGoc/iDNc hhtH2oMRjANr29Qz6WS8Fcepb7UwPmhIbpUa2I7iy7sYaJdBLN8lAKY0R/keno6SfxR6 FHi35HV+pH23ZdICqUjkNAOMHi0U5ODkM6NYdeEHyS4/iKrn7rgx10ndkmALRltsbe47 FxIy9pSYqp3PwGnr5aOso0UUWv7dD11IY/vxgdB2TU1zN22e+05Y8Hys1pd3otpYK1Q7 9Yvw== 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=xBjZRrtnn2DymOUf25LFqlHNqeGn8G4I2kGQPVNxJtk=; b=LzL12hOVZYYQpE55NHPJ73QaaRJFcu6avjgVx2Pk9w69ScnAna57lGqVsIlphO1gUl rHDKFb0oBnsp3ehMlI3vJ09SEUuTKopB98RxfjNkBYRnuxs26tu36Xfzn5fcHf8/RjzW qXH9tOXzNhkgJC1YihsCa47aNMkqfN4auxuO3P9c3GIfbhOtLkoNmADFEo5o1nJYV5lv VLeVXWjY9oCaXiMeYIXGBUkBNEmvXWHg650NLztYKlt5+8jQoH1oNBO+9Oj8QVGTA+ar YSFDW/i4/M7GfQQxB8qHc50CWgR3mRHeXcrc1eBym7Z7oazKIGbK+JnsJrH7iYaFr+Ek J2Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TOQdblEl; 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 ov22si1112686ejb.112.2020.08.31.06.57.18; Mon, 31 Aug 2020 06:57:41 -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=TOQdblEl; 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 S1727931AbgHaN4Y (ORCPT + 99 others); Mon, 31 Aug 2020 09:56:24 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:41908 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727066AbgHaN4S (ORCPT ); Mon, 31 Aug 2020 09:56:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598882176; 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=xBjZRrtnn2DymOUf25LFqlHNqeGn8G4I2kGQPVNxJtk=; b=TOQdblElVmSZs1exXJkedbWPH2bboHuygHes0IwBT58wYyF4w4gzA/ldlODZe+trA2glWf sivE7TUFTNFuGxdWucdmby78mBBErQupyShzi/IDAxvE6LAkSHCPyBCfBFUpYsuzIVRgu2 qmX+G5fH6jT257yEdCvaq+7Ea+LOMAo= 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-255-DLJnIK9QPMSrShr4w4i1Uw-1; Mon, 31 Aug 2020 09:56:14 -0400 X-MC-Unique: DLJnIK9QPMSrShr4w4i1Uw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B5A81802B60; Mon, 31 Aug 2020 13:56:12 +0000 (UTC) Received: from krava (unknown [10.40.192.186]) by smtp.corp.redhat.com (Postfix) with SMTP id 575111002391; Mon, 31 Aug 2020 13:56:10 +0000 (UTC) Date: Mon, 31 Aug 2020 15:56:09 +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: <20200831135609.GE406859@krava> References: <20200824233513.16930-1-yao.jin@linux.intel.com> <20200824233513.16930-2-yao.jin@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200824233513.16930-2-yao.jin@linux.intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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