Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp145874lqr; Wed, 5 Jun 2024 01:26:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqCfxW/sZwHaIN5B2udfh2v+k2TlKikAiD8v2Dk+PUBivmKo6lGvN+Ik6xrHcIJbVfJlB4m40cxEGt4X4bz+2VG8GXaG6CKaseHjK1rA== X-Google-Smtp-Source: AGHT+IFo8pnV5MGCnSJhMCP29AbTi1NA4MrffrDTAtIXyfDrxJeOwGWm8Qodwtz/8svorjujUPtK X-Received: by 2002:ac2:5f9a:0:b0:52b:913d:1c62 with SMTP id 2adb3069b0e04-52bab510184mr1300603e87.69.1717575971790; Wed, 05 Jun 2024 01:26:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717575971; cv=pass; d=google.com; s=arc-20160816; b=RpCBg2izuMkwm4TNRQavbUMiIYuN9aFh5hW/W7plHbuPlCAf2zAPKoD/bLfdHC4vNk EGnzQBo1sD09+i6HRflHo9gBg/Xb8uGwJGAj/AZ8RN3OFmYWMm+iSeY9Efh8ZWANPksN Fm/kC6Ciuh/aJBDiqDSFMFFJM0UK/a4MYvq2OFVPTXl4iHVEfsQr4UhC7Rpin+BWRpcX uItwwJiIbcNTmI3A6jEuO2CiEZ93MesVapeKa6WsxZ1QmZSiboqdoF4enpT1KBhbH5KO ZDQWyprED00OxC1YUNEi6lTSeiHFf2/syo6IJPYsr1BD3IInm2/jS0TpzMyBMGRVcsli 5xHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=hGp4tbVcrDhhfGF6C+3QsryHRzPYYuOTE1mxUjQFxlw=; fh=Z7iuKXbCkOT0vzAwE0QNZPr/Sc1rdmfrPlWXOfcl2HE=; b=HzDi5KrC4SjRgaYEgqhrOtVg2OmD61lad8XLxK8Wz1z8BLPuFanxtUHqkfOPT5269k 3CPbuAAUV/uWD+C3Z5MDULIUWNoCGZbZrPc9peR3XQ6w4onPpvy1ByIMk1HCbwFL0DtX K9wgEZkPw05K9VZ9RDBX0Iv2dG/XRLpfi0DiJsKD/EpEgGnULgcUHzv9mZETJUa0HVCQ K0ZFhRqhZl4Bx1VvCil2Ng/5eyZiiQmFEb72eRyG/zDkBDIWOJaZtys5Bw+O7T9/t0np l2ojNWQCkJl++xwer4Sk8dDlYAJr6c6VQS4rNczU0BFmteb7aoIvCoMKwApp0JrKtwv1 vbTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-201985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68c9fa1af1si386061166b.682.2024.06.05.01.26.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 01:26:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-201985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201985-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7C15B1F243E5 for ; Wed, 5 Jun 2024 08:26:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 36A671946C4; Wed, 5 Jun 2024 08:19:35 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44B0F1946BA; Wed, 5 Jun 2024 08:19:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717575574; cv=none; b=gnw7OV0IXW7z/TmV3uO7iXe2ALoZBZZwgWdvhhQPSnDyrra06JA60QQu3zhtqEVTMOC6Z3BIg0ZiPn6xGvPHWorjLQSpAYIoVuTKLN64abXdSTuoMUaXcW5IK5LgifAvvoLqk2OigltbInOLnBpeod3wlnYtu/vX7wk6hpLp9VA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717575574; c=relaxed/simple; bh=J11oghjLd2OL4EAzmLeais99j3IPznPLv+/4AFGSym4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=f6+jb6bnzmr8amvd1eN8QuLxyg+Xdle7xbkVqQelMwORLL5d3GHKGzLgfPRg9sILEX+YhLToRHPMyfQ4spl5SsSNwi2pgOUQkitOWk3inpRBjg9uLwWlpq0yllR7nrBTnx2FDS8+krd/SLVec5l3pjhKSGHblASkdSFnu2IAQH0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 81375DA7; Wed, 5 Jun 2024 01:19:55 -0700 (PDT) Received: from [192.168.1.100] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BF1BF3F762; Wed, 5 Jun 2024 01:19:26 -0700 (PDT) Message-ID: Date: Wed, 5 Jun 2024 09:19:24 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 02/16] perf auxtrace: Allow number of queues to be specified To: Adrian Hunter 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 , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-perf-users@vger.kernel.org, coresight@lists.linaro.org, suzuki.poulose@arm.com, gankulkarni@os.amperecomputing.com, mike.leach@linaro.org, leo.yan@linux.dev, anshuman.khandual@arm.com References: <20240604143030.519906-1-james.clark@arm.com> <20240604143030.519906-3-james.clark@arm.com> <12c09d40-788d-4af1-9eb6-0f5699875d70@intel.com> Content-Language: en-US From: James Clark In-Reply-To: <12c09d40-788d-4af1-9eb6-0f5699875d70@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 05/06/2024 06:26, Adrian Hunter wrote: > On 4/06/24 17:30, 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 > > Again ;-) > Oops yeah I should have picked that up. This one was already applied to perf-tools-next as well. Thanks >> --- >> 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, >