From nobody Tue Apr 7 14:03:39 2026 Received: from mail-dl1-f73.google.com (mail-dl1-f73.google.com [74.125.82.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C1C9371048 for ; Thu, 26 Feb 2026 01:35:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772069744; cv=none; b=O8h7CKmUQh5dQjStiDIC31088zn7BouSDHWLajTmbnh6C12mq7YLrZ3jC2mjjt74Bdi3MxMtgsmBea72pYSxeivv0fKnn5VmAQRUSz21iti1NYcfM/79luMDn+8L/fQ1N5DkN6/lFbATIYDtJulubA3VVPiC2STcgiyCNjP+Fa8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772069744; c=relaxed/simple; bh=fFQHaIikBJyovgPGOeGhVTXIPkPFPK5i6n37FVjI1fc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=rvXdBnGFMS4nUcDjql8z1WdHZ0yLDOZFtquWgoUaTmRI1NM2zosVKZcVscHDFukyVhvfk8YM2Mt4Puq0B5kpiRmK6q47u3f2SCI0o9k9Yc60hUeVqL/AU1feKC/grRrre1uxuc35155j/myCX3dZNd63v4lx+blz3jmkLVVyD2E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=zhlwBeIF; arc=none smtp.client-ip=74.125.82.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="zhlwBeIF" Received: by mail-dl1-f73.google.com with SMTP id a92af1059eb24-12711967e0eso417628c88.0 for ; Wed, 25 Feb 2026 17:35:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772069742; x=1772674542; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=RGUY7F3cp7tvyDfn/CEjTzbckjduIBZzlL3vEOWkjFQ=; b=zhlwBeIFPGYBjABu9OqlcRLe5WxED13vX8QXUZVfORWfZzBrriY2BouzuwaOGQHAdN C1FtL77hDYlUhAxMjLqlCXwrDqsD3BFn87CzVrEy1TmT93TBuhEwYIPk7j9qjqElitnH 5S+fboU2PBM9/5BZGpcBUqNnJ87IbKyw3H9lF31EBh/IeG/72MJqCZN7h8DmG5rgsuNE mST+j/DoSB+PAcW4i+AwGwuamxV+V5JrJOzY42vkQi4IPe+RqKqyfbyZ87fpkiQcFXFs 7RKOXci7T1Ys7+ShNInUPDewO/MphZS7Ydr/CXVvrGqWN17vIb5Qcnn/44Z2iEy+xkmF Y1oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772069742; x=1772674542; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RGUY7F3cp7tvyDfn/CEjTzbckjduIBZzlL3vEOWkjFQ=; b=kXzbmnRUAfQRDC9oHw+B3nGsG7tEAuAfTyPeyau7cQqcN7VamLwUBYxNrx4xcXNOKS jVHlC0oc0/gdDXJpenUwxJrG3YGDy3Wr2h5jTGd9zEL6G5QgHDfkUxPYnsBLOViVd2Ea TNk4sqvxqd+e9TcunxXF3LQsQo1K+rnOSNxq1HQDWTRKdBqJ7nFdv9BmQbQqb/Jt2g97 o0U5ex8ZNesUiQ70P7hkm8vbEfoIXUNUl6mGSVE/6V6zCOpjozaSuc0QEZgOJ9ohK90L wMImwohqIFxfF7TRWkFFg6iryVHUGvprSzkA4oK8vO/hH6CNzQ129ZSaDwKKACSKzSQV 7KjQ== X-Forwarded-Encrypted: i=1; AJvYcCVdPsIuZniVM0j7TkOrwaWg4wc4UI3l+MRHl3CCcpQy8egGeGamt4Q+gLZ52Ez6S/EaeY/GzpWW5xxgMHQ=@vger.kernel.org X-Gm-Message-State: AOJu0YztNVB3/QnbFbiKUbQu6J+ArcKx1cqYXwwldMkbV+ogw1K5SKhX Ind8slGfsPX+gUTYEgfb4vMNYQAMjhWOR25iHQsNJqVkTE7mBZCcBGcdSdbjmy+FxQPXe7HmY/1 ktrwdtLyeCg== X-Received: from dlbbz13.prod.google.com ([2002:a05:7022:238d:b0:127:dec:f86]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:68a5:b0:11f:2c69:31 with SMTP id a92af1059eb24-1276ad6a75fmr7633930c88.46.1772069741988; Wed, 25 Feb 2026 17:35:41 -0800 (PST) Date: Wed, 25 Feb 2026 17:35:30 -0800 In-Reply-To: <20260226013534.2028272-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260226013534.2028272-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.414.gf7e9f6c205-goog Message-ID: <20260226013534.2028272-2-irogers@google.com> Subject: [PATCH v1 1/5] perf clockid: Add missing include From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Derek Foreman , Thomas Falcon , Howard Chu , Swapnil Sapkal , Anubhav Shelat , Chun-Tse Shao , Hrishikesh Suresh , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" clockid_t is declared in time.h but the include is missing. Reordering header files may result in build breakages. Add the include to avoid this. Signed-off-by: Ian Rogers --- tools/perf/util/clockid.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/clockid.h b/tools/perf/util/clockid.h index 9b49b4711c76..33dbd8673c1c 100644 --- a/tools/perf/util/clockid.h +++ b/tools/perf/util/clockid.h @@ -1,8 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0 */ - #ifndef __PERF_CLOCKID_H #define __PERF_CLOCKID_H =20 +#include + struct option; int parse_clockid(const struct option *opt, const char *str, int unset); =20 --=20 2.53.0.414.gf7e9f6c205-goog From nobody Tue Apr 7 14:03:39 2026 Received: from mail-dl1-f73.google.com (mail-dl1-f73.google.com [74.125.82.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07C95372B49 for ; Thu, 26 Feb 2026 01:35:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772069746; cv=none; b=oog/MQkxO2qZ31zOcSxUwiLpY+VR56QTc8HBreZQM7t03r4DjPTNUgo7sG8GJ1PryOWJYcf+b+OA8QgYYUA5LAtzUMWSyPnI2+UsBtjlw4GI9rXbnwelICWlpR5/hpUl1T39cGADGD1SKKCVsfB6ehIxijIoeoSVo1BqAslAs84= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772069746; c=relaxed/simple; bh=eeNwYpEzpgEXFZ0Jhoxog60AAtz/Jn9ONeyPQyjQ79c=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=hT1fme9MfLhPDVbHifwwiLLGcBfFLR0jAbJiNFyL1BgRO8nEKPP+y457HdUYJAHzoxd2WjTAz0OJ45gMrpTHACo4jpzAbWvc8+wI7/4nH2pCdEAvPAhY7tMcO4+gUQlpgq2yGZJmOubQnG6Zd5jubiz0XZSbPRlZc4CPx+8ZVVQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=KC6ullVG; arc=none smtp.client-ip=74.125.82.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="KC6ullVG" Received: by mail-dl1-f73.google.com with SMTP id a92af1059eb24-12737f276a2so663225c88.1 for ; Wed, 25 Feb 2026 17:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772069744; x=1772674544; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=8Gmm98xZ4+RrHvD1WFWJ4a3sf0CYZy8dqlD7KsFsh0w=; b=KC6ullVG6/b+EvmbJIGD8XpihMrSDAFnly4fNIOo0bJaTIEV5wydhzYKJLjMY8AB6b P0iQ/8MGrWwg45lDx+KHSooEmzn+jFXTyaANpMFpOtKFMR9rZjCRpNH03+o5o5+zHPrp wdSuSMDutmOA82flV2Evy3Pnv6TQYHxVvONV7ttqd7a84inEs9sDSf6y8oqZLm7fIo4c B07W/WFVUFmgyXGZEHvs7y8KznD8CXof6nWWKNxiGIWfZ1aXAzwbD2InDOksRoSKqN1a OVLFjfLs2aK7R9y9OC+nkDAZMxBOqFEQog30rQiL7GIUle6G7mpIA5MSW99+dwl9QwJf fXKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772069744; x=1772674544; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8Gmm98xZ4+RrHvD1WFWJ4a3sf0CYZy8dqlD7KsFsh0w=; b=eWo59bG5fd/hJIvP2NB++Qr5CddiQ4vJHgskdFSe5BghYVrOBtXkn2192rD7VFb0jt Kj274B0iJ2LLDvSV00djzb13VLbFLnoxgqMz+dtx4INcQGWk88slUkv0JOhNcqIwg/me ATAkZvh/ijtha1PlxHyS/e8/UmEkJQdrdcYpC3uqR0mMISSYBiVv1A1X7wNJnGLblFmC ThUKf2rxIxNyFM2lQFZ3bXZEPD+RHmsQoggf+rsNdTCWCgZmubaB9ifRFxWgicj85Zf9 JSPcaqecK8d3f80ubqOelJHHiGUW05fb9YR62NAr95ZnXJtB29wfid804aTFwg3NAFlN 5ojQ== X-Forwarded-Encrypted: i=1; AJvYcCUpwN0c48XXwLD4m55WmauEma/J/SP1siknA+jHmmYl6IO6FOU4S2KgEHD4T+iAyeNk8fExnKTqm32P3Mk=@vger.kernel.org X-Gm-Message-State: AOJu0YyWfbx6s2pCLOFGa+IaUoP6e2anB7nOAj1x2G4yTaoi1wUu40pn X/559P3GZs6dIt2smleg5tGh9RXFkDQtMb1EqKcY4pcUosqA8D/ZAwsnRvu7Jt9WZS9/3ni1FLK NiOzD6xV4yg== X-Received: from dlam6-n1.prod.google.com ([2002:a05:701b:2086:10b0:11b:bcda:45a9]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:660e:b0:127:148b:3fcc with SMTP id a92af1059eb24-12789c55ba8mr281096c88.8.1772069743977; Wed, 25 Feb 2026 17:35:43 -0800 (PST) Date: Wed, 25 Feb 2026 17:35:31 -0800 In-Reply-To: <20260226013534.2028272-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260226013534.2028272-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.414.gf7e9f6c205-goog Message-ID: <20260226013534.2028272-3-irogers@google.com> Subject: [PATCH v1 2/5] perf header: Add utility to convert feature number to a string From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Derek Foreman , Thomas Falcon , Howard Chu , Swapnil Sapkal , Anubhav Shelat , Chun-Tse Shao , Hrishikesh Suresh , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For logging and debug messages it can be convenient to convert a feature number to a name. Add header_feat__name for this and reuse the data already within the feat_ops struct. Signed-off-by: Ian Rogers --- tools/perf/util/header.c | 7 +++++++ tools/perf/util/header.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 9142a8ba4019..fe5d21dde04f 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -3770,6 +3770,13 @@ struct header_print_data { bool full; /* extended list of headers */ }; =20 +const char *header_feat__name(unsigned int id) +{ + if (id < HEADER_LAST_FEATURE) + return feat_ops[id].name; + return "INVALID"; +} + static int perf_file_section__fprintf_info(struct perf_file_section *secti= on, struct perf_header *ph, int feat, int fd, void *data) diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index cc40ac796f52..ca22030a1434 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h @@ -132,6 +132,8 @@ struct perf_header_feature_ops { =20 extern const char perf_version_string[]; =20 +const char *header_feat__name(unsigned int id); + int perf_session__read_header(struct perf_session *session); int perf_session__write_header(struct perf_session *session, struct evlist *evlist, --=20 2.53.0.414.gf7e9f6c205-goog From nobody Tue Apr 7 14:03:39 2026 Received: from mail-dl1-f74.google.com (mail-dl1-f74.google.com [74.125.82.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC827374730 for ; Thu, 26 Feb 2026 01:35:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772069748; cv=none; b=lpGfWkClu1m38PzcLOo0EPmPi6D0cJ7rQ1B+huKy5bqhp+U/cjULw1R+4MWcIJYY3Q/QoQ8tn53O+AzvQ6ZGSvfLG3rzdF3QcgDUaUTU3HZB1wS99QEvI7eGXb6VrF1ZS94lpk9dMSe9g31VSXDH0TdQqJisdUzgGhWHhgNGhck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772069748; c=relaxed/simple; bh=3JJGfY5woUOx0TG+OwEWhTR6OLBQHwrZtwdkVNqVpyw=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=LQqgDVdjIBxO1AZKeCKRShbuU4k/oxYlQsxej8B6lcGEKBHnNKYxijK04J6ETfzb047F91bkt8W0h3KSyjs4FEoNIrEuGuRs7EPKAdrH2u+5dIyuYz4QzcPgzKmYUyHYaR9s3uQVyVInlTYdHs29vIt3qZrihH8kSv34FL3F6P0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=p+cRS9Uc; arc=none smtp.client-ip=74.125.82.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="p+cRS9Uc" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-124a95b6f61so7636763c88.0 for ; Wed, 25 Feb 2026 17:35:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772069746; x=1772674546; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=fWZ6y6IFxHAgFeyLM3ooC5TMMGVf3kLN1hG+BiPigK4=; b=p+cRS9Uct+HVUHUfS6dZoFPqvrFIZBlKJVrvc4KPXVbSB+ttmJWW02cdn4ZdZszM2s Y/Zvu9LbxpEJ9AvUreUsgN3Y0/dNJVakRf/rJtlDtMjgPksPomxwLmSVJCCGxsF8IogZ rNYj3fCB0/XXVzPmHGApDSnGfuhAaT7c8Kj/Q9xbp46aLd46qHjaS76pTmIKU6cp9Cbi yQbdBHFcJhvi/oSf78lj4Aq2HKy34GaMBenQ4B6k2IBZJyVyoyZxlTV7PX077ZvNL+uN ruqQft91dixHivVrg7stSiXLh/SfJayK4baJda2HqC0f48T71cbuByYoHxPQ260vd+me Qhjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772069746; x=1772674546; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fWZ6y6IFxHAgFeyLM3ooC5TMMGVf3kLN1hG+BiPigK4=; b=BAWrFf5yyre0loJJQqgBjG1DZE9bisqWnxfJWpebsUF9tcMIknCuhDUNbjhz1Z2A8c r8tdI1CaiAenHGsQGo39V26UApH/RmUcsgUny+nNWbTyFca3fo+W1j/pc/PNNLTSYClG st5hAEXqAZFdwbwf91YvBJVy+C6I0dXX67eyH5UqnzLWeX7wQMaBOlMhGxcMye1zx6JK CNb4R+OpPY48EEVhJhmyEBRxsCJRu4WdhfZ+W0/Rt8pp4NOG3qfYtC9A/TvjQJyVam7j eqj8RYDD009wWiqTf/RyvmoB1kcHpT0gEwOtpAjyaafnb1I1pX0id3e9j2axH5megyES 3o5Q== X-Forwarded-Encrypted: i=1; AJvYcCWheL7MBAr3KO+vyzBnORVpnmwjHdj1JWasNBSbdBzOEjC3sEMH/aMPnisn4iwW420OhSqom5Fsx4kVQSo=@vger.kernel.org X-Gm-Message-State: AOJu0YyCyvqFuPhEefUGg1eAyLc2PhrleAqSfNW5GUd3WGuiSkaLwixg 6Q8rvkGy9BR+7j8RPZ1e3TDREKnJ9DWNq1NzE1Zp5v9h2RYC/oOMvBzrVzq5VAW6vyACVDixD/Y YldWg5VN0LA== X-Received: from dll11.prod.google.com ([2002:a05:7022:20b:b0:127:160e:f9d8]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:160c:b0:122:2f4:b24b with SMTP id a92af1059eb24-12789cb3c05mr281498c88.25.1772069745742; Wed, 25 Feb 2026 17:35:45 -0800 (PST) Date: Wed, 25 Feb 2026 17:35:32 -0800 In-Reply-To: <20260226013534.2028272-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260226013534.2028272-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.414.gf7e9f6c205-goog Message-ID: <20260226013534.2028272-4-irogers@google.com> Subject: [PATCH v1 3/5] perf session: Extra logging for failed to process events From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Derek Foreman , Thomas Falcon , Howard Chu , Swapnil Sapkal , Anubhav Shelat , Chun-Tse Shao , Hrishikesh Suresh , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Print log information in ordered event processing so that the cause of finished round failing is clearer. Print the event name along with its number when an event isn't processed. Add extra detail about where the failure happened. Signed-off-by: Ian Rogers --- tools/perf/util/session.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 4b465abfa36c..7f3ffbe633af 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -131,10 +131,17 @@ static int ordered_events__deliver_event(struct order= ed_events *oe, { struct perf_session *session =3D container_of(oe, struct perf_session, ordered_events); + int ret =3D perf_session__deliver_event(session, event->event, + session->tool, event->file_offset, + event->file_path); =20 - return perf_session__deliver_event(session, event->event, - session->tool, event->file_offset, - event->file_path); + if (ret) { + pr_err("%#" PRIx64 " [%#x]: ordered event processing failed (%d) for eve= nt of type: %s (%d)\n", + event->file_offset, event->event->header.size, ret, + perf_event__name(event->event->header.type), + event->event->header.type); + } + return ret; } =20 struct perf_session *__perf_session__new(struct perf_data *data, @@ -2110,8 +2117,10 @@ static int __perf_session__process_pipe_events(struc= t perf_session *session) } =20 if ((skip =3D perf_session__process_event(session, event, head, "pipe")) = < 0) { - pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n", - head, event->header.size, event->header.type); + pr_err("%#" PRIx64 " [%#x]: piped event processing failed for event of t= ype: %s (%d)\n", + head, event->header.size, + perf_event__name(event->header.type), + event->header.type); err =3D -EINVAL; goto out_err; } @@ -2225,8 +2234,10 @@ static int __perf_session__process_decomp_events(str= uct perf_session *session) if (size < sizeof(struct perf_event_header) || (skip =3D perf_session__process_event(session, event, decomp->file_p= os, decomp->file_path)) < 0) { - pr_err("%#" PRIx64 " [%#x]: failed to process type: %d\n", - decomp->file_pos + decomp->head, event->header.size, event->header.typ= e); + pr_err("%#" PRIx64 " [%#x]: decompress event processing failed for even= t of type: %s (%d)\n", + decomp->file_pos + decomp->head, event->header.size, + perf_event__name(event->header.type), + event->header.type); return -EINVAL; } =20 @@ -2382,8 +2393,9 @@ reader__read_event(struct reader *rd, struct perf_ses= sion *session, if (size < sizeof(struct perf_event_header) || (skip =3D rd->process(session, event, rd->file_pos, rd->path)) < 0) { errno =3D -skip; - pr_err("%#" PRIx64 " [%#x]: failed to process type: %d [%m]\n", + pr_err("%#" PRIx64 " [%#x]: processing failed for event of type: %s (%d)= [%m]\n", rd->file_offset + rd->head, event->header.size, + perf_event__name(event->header.type), event->header.type); err =3D skip; goto out; --=20 2.53.0.414.gf7e9f6c205-goog From nobody Tue Apr 7 14:03:39 2026 Received: from mail-dy1-f202.google.com (mail-dy1-f202.google.com [74.125.82.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DADE7372B35 for ; Thu, 26 Feb 2026 01:35:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772069751; cv=none; b=EzwtQSeaPwbQB91MPTg3BGmXv3lyo/F86GoYpjz1tnrIcqxXmC8ZW5YtyvEYdmgUIFwT3d7+DYSjU/iIn1bF3GuT56fR6tx897aHATEyXT2mLy2637s/NwaB7P+spQ/axP59ttP+xrLTI/PAH8NRGCvoFHqJOYPMjdAwHFzFlog= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772069751; c=relaxed/simple; bh=IEvWPW1n7/Kn1d5hPQcRgfvhpDORPss82dHoBLWLewc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=SPfpQkPVhEv4L9HAbS0cQQU6Fg/sXsnFJ+IvxfojR4NHAtMms7LIhrwT2EmXmEWIR2fi5MHT7VD2N8beBOGQRG4TrUCzTwfptNQu1qz4LeDU2poiiGjgBXFdvX9uLUoMOMY0Yihiew/OpXL0Mhxr4lO6XyvGSx0F211rfLvyht4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=EejhiDGt; arc=none smtp.client-ip=74.125.82.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EejhiDGt" Received: by mail-dy1-f202.google.com with SMTP id 5a478bee46e88-2bdb0c8c5bcso6220265eec.1 for ; Wed, 25 Feb 2026 17:35:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772069748; x=1772674548; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=1Ch336a8cLBjghfuvU9mziTIw0yFRPT1LCJ9GsF/8Iw=; b=EejhiDGtbs5+VzW+pH//o1wRMk+GqzRBXLVs6FPxBGPA7voWHCzKbefgYtt5wQbuBq u+eAA59rA6Q8NJwzMtHLEq8xPVBEod9QgbGRexJvEMLiVCeDZfO88sPyAjlmQ+SkSp0I LfikDE0wlKa16tYsGW/bKZGaFjIwmY+jGxwp2JSZFfTDe4o/OD10wgOCkuEQ5zeTYHhe og5ozeHKlwsjSzXeFf3Vb5LP7V2isBmdBL/Frf8w+OhNJBDHnL/QycmJl/zVCOWi5mxJ lav8yRraDV4p1l30TIw00+7Hl8KShif39j4EcLW9jPE8WLLZfajFHBXSKw4/0vto2xlq 2nZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772069748; x=1772674548; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1Ch336a8cLBjghfuvU9mziTIw0yFRPT1LCJ9GsF/8Iw=; b=WDA3tk1Kc8PWX/Sc0ZR1HZq1cGamwFgdhOMHnXN6PDBulb4Lqa5fkG8c34PGpXNV8q qaJzZu2EG+35hjdLsOguMEQ+SbdXVLZFpVLhwMyidf2OFVxlm8GA2Id2GHMXi6jlPA0y A1BJ7cwgkxv3A3xpi38oegFPm3ak9AuQ2amqRondxxgRQXi4qU8MXniDyGIaAaQiTWiJ C/I9AZBBT7DzQM1Pmc79ehJ6a5AKa/7OIrPgKJWbAZ0RrYOL2rdX6MYj0tX5sjOn1lY/ ZmWF2TLurDEHGYvUNo5knNAgfXG/QKeR/gVT0OIHH0lVKEY8EORIH8JIfLdbG+Y+z3Ub SEhA== X-Forwarded-Encrypted: i=1; AJvYcCWygZ4ax5v9c9DZbFiJIYGgKqna36WS6ZXX3SkzUmdRNp+khMKjlshmI+MzDI++njWEQNxMf5AJfzPBMYY=@vger.kernel.org X-Gm-Message-State: AOJu0Yxz3epwj8MaBm+8YLWqbcz5lxeWU7tt27Y21gvHNrn+rqFypOnm U7kciFiu9re2h6xABlRJuFwvJ+vRAcWIHdWmHzF5DPpecJXNcZ9lMZvmI1dhDMyPtWCUW+VuOxe Mpof0siX6CQ== X-Received: from dybaz38.prod.google.com ([2002:a05:7300:6c26:b0:2ba:9dd4:fd0f]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:6417:b0:2ba:931e:7021 with SMTP id 5a478bee46e88-2bd7bd6a485mr7679149eec.34.1772069747865; Wed, 25 Feb 2026 17:35:47 -0800 (PST) Date: Wed, 25 Feb 2026 17:35:33 -0800 In-Reply-To: <20260226013534.2028272-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260226013534.2028272-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.414.gf7e9f6c205-goog Message-ID: <20260226013534.2028272-5-irogers@google.com> Subject: [PATCH v1 4/5] perf header: Refactor pipe mode end marker handling From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Derek Foreman , Thomas Falcon , Howard Chu , Swapnil Sapkal , Anubhav Shelat , Chun-Tse Shao , Hrishikesh Suresh , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In non-pipe/data mode the header has a 256-bit bitmap representing whether a feature is enabled or not. In pipe mode features are written out in perf_event__synthesize_features as PERF_RECORD_HEADER_FEATURE events with a special zero sized marker for the last feature. If a new feature is added the last feature marker event appears as that feature from old pipe mode perf data. As the event is zero sized it will fail to be processed and generally terminate perf. Add a last_feat variable to the header that in non-pipe/data mode is just HEADER_LAST_FEATURE. In pipe mode compute the last_feat by handling zero sized feature events, assuming they are the marker and updating last_feat accordingly. Potentially a feature event could be zero sized and so still process the feature event, just ignore the error if it fails. As perf_event__process_feature can properly handle pipe mode data, migrate users to it except for report that still wants to group events with the last feature marker. Make perf_event__process_feature non-fatal in the case of a newer feature than this version of perf's HEADER_LAST_FEATURE, which was the behavior all users wanted. Signed-off-by: Ian Rogers --- tools/perf/builtin-annotate.c | 11 +----- tools/perf/builtin-report.c | 27 ++++++--------- tools/perf/builtin-script.c | 11 +----- tools/perf/util/data-convert-bt.c | 9 ++--- tools/perf/util/data-convert-json.c | 12 +------ tools/perf/util/header.c | 53 ++++++++++++++++++++++------- tools/perf/util/header.h | 4 ++- tools/perf/util/intel-tpebs.c | 11 +----- 8 files changed, 60 insertions(+), 78 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 9c27bb30b708..cf2d2011e148 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -313,15 +313,6 @@ static int process_sample_event(const struct perf_tool= *tool, return ret; } =20 -static int process_feature_event(const struct perf_tool *tool __maybe_unus= ed, - struct perf_session *session, - union perf_event *event) -{ - if (event->feat.feat_id < HEADER_LAST_FEATURE) - return perf_event__process_feature(session, event); - return 0; -} - static int hist_entry__stdio_annotate(struct hist_entry *he, struct evsel *evsel, struct perf_annotate *ann) @@ -876,7 +867,7 @@ int cmd_annotate(int argc, const char **argv) annotate.tool.id_index =3D perf_event__process_id_index; annotate.tool.auxtrace_info =3D perf_event__process_auxtrace_info; annotate.tool.auxtrace =3D perf_event__process_auxtrace; - annotate.tool.feature =3D process_feature_event; + annotate.tool.feature =3D perf_event__process_feature; annotate.tool.ordering_requires_timestamps =3D true; =20 annotate.session =3D perf_session__new(&data, &annotate.tool); diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 3b81f4b3dc49..d1163f22648e 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -245,25 +245,18 @@ static int process_feature_event(const struct perf_to= ol *tool, union perf_event *event) { struct report *rep =3D container_of(tool, struct report, tool); + int ret =3D perf_event__process_feature(tool, session, event); =20 - if (event->feat.feat_id < HEADER_LAST_FEATURE) - return perf_event__process_feature(session, event); - - if (event->feat.feat_id !=3D HEADER_LAST_FEATURE) { - pr_err("failed: wrong feature ID: %" PRI_lu64 "\n", - event->feat.feat_id); - return -1; - } else if (rep->header_only) { - session_done =3D 1; + if (ret =3D=3D 0 && event->header.size =3D=3D sizeof(struct perf_record_h= eader_feature) && + (int)event->feat.feat_id =3D=3D session->header.last_feat) { + /* + * (feat_id =3D HEADER_LAST_FEATURE) is the end marker which means + * all features are received, now we can force the group if + * needed. + */ + setup_forced_leader(rep, session->evlist); } - - /* - * (feat_id =3D HEADER_LAST_FEATURE) is the end marker which - * means all features are received, now we can force the - * group if needed. - */ - setup_forced_leader(rep, session->evlist); - return 0; + return ret; } =20 static int process_sample_event(const struct perf_tool *tool, diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 7c743a303507..92b76ff24f16 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -3939,15 +3939,6 @@ int process_cpu_map_event(const struct perf_tool *to= ol, return set_maps(script); } =20 -static int process_feature_event(const struct perf_tool *tool __maybe_unus= ed, - struct perf_session *session, - union perf_event *event) -{ - if (event->feat.feat_id < HEADER_LAST_FEATURE) - return perf_event__process_feature(session, event); - return 0; -} - static int perf_script__process_auxtrace_info(const struct perf_tool *tool, struct perf_session *session, union perf_event *event) @@ -4423,7 +4414,7 @@ int cmd_script(int argc, const char **argv) #ifdef HAVE_LIBTRACEEVENT script.tool.tracing_data =3D perf_event__process_tracing_data; #endif - script.tool.feature =3D process_feature_event; + script.tool.feature =3D perf_event__process_feature; script.tool.build_id =3D perf_event__process_build_id; script.tool.id_index =3D perf_event__process_id_index; script.tool.auxtrace_info =3D perf_script__process_auxtrace_info; diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-conve= rt-bt.c index ba1c8e48d495..665bf8eea24b 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c @@ -1412,13 +1412,10 @@ static int process_feature_event(const struct perf_= tool *tool, struct convert *c =3D container_of(tool, struct convert, tool); struct ctf_writer *cw =3D &c->writer; struct perf_record_header_feature *fe =3D &event->feat; + int ret =3D perf_event__process_feature(tool, session, event); =20 - if (event->feat.feat_id < HEADER_LAST_FEATURE) { - int ret =3D perf_event__process_feature(session, event); - - if (ret) - return ret; - } + if (ret) + return ret; =20 switch (fe->feat_id) { case HEADER_HOSTNAME: diff --git a/tools/perf/util/data-convert-json.c b/tools/perf/util/data-con= vert-json.c index 6a626322476a..4b1b2f7bed25 100644 --- a/tools/perf/util/data-convert-json.c +++ b/tools/perf/util/data-convert-json.c @@ -326,16 +326,6 @@ static void output_headers(struct perf_session *sessio= n, struct convert_json *c) output_json_format(out, false, 2, "]"); } =20 -static int process_feature_event(const struct perf_tool *tool __maybe_unus= ed, - struct perf_session *session, - union perf_event *event) -{ - if (event->feat.feat_id < HEADER_LAST_FEATURE) - return perf_event__process_feature(session, event); - - return 0; -} - int bt_convert__perf2json(const char *input_name, const char *output_name, struct perf_data_convert_opts *opts __maybe_unused) { @@ -375,7 +365,7 @@ int bt_convert__perf2json(const char *input_name, const= char *output_name, c.tool.auxtrace =3D perf_event__process_auxtrace; c.tool.event_update =3D perf_event__process_event_update; c.tool.attr =3D perf_event__process_attr; - c.tool.feature =3D process_feature_event; + c.tool.feature =3D perf_event__process_feature; c.tool.ordering_requires_timestamps =3D true; =20 if (opts->all) { diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index fe5d21dde04f..7031f6c6bd66 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -3785,11 +3785,11 @@ static int perf_file_section__fprintf_info(struct p= erf_file_section *section, struct feat_fd ff; =20 if (lseek(fd, section->offset, SEEK_SET) =3D=3D (off_t)-1) { - pr_debug("Failed to lseek to %" PRIu64 " offset for feature " - "%d, continuing...\n", section->offset, feat); + pr_debug("Failed to lseek to %" PRIu64 " offset for feature %s (%d), con= tinuing...\n", + section->offset, header_feat__name(feat), feat); return 0; } - if (feat >=3D HEADER_LAST_FEATURE) { + if (feat >=3D ph->last_feat) { pr_warning("unknown feature %d\n", feat); return 0; } @@ -3841,7 +3841,7 @@ int perf_header__fprintf_info(struct perf_session *se= ssion, FILE *fp, bool full) return 0; =20 fprintf(fp, "# missing features: "); - for_each_clear_bit(bit, header->adds_features, HEADER_LAST_FEATURE) { + for_each_clear_bit(bit, header->adds_features, header->last_feat) { if (bit) fprintf(fp, "%s ", feat_ops[bit].name); } @@ -4171,7 +4171,7 @@ int perf_header__process_sections(struct perf_header = *header, int fd, if (err < 0) goto out_free; =20 - for_each_set_bit(feat, header->adds_features, HEADER_LAST_FEATURE) { + for_each_set_bit(feat, header->adds_features, header->last_feat) { err =3D process(sec++, header, feat, fd, data); if (err < 0) goto out_free; @@ -4386,6 +4386,7 @@ int perf_file_header__read(struct perf_file_header *h= eader, ph->data_offset =3D header->data.offset; ph->data_size =3D header->data.size; ph->feat_offset =3D header->data.offset + header->data.size; + ph->last_feat =3D HEADER_LAST_FEATURE; return 0; } =20 @@ -4401,8 +4402,8 @@ static int perf_file_section__process(struct perf_fil= e_section *section, }; =20 if (lseek(fd, section->offset, SEEK_SET) =3D=3D (off_t)-1) { - pr_debug("Failed to lseek to %" PRIu64 " offset for feature " - "%d, continuing...\n", section->offset, feat); + pr_debug("Failed to lseek to %" PRIu64 " offset for feature %s (%d), con= tinuing...\n", + section->offset, header_feat__name(feat), feat); return 0; } =20 @@ -4435,6 +4436,8 @@ static int perf_file_header__read_pipe(struct perf_pi= pe_file_header *header, if (ph->needs_swap) header->size =3D bswap_64(header->size); =20 + /* The last feature is written out as a 0 sized event and will update thi= s value. */ + ph->last_feat =3D 0; return 0; } =20 @@ -4667,31 +4670,55 @@ int perf_session__read_header(struct perf_session *= session) return -ENOMEM; } =20 -int perf_event__process_feature(struct perf_session *session, +int perf_event__process_feature(const struct perf_tool *tool __maybe_unuse= d, + struct perf_session *session, union perf_event *event) { struct feat_fd ff =3D { .fd =3D 0 }; struct perf_record_header_feature *fe =3D (struct perf_record_header_feat= ure *)event; + struct perf_header *header =3D &session->header; int type =3D fe->header.type; - u64 feat =3D fe->feat_id; + int feat =3D (int)fe->feat_id; int ret =3D 0; bool print =3D dump_trace; + bool last_feature_mark =3D false; =20 if (type < 0 || type >=3D PERF_RECORD_HEADER_MAX) { pr_warning("invalid record type %d in pipe-mode\n", type); return 0; } - if (feat =3D=3D HEADER_RESERVED || feat >=3D HEADER_LAST_FEATURE) { - pr_warning("invalid record type %d in pipe-mode\n", type); + if (feat =3D=3D HEADER_RESERVED) { + pr_warning("invalid reserved record type in pipe-mode\n"); return -1; } + if (feat >=3D header->last_feat) { + if (event->header.size =3D=3D sizeof(*fe)) { + // Either an unexpected zero size feature or the + // HEADER_LAST_FEATURE mark. + if (feat > header->last_feat) + header->last_feat =3D min(feat, HEADER_LAST_FEATURE); + last_feature_mark =3D true; + } else { + // A feature but beyond what is known as in + // bounds. Assume the last feature is 1 beyond this + // feature. + session->header.last_feat =3D min(feat + 1, HEADER_LAST_FEATURE); + } + } + if (feat >=3D HEADER_LAST_FEATURE) { + pr_warning("unknown feature %d for data file version (%s) in this versio= n of perf (%s)\n", + feat, header->env.version, perf_version_string); + return 0; + } =20 ff.buf =3D (void *)fe->data; ff.size =3D event->header.size - sizeof(*fe); - ff.ph =3D &session->header; + ff.ph =3D header; =20 if (feat_ops[feat].process && feat_ops[feat].process(&ff, NULL)) { - ret =3D -1; + // Processing failed, ignore when this is the last feature mark. + if (!last_feature_mark) + ret =3D -1; goto out; } =20 diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h index ca22030a1434..41ce663d93ff 100644 --- a/tools/perf/util/header.h +++ b/tools/perf/util/header.h @@ -109,6 +109,7 @@ struct perf_header { u64 data_size; u64 feat_offset; DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS); + int last_feat; struct perf_env env; }; =20 @@ -172,7 +173,8 @@ int perf_header__process_sections(struct perf_header *h= eader, int fd, =20 int perf_header__fprintf_info(struct perf_session *s, FILE *fp, bool full); =20 -int perf_event__process_feature(struct perf_session *session, +int perf_event__process_feature(const struct perf_tool *tool, + struct perf_session *session, union perf_event *event); int perf_event__process_attr(const struct perf_tool *tool, union perf_even= t *event, struct evlist **pevlist); diff --git a/tools/perf/util/intel-tpebs.c b/tools/perf/util/intel-tpebs.c index 3c958d738ca6..f57ea6db02a0 100644 --- a/tools/perf/util/intel-tpebs.c +++ b/tools/perf/util/intel-tpebs.c @@ -217,15 +217,6 @@ static int process_sample_event(const struct perf_tool= *tool __maybe_unused, return 0; } =20 -static int process_feature_event(const struct perf_tool *tool __maybe_unus= ed, - struct perf_session *session, - union perf_event *event) -{ - if (event->feat.feat_id < HEADER_LAST_FEATURE) - return perf_event__process_feature(session, event); - return 0; -} - static void *__sample_reader(void *arg __maybe_unused) { struct perf_session *session; @@ -238,7 +229,7 @@ static void *__sample_reader(void *arg __maybe_unused) =20 perf_tool__init(&tool, /*ordered_events=3D*/false); tool.sample =3D process_sample_event; - tool.feature =3D process_feature_event; + tool.feature =3D perf_event__process_feature; tool.attr =3D perf_event__process_attr; =20 session =3D perf_session__new(&data, &tool); --=20 2.53.0.414.gf7e9f6c205-goog From nobody Tue Apr 7 14:03:39 2026 Received: from mail-dl1-f74.google.com (mail-dl1-f74.google.com [74.125.82.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E70623783CB for ; Thu, 26 Feb 2026 01:35:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772069753; cv=none; b=EGixEGV0REKxT0LXgxoSFtYRGz/mY5GqztTnnk386NAZFxhBr3EbXfDyHscxX5pySJ98uIK5H1Qbdu2mJHrB8+ez7JyVc+ALlNJphJjiLodVGDCOZWa+oirDyEyVNILL5//5qsNvCUdvuC8AW97PuJWlalmxgfzv7JjbCzCPK8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772069753; c=relaxed/simple; bh=VUaPixiKYJ7ij/ivoa1XUmUMzaq9D4k53FRF1c4oKq8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=QS3xj0EBphnS5tChj6hK9UlWgv4F0VDuxTcGqF60qTExPH7+Sj6l3kizj0VbFXMA5MPUYku695FdsQmGaee1T62/Regk8kPpNLkSiFbM8UCzjcgrk06m/J3CzbZQQiEiG8nLfcPHFuNvMNNqp779H9p80cHmljxukSp+nMnq5Aw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=K/pGZFmt; arc=none smtp.client-ip=74.125.82.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="K/pGZFmt" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-1276e71652fso588760c88.0 for ; Wed, 25 Feb 2026 17:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772069750; x=1772674550; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=1ci9RsZZzUOkXZUiVAS/DAziwtxPXHN+N0KfwxSaTa4=; b=K/pGZFmtgQtm01+vcJZmLER3iX9h+N9KPmO1ZrRS3YU7WVUBgNUdhbptwB/U6aOdEI yTKYX+cCViPWLbs/V53yJlxS8YB5e4fNiRxkbi7FQVuJICM7Cl43nCB7ouS5PjOVz0fk mpZg1HK3JcZU/mTRsYTaTNK+ye2xHbwCO9z75QEpLUlxsI5dIm7Gm41FcpG21rsmGd5J 1WxSzB8UufURkADWKd8l0e0zLAMfDjBYDHQKMMkizA1zCvjXkKrIb56L3OaImOg/J0oV Fum5+A/s3iASBeVT0P2uNvPQBMRAppElhIYfFRD9SOKj2KJ3zFF52Z3U8r0J/BE7Xbn2 b89w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772069750; x=1772674550; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1ci9RsZZzUOkXZUiVAS/DAziwtxPXHN+N0KfwxSaTa4=; b=A0gnspJD77EqQKYMczMCpqQ0UXhjA9EN2yjmRsteP5/ISoPpn1XNjeojXcHVBY213w NTXoubqhCS4l2FgGmwInTFYjo0d4juQvi8WvZ76wywEuWQjgpd1gnmUluKUe17/YkGec f+uxsMJmpFrpyAYpkoKAluVA2HZdzbbVwB2tEnor+pbkURxStQkiRKN0FFnbGMIdJsGC lg08YSnnpE1P3dC+zmQ1VVQDx50RTjxPSis8Gz287l1Wj4JGLhIZCkwpjsj0jhuIqiTT W8YKMaYARKKkMOo704AKxRm/qCnYJ4nJs06T5DtdL57t/jOUpYi8qUOR9jOV9MTdEA8H Jvqg== X-Forwarded-Encrypted: i=1; AJvYcCWYDpGPWvswJpaUwu2d8kOBOp2rfxIz3uPlf0/TK+GImmtnuMyKZTLEJZFrXLnQa2SG0A1/Ve40Q//7xF0=@vger.kernel.org X-Gm-Message-State: AOJu0YyDCt2IPi78697CqoojbMwCniec+RJ/5K2fy7CFgCNCMyaA108i HPK3xQPHaIRxhDbS7v2USRL9DU8WEv62q/CDQTFMCykiuxzuASbl2SfmG41Oi0+YnDnGAtc7sDE infCEKAmRDw== X-Received: from dll4.prod.google.com ([2002:a05:7022:204:b0:127:3728:b606]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:322:b0:11b:65e:f35 with SMTP id a92af1059eb24-1278693dd14mr978081c88.7.1772069749820; Wed, 25 Feb 2026 17:35:49 -0800 (PST) Date: Wed, 25 Feb 2026 17:35:34 -0800 In-Reply-To: <20260226013534.2028272-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260226013534.2028272-1-irogers@google.com> X-Mailer: git-send-email 2.53.0.414.gf7e9f6c205-goog Message-ID: <20260226013534.2028272-6-irogers@google.com> Subject: [PATCH v1 5/5] perf evsel: Make unknown event names more unique From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Derek Foreman , Thomas Falcon , Howard Chu , Swapnil Sapkal , Anubhav Shelat , Chun-Tse Shao , Hrishikesh Suresh , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In situations like the perf data converter the evsel__name will be used to create babeltrace events. If the events have the same name then creation can fail. Avoid these failures by including more information into the unknown event names. Signed-off-by: Ian Rogers --- tools/perf/util/evsel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index f59228c1a39e..fdc67df0e739 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -926,7 +926,8 @@ const char *evsel__name(struct evsel *evsel) break; =20 case PERF_TYPE_TRACEPOINT: - scnprintf(bf, sizeof(bf), "%s", "unknown tracepoint"); + scnprintf(bf, sizeof(bf), "unknown tracepoint id=3D%#"PRId64, + evsel->core.attr.config); break; =20 case PERF_TYPE_BREAKPOINT: @@ -938,8 +939,8 @@ const char *evsel__name(struct evsel *evsel) break; =20 default: - scnprintf(bf, sizeof(bf), "unknown attr type: %d", - evsel->core.attr.type); + scnprintf(bf, sizeof(bf), "unknown event PMU=3D%d config=3D%#"PRIx64, + evsel->core.attr.type, evsel->core.attr.config); break; } =20 --=20 2.53.0.414.gf7e9f6c205-goog