From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 F00572F6184 for ; Tue, 2 Dec 2025 10:40:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764672054; cv=none; b=drqMcVhJh+j6RNs51v5HlgEz9+0BiQERDKzDZGKwEAGI9VvwXxtQMCzM+l6VlTuzt+tp2Dy/FeffdZt0/b3F+ujqPCwiuVvRwHzjYnengZ7ESq2oFCnzTZpBDcI/eyNWe6PgFxZVAQMMR0wt08vsiVlf3WG7zVBbY7wcn0ICfN8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764672054; c=relaxed/simple; bh=PBKsInVvpd9PdpiPDAdwcyqFmktaB7feF/0sAPP48zI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OeVq7XXgRoVPGzK3XxitpALAWR+l7+0dGmCSpQsqu101sDY4mrPXhyWPzRg5rM0ETqhTkLQ6hLrS1/0HXU3NszuTjlUfGOW5Osps9c15a+lnneI3efJ1LAu7vK/pQe0irZ+SH0MWI+kyHC+n3D7kX8+ZdPuC9uze4Mm8PhqvwJA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rGjrzL2+; arc=none smtp.client-ip=209.85.128.42 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) header.d=linaro.org header.i=@linaro.org header.b="rGjrzL2+" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4779d47be12so42976995e9.2 for ; Tue, 02 Dec 2025 02:40:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764672051; x=1765276851; darn=vger.kernel.org; h=content-transfer-encoding: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; bh=th2ta/uFhCmWYoXsGiqxNYGiQhfkxRr8VyWDSYszkyk=; b=rGjrzL2+NnrlvX+5mzCN++oEz5agqiiWzzdmQDvXfVmumC8bvoBPM7ekYBSZLkfW/g j2Py8JMnLLEQeiTG4emY0maVtaA4uTLjyGZWO/d0LhP/Zlegxm2Q6YYjGqKb0BwS4N8M ybUy0HDSKGwok7YyMdneqUqdEMMiONE2uSYGW/30ZaMiQ1uSkReqFlLThZZp+uaQz9fQ EX6lyRD2ep1RO9gFs8nU7FyseuWRXyhajMhQG9ZBk4hp84iSSk5Ns8nBhQLIsqpxeUrw HQ5X0SwNmd/9hs07WM0ehspr2Cw7+dSYKXo3ywus65gU2bpAlxVZKIi9ylnsjvD5bZeA y9gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764672051; x=1765276851; h=content-transfer-encoding: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; bh=th2ta/uFhCmWYoXsGiqxNYGiQhfkxRr8VyWDSYszkyk=; b=Vh4K7Cay5K0QfgTaCfzSlGFVm9NFP5+D7/dWU+iXZtAMIzpO6vBVWyA3VmwwfW+ISQ gUJgvk9T4PpWYxB/DxgUWRoqOEWHn5F92nDwI8dnvKArBpYVNRW0ZH9bsQ4//H1U4SLS 8MRJVpyVYSKO862DwnA1sSHrWMtvAz2Y+4GIJPoYtqwrL/sfDD3Ih0lAxUNxstUa8ATE Aqrx7+FHAp0qBXTHTVqyY+AaLfu64fBZKNweYaYwD622i1u1tqSTbcGgTaJ5XFo9Drld P6LoWtZBNBsdLnyTQyxZNJgkRufS0NbLUXdPDB2Xd3b+OCJECq9OkbBcLrXFZnER6772 c1SQ== X-Forwarded-Encrypted: i=1; AJvYcCVBg5rYYN7tKUrBayMnvCD3NBGmPiG4slXFZASFYsIos483/Cutws9O+REsI/2PAcE0N+QNaVgD0jyGhKQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy4TwaTEBOScWm/vMu0CTTqVFKyPXz9cxPHPDea9g99EJUW8JUT Ko9fRy0EDVxWXid93/prvzqvNunu+a5633dYN4dSEQ9J/IYdMsGM66yQHVnEsotWt48= X-Gm-Gg: ASbGncsQUx/0riQlBxcH6RBVmWx7yyj9ok89+12KReKDVwELUxoDCn1lNJsBf2k+g3F +d+WNmbNNMYA4HHXR4d83q3qyu/a5uoSPi69i64ojBK7b5HcH/LTXe6wsj3fgjOrP2RmdTq4YnR d5SQWiuC3LY+Q7wWBolv/KPNRHLGZukJdmHvvK6FKR9lmfuipTd5TXv8g+Z+ZzZuV0s+z+4Wpoi pIzzzB0VKOisz5hhyohproNgV1QfJqDE36OBtDQWuF/1E5x5nnoMyDNG7xSMykiDgkmsFmD+Nf0 7Dll8nVxFEB7D4lWRJrhLDtBgrDlUmi9xkqDevDRHfcm4XJ+DTgcCBV9NN2/edkI79t6AZhIGum Szak7kRd/xRjN2HyD1zxpmNuZ/FXXQz36UXWaAfj27/m39WMeanCTB/SBQo41voksM5XB7iXc+o xSiDlZFYGgLRDuIzgG X-Google-Smtp-Source: AGHT+IFIZZL3ELzhmY7ZxQvV+EVEfV64j2iIUcHf0FIxZBYlBnLylq8S3u+BdSmD7CbXWktYV2cbug== X-Received: by 2002:a05:600c:3b09:b0:471:13fa:1b84 with SMTP id 5b1f17b1804b1-477c0185bc8mr473893265e9.12.1764672051209; Tue, 02 Dec 2025 02:40:51 -0800 (PST) Received: from [192.168.1.3] ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4791116c3c0sm291934395e9.8.2025.12.02.02.40.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Dec 2025 02:40:50 -0800 (PST) Message-ID: <978dd9b1-1cb0-4338-95fa-575a858cea80@linaro.org> Date: Tue, 2 Dec 2025 10:40:49 +0000 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 1/7] perf tools: Track all user changed config bits To: Leo Yan Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Suzuki K Poulose , Mike Leach , John Garry , Will Deacon , Leo Yan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org References: <20251201-james-perf-config-bits-v1-0-22ecbbf8007c@linaro.org> <20251201-james-perf-config-bits-v1-1-22ecbbf8007c@linaro.org> <20251202101556.GR724103@e132581.arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20251202101556.GR724103@e132581.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 02/12/2025 10:15 am, Leo Yan wrote: > On Mon, Dec 01, 2025 at 04:41:04PM +0000, Coresight ML wrote: > > [...] > >> +#define ADD_CONFIG_CHG(format_type, term_type, new_term) \ >> +{ \ >> + struct parse_events_term *term; \ >> + u64 bits = 0; \ >> + int type; \ >> + \ >> + list_for_each_entry(term, &head_config->terms, list) { \ >> + if (term->type_term == PARSE_EVENTS__TERM_TYPE_USER) { \ >> + type = perf_pmu__format_type(pmu, term->config);\ >> + if (type != format_type) \ >> + continue; \ >> + bits |= perf_pmu__format_bits(pmu, term->config); \ >> + } else if (term->type_term == term_type) { \ >> + bits = ~(u64)0; \ >> + } \ >> + } \ >> + \ >> + if (bits) \ >> + ADD_CONFIG_TERM_VAL(new_term, cfg_chg, bits, false); \ >> + return 0; \ > > Nitpick: "return 0" is not needed here. Otherwise: > > Reviewed-by: Leo Yan I think it's worse than not needed, it makes it stop collecting the changes after the first one. It was annoying that this had to be a macro instead of a function because ADD_CONFIG_TERM_VAL constructs the #define name of the first argument. It's probably worth putting in some effort to make ADD_CONFIG_CHG() a function to avoid problems like this and maybe add a test.