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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A19FC10F16 for ; Tue, 30 Apr 2024 06:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=20teOSz41+AZW9cYvhOylsj+5x4BYodnpW1G3kvixZc=; b=bXdc8WpeD8TKFd +rlxE7gQB3//JS/7Stbl36qKTqBgxlG2Yt15Lr9qTI7p5mhPaFDuwivYjCII/smdS3BHP5sjeZxo+ 6FRWElfK6Bm0oFNla8LJOjgM3bYsoL3mwi+XeD2PyT7/E+aKWskHIbM124GaaghLYVpJviJyCdiFn CYSvNSWNuvOWEspivxP0QFUmp/25AD8LERznR46LfBbmtk8ULHU04nh4jsuPZSFN12istnzmPanBq cg6LDxLl33aBojDfPhp3ntjh4yN8wlYFa54OZKzYB44NWrZxR2Al0/1LNA6/4l37EC3V2fO+UjTY8 9GHacTL4FQY4MeO0SO/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1h71-00000005Iif-4BGz; Tue, 30 Apr 2024 06:37:12 +0000 Received: from mgamail.intel.com ([198.175.65.18]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1h6z-00000005Ihr-06fw for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 06:37:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714459029; x=1745995029; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=KGo6hIvlY2DFfXRayOwhLfEDabosAECVdBp2tiThtkc=; b=hoRvAt7TGbX+xaXfZdc8MYYqxWSdJ77TGFLigGmqFYybHfLYXUR/HtoK le+piwJ5rc3JAf+2e4wQEWO1lw9g/6ZExHqw2rvcaq8mQLlQsZC4CPfL8 JNK1zCnL7ddrXVZwAvMs3jnkGp6gb3jfQ2YDpAqT5QZUWaGPBySIwEWyj +6aBIUtz7wPv3EaWAAJrqG271dAbOacUqtX7sczXN5JnKjAuwfNX+HzUT qbponyT49cuN9a51EhC5YPOILaom5RW4lrhqhloEbJfTyU416LMrtrc63 I/jGBZTvNBi9J1FcVENc0sgHDuobTgQkiQaqy7T2ELJQTHaBGkanu1F7S g==; X-CSE-ConnectionGUID: A3uXrvNATaqLcM9U37SAzg== X-CSE-MsgGUID: AS10trXDT8OIEK/4wOg4Zw== X-IronPort-AV: E=McAfee;i="6600,9927,11059"; a="10316005" X-IronPort-AV: E=Sophos;i="6.07,241,1708416000"; d="scan'208";a="10316005" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 23:37:03 -0700 X-CSE-ConnectionGUID: kgMW4csVRV6x1K/Yr6uucg== X-CSE-MsgGUID: 8JTDsJIoQByUwUenbUVmng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,241,1708416000"; d="scan'208";a="26973237" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.49.27]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 23:36:53 -0700 Message-ID: Date: Tue, 30 Apr 2024 09:36:48 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 02/17] perf auxtrace: Allow number of queues to be specified To: James Clark , linux-perf-users@vger.kernel.org, gankulkarni@os.amperecomputing.com, scclevenger@os.amperecomputing.com, coresight@lists.linaro.org, suzuki.poulose@arm.com, mike.leach@linaro.org Cc: Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Jiri Olsa , Ian Rogers , John Garry , Will Deacon , Leo Yan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com References: <20240429152207.479221-1-james.clark@arm.com> <20240429152207.479221-3-james.clark@arm.com> Content-Language: en-US From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20240429152207.479221-3-james.clark@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240429_233709_188576_374DE9DB X-CRM114-Status: GOOD ( 20.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 29/04/24 18:21, James Clark wrote: > Currently it's only possible to initialize with the default number of > queues and then use auxtrace_queues__add_event() to grow the array. But > that's problematic if you don't have a real event to pass into that > function yet. > > The queues hold a void *priv member to store custom state, and for > Coresight we want to create decoders upfront before receiving data, so > add a new function that allows pre-allocating queues. One reason to do > this is because we might need to store metadata (HW_ID events) that > effects other queues, but never actually receive auxtrace data on that > queue. > > Signed-off-by: James Clark Acked-by: Adrian Hunter > --- > tools/perf/util/auxtrace.c | 9 +++++++-- > tools/perf/util/auxtrace.h | 1 + > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c > index 3684e6009b63..563b6c4fca31 100644 > --- a/tools/perf/util/auxtrace.c > +++ b/tools/perf/util/auxtrace.c > @@ -218,15 +218,20 @@ static struct auxtrace_queue *auxtrace_alloc_queue_array(unsigned int nr_queues) > return queue_array; > } > > -int auxtrace_queues__init(struct auxtrace_queues *queues) > +int auxtrace_queues__init_nr(struct auxtrace_queues *queues, int nr_queues) > { > - queues->nr_queues = AUXTRACE_INIT_NR_QUEUES; > + queues->nr_queues = nr_queues; > queues->queue_array = auxtrace_alloc_queue_array(queues->nr_queues); > if (!queues->queue_array) > return -ENOMEM; > return 0; > } > > +int auxtrace_queues__init(struct auxtrace_queues *queues) > +{ > + return auxtrace_queues__init_nr(queues, AUXTRACE_INIT_NR_QUEUES); > +} > + > static int auxtrace_queues__grow(struct auxtrace_queues *queues, > unsigned int new_nr_queues) > { > diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h > index 55702215a82d..8a6ec9565835 100644 > --- a/tools/perf/util/auxtrace.h > +++ b/tools/perf/util/auxtrace.h > @@ -521,6 +521,7 @@ int auxtrace_mmap__read_snapshot(struct mmap *map, > struct perf_tool *tool, process_auxtrace_t fn, > size_t snapshot_size); > > +int auxtrace_queues__init_nr(struct auxtrace_queues *queues, int nr_queues); > int auxtrace_queues__init(struct auxtrace_queues *queues); > int auxtrace_queues__add_event(struct auxtrace_queues *queues, > struct perf_session *session, _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel