From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792502638; b=ZM4asNnjyFjQ6zcYA90JwxTElVka4xpeSF1C6bN/iiMi+Xgs9EWHDFI9TzX2uMAtrpYw FLqqYToSrLlgCuDWBzQNAIg8j9CYSRpoNz1yKWNWntgNtqqIfrEaxh1bsrL/6c0WI+dkN Ups+NlmWvxg8Zc4tC5YEPH6EUPdSTjCtELyRphEOnUepLxFDZ/VW/9ioIP4ma0P9T4qMX 9vNa70qw7j+5y2fpPqyct5QsfFNuzGfbQbCcWQhmANGUsAjKCB4RbVF9BsNOyKsQoJCBx KYPLhUzjk6MX92JOQ+HuH4hclovcyfZHgkJVYsjUhObupDI1T0vdFxyH2DJFf5XpFjQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792502638; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=T2uaYBqUftcRpD2L16JDkdO6wqmonuMoZFfOWWQv7Gg=; b=iVW6HLnmRsJfl8nO+gWmFmUinqWXyIh6YVHtetn4ekRjcKB8V7VdtfnO7kp7hCgOAvzE 92VTD8I/6rSLyGcdkZsM7NT+9EaKezEJt+cQe1mo/7/06hlk9ibhoqM8PBEc/GpyvSLll d4n3res16mvJsX0cf7AhWYBKctnEU3iIRY91rEhfJJGa9mcDhXR2EKHTTwzbVMxRpFV8H IgZdbCRp3g5RIWbYaVAUv+IR/qF3SW1uGC7U0yn7x+T8Aoj30n/LVKVPajplIfsIo24aU S2ZafCkR150S51j+la/GJzm4Dk4wlsl6eEzGqa8p/KjDBrLFMSjaeVDeMS0w755YSNQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TUnDbbJ6; arc=none smtp.remote-ip=209.85.128.48 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 660FD606A338 for ; Tue, 20 Oct 2026 13:23:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 660FD606A338 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TUnDbbJ6 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4a1efc90e7cso4369655e9.1 for ; Tue, 20 Oct 2026 06:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1792502637; x=1793107437; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=T2uaYBqUftcRpD2L16JDkdO6wqmonuMoZFfOWWQv7Gg=; b=TUnDbbJ6pu9r+QN0gnuvY663hk4hHY1RCA0GjoO0As/x+/jReLTgoosYhEFRmvbuXD Z1v81IluqYPJElSH8ZndEpfUjKZCAouMKjQSVHdbkG8Y/CQQ+9nvFs3P4an/XEwcTGvw qaJ4J9pJsiRD+lta+FH+4wZTFrpXpW6neGfqi06aJcBw2dHjdnN3GdX/86+t5puH2yQD TX9uX8X30tRzlS3ibC0wc86fm9SuGmbHKvHQOYmeMb7y8ctBpA7wjUAmWZgUhdMRjv1T +yg6+zhbeOv/Z9dP3EHqBRLwoU49JaqaKm+F5TlgieBy2hhIHOp/fgqvVkVEKgM8gXMY Gt2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792502637; x=1793107437; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=T2uaYBqUftcRpD2L16JDkdO6wqmonuMoZFfOWWQv7Gg=; b=D8Ny+0QKDxjbqZ1oliE43KK+oHOk/cHpc9g/4BP0t4bjFhwAABh0KYR/AQnhsutzu+ B3jpPBHbqFKrd7xlM9P40osaOea5thNfcsaN3iFCy23vphLMe+WzcpMukxafZh2+aKTQ 7pyeGMd/ZH6mTiE9AVXPUPHaK5xiQfnIe8lSp1585xl2y8J8uKbL0NZVaJ6W+mkUEgvR kVo11Jy3KuImuPiD8AO4HyEZJyNNcwnCZclAhKTsn592zRGHIIwgGc7lrcSUjzUaCKPK OdBNG4ZG9Sawgw7Z359YTG/lvCe1KAKetNjli9MiJrPAiIc7Bu3eagepEtOEGxMe5yHp qXsw== X-Forwarded-Encrypted: i=1; AKwUvByEKDXNksSjXICHWxmLDJyuDiyCUlogLUtymrpkVAXCM1jdWY4vLHnUDzvNKMLUWJ5ARw9JKwbsjzo=@vger.kernel.org X-Gm-Message-State: AFq9FYLMz5/H1ag3kya1CVWflbT6MpPOdAWXWOwaCcpkhqVnBTkwf5MJ NPXJBkAhefCHU2HKIMe10pX0YSlg/W84cpldSSPmnL0eqXxe7mFhqloEvgocx+1Y5b8= X-Gm-Gg: AYBFou3Y0Y7dtEHy27zRQ8zHw6iTI9EyarTV+p2bxbKu+NxDZuf3LAD1aHO7grCyuwF T7V1MEP2KfdhMZOOVdEMVL7xdpNEZ4X6+GDTQVwcjMg5GyaNY8ZWc4nL/T88PnEq5SQowzYyUw8 RGMMqXB8yaHK0jcPS9vec2MKMioHS85wwK65dEUnqttcmFEuL0WTtHE5zs6BRE8i+ndg2Q6Kiwb GrPIgFsmUnMzdPo5UCdcSrvkjXwGBzLvoBoLdfhdFoK9cb+VmDv+c29lwBy9wEw7OIwXUa8eLL6 GLZS8seFune/1EqiFCsqGb1uloPvhM76ExMUjLOv26oczUOudDmzp7Id9lvCDcywssMuKYN6bni Zltw57MDRfN4hhFxHOFzH20DOEMBiIAvXti9zUtvdiZvGoMswLunuKvXlptCKVmjJUR1p6oDSQy 2DRA9Qob+/ciBAKBFQgiESqz4ALjRmwlvIYmw7CCeMH3FnjWwC74N1M3jseiU0M30yFxSOQ6Iom LkiEQVKA6KBAic= X-Received: by 2002:a05:600c:638e:b0:4a1:a7f8:c124 with SMTP id 5b1f17b1804b1-4a1f4d7afcdmr43701515e9.7.1792502636695; Tue, 20 Oct 2026 06:23:56 -0700 (PDT) Received: from [192.168.1.3] ([37.18.141.193]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a1f2ce2b8bsm74994275e9.15.2026.10.20.06.23.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Oct 2026 06:23:56 -0700 (PDT) Message-ID: <69dcbd3f-25bd-465e-a173-2729095f2dda@linaro.org> Date: Tue, 20 Oct 2026 14:23:54 +0100 X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 17/25] perf cs-etm: Allow history collection for samples with zero IP To: Leo Yan Cc: Ingo Molnar , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , Suzuki K Poulose , Mike Leach , Anshuman Khandual , Yeoreum Yun , Jonathan Corbet , Suyash Mahar , Amir Ayupov References: <20260915-arm_cs_support_aux_sample-v1-0-35cf6f297d20@arm.com> <20260915-arm_cs_support_aux_sample-v1-17-35cf6f297d20@arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20260915-arm_cs_support_aux_sample-v1-17-35cf6f297d20@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 15/09/2026 16:49, Leo Yan wrote: > Perf clears the IP of a user-only PMU sample when its interrupt skids > into the kernel. The timestamp and TID remain valid, but the zero-IP > check prevents --itrace=L from attaching decoded branch history. > > Remove the IP check and keep matching samples to trace by time and > thread. > > Assisted-by: Codex:gpt-6 > Signed-off-by: Leo Yan > --- > tools/perf/util/cs-etm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c > index 00407a80933e1c0b76260aed5894dece50b9aecd..baa962085dba5226d9729a0ee8039374d5fcb1a0 100644 > --- a/tools/perf/util/cs-etm.c > +++ b/tools/perf/util/cs-etm.c > @@ -3097,6 +3097,8 @@ static int cs_etm__br_stack_init(struct cs_etm_auxtrace *etm, > /* > * Add decoded branch history to an existing sample. The sample keeps its own > * ip, callchain and event identity; only an absent branch stack is filled in. > + * A user-only PMU sample can have a zero IP when the interrupt skids into > + * the kernel; its thread and trace window still identify valid history. > */ > static int cs_etm__process_sample(struct cs_etm_auxtrace *etm, > struct perf_session *session, > @@ -3107,7 +3109,7 @@ static int cs_etm__process_sample(struct cs_etm_auxtrace *etm, > int err; > > if (!etm->synth_opts.add_last_branch || sample->branch_stack || > - !sample->ip || !sample->time || sample->time == (u64)-1) > + !sample->time || sample->time == (u64)-1) > return 0; > > /* Adding branch history to existing samples supports the host only */ > Looks like we can fix this up in Amir's patch that introduced it when I post it as part of the JIT stuff. Then this commit can be dropped.