Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2373022rdg; Mon, 16 Oct 2023 02:15:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9gs4prlq9Fy9rB/+yLX+JG06ek08BK628vMf9C9zZZWbLGUqbsXZy/enyMymuOJUoQtYG X-Received: by 2002:a25:74ce:0:b0:d9a:485f:5852 with SMTP id p197-20020a2574ce000000b00d9a485f5852mr18094371ybc.13.1697447756440; Mon, 16 Oct 2023 02:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697447756; cv=none; d=google.com; s=arc-20160816; b=FPe8kHmOtoYpABKZChnshyPeAp67sf6FKYB4Wa1wenYdW4mQ3sjEm5WrGHEeYX/vBL ro2KBYJAOYklAP9FH1vdc+OztxEHE3hFUtUmVzs8TkJ3zLmGoTYTh1Q1hBp3Fdfd8iLX 1KM8WvCMkJPmYZJUt79MnphJI0M71Xa83uXJilOcmhvo2EY8H7BVU7vl2/BiEZFzjsTI 5aUGNxxpCjYsIL8id7Em0v4CXLEqr/wJjHVd+KPkb0YunF3D/7Wjd/Fvjn80zr3oaEfB y3S7qzwMo02b0jGErmQHovT/OHpTfAHCvpIMy2+AMwH9sOG454iO53XMzy38pocUdN/z 380A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=EycDXfCr4invtVra6biz88R9mSRP9AyaQyuD33jLYLM=; fh=UmTZk/w/pq6J7gFSAM8p3N8nfJShagI/URiCDpRFBR8=; b=o7xRFKeA3aLoEtK1r4nSXoeGq9DdD6CXAxkOIcXjMe+8iHGl3Pi+48J8VeXM2AWMp1 O2V9DhvBpi6hypWguPHPt3blYhCgS1G4964ajUn2oZpZIgtr10Ar+LzW7mquy5wMncLM l64QKcCJ0j8JGhxdsQViZpuIhw0VNk89RZLWrfloGHiQc4CJd1xyTGxwLDr2scZ9julW Yr1vJZQFyFLKcknpr6F84CCgLIcu3TA3zhhzTiAdU7eYhQqEVO+RqKiGjGFQFgZFfw6M ECcxC0AssafFF5dwnHsRtODMyxBu+1D/6wqZLycVQDRpUtw0zSQh962KNm3i9m/FFSbl ifZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id y24-20020a056a00181800b0069026254582si4980765pfa.98.2023.10.16.02.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 02:15:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 1C0E88050935; Mon, 16 Oct 2023 02:15:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232907AbjJPJPV (ORCPT + 99 others); Mon, 16 Oct 2023 05:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233281AbjJPJPO (ORCPT ); Mon, 16 Oct 2023 05:15:14 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 362AEE6; Mon, 16 Oct 2023 02:15:12 -0700 (PDT) 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 53FAF1FB; Mon, 16 Oct 2023 02:15:52 -0700 (PDT) Received: from [10.57.1.186] (unknown [10.57.1.186]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BBC2B3F762; Mon, 16 Oct 2023 02:15:08 -0700 (PDT) Message-ID: <767745f1-4d79-17f1-6c5f-a4b352b8a40f@arm.com> Date: Mon, 16 Oct 2023 10:15:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v1 RESEND 1/2] perf cs-etm: Validate timestamp tracing in per-thread mode To: Leo Yan , Arnaldo Carvalho de Melo , James Clark , Mike Leach Cc: John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231014074159.1667880-1-leo.yan@linaro.org> <20231014074159.1667880-2-leo.yan@linaro.org> From: Suzuki K Poulose In-Reply-To: <20231014074159.1667880-2-leo.yan@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 16 Oct 2023 02:15:43 -0700 (PDT) On 14/10/2023 08:41, Leo Yan wrote: > So far, it's impossible to validate timestamp trace in Arm CoreSight when > the perf is in the per-thread mode. E.g. for the command: > > perf record -e cs_etm/timestamp/ --per-thread -- ls > > The command enables config 'timestamp' for 'cs_etm' event in the > per-thread mode. In this case, the function cs_etm_validate_config() > directly bails out and skips validation. > > Given profiled process can be scheduled on any CPUs in the per-thread > mode, this patch validates timestamp tracing for all CPUs when detect > the CPU map is empty. > > Signed-off-by: Leo Yan > Reviewed-by: James Clark > --- > tools/perf/arch/arm/util/cs-etm.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c > index b8d6a953fd74..cf9ef9ba800b 100644 > --- a/tools/perf/arch/arm/util/cs-etm.c > +++ b/tools/perf/arch/arm/util/cs-etm.c > @@ -205,8 +205,17 @@ static int cs_etm_validate_config(struct auxtrace_record *itr, > for (i = 0; i < cpu__max_cpu().cpu; i++) { > struct perf_cpu cpu = { .cpu = i, }; > > - if (!perf_cpu_map__has(event_cpus, cpu) || > - !perf_cpu_map__has(online_cpus, cpu)) > + /* > + * In per-cpu case, do the validation for CPUs to work with. > + * In per-thread case, the CPU map is empty. Since the traced > + * program can run on any CPUs in this case, thus don't skip > + * validation. > + */ > + if (!perf_cpu_map__empty(event_cpus) && > + !perf_cpu_map__has(event_cpus, cpu)) > + continue; > + > + if (!perf_cpu_map__has(online_cpus, cpu)) > continue; > Acked-by: Suzuki K Poulose