Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2310752rdb; Mon, 5 Feb 2024 02:31:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtO1rkOW86AVQPzY7dB5UjcHkaaJWOQUk+wOefz2v/gCjaxJHUtS9BUE+0ckaDVLa+R+Ry X-Received: by 2002:a17:903:40c9:b0:1d9:89dd:19b6 with SMTP id t9-20020a17090340c900b001d989dd19b6mr7773032pld.59.1707129101750; Mon, 05 Feb 2024 02:31:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707129101; cv=pass; d=google.com; s=arc-20160816; b=O+pT9sitaC/m7+bH34YzP9cxN3e2dAbQE1+rt+khbn0/YWgWf4XrvUyCbXXThdFAVW bN4ZHwrKfLTFRUyABzqYKcn3qJQuAblDB+5uIMAg0qczC1i5UxFPM/+EAOBak+ZTAo++ 1RHJdTHpHX4c5BPlu9fCtH3v2mgSZiVQ3IZvGZjYdz0/ryB/JLHtuq9Pzr9uRhM+TnAc 8WJNOFq0xpmfQGIBGned2rQ2IqgOE03baNcC+FFga9Sohu6p54CQq1BL5HQmwT3gblFQ z9HV+flrKXc0A2U2+LZMiShabvEePJEU58sfThr/+ybeYXNM0CZe4c4xL4npI/G25RAO 55Kw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=2hwfzsZFQtIlkDnkehT5t/S1WwOJbEOQgALFe4jYRBw=; fh=KiouRoLr8tQrX0sLxsoejgZ+uFVwvyRh2kYCMIqQaJg=; b=DDN99/9IUeTLIOSJGM0UOSUvR7izF+jxGJyO6+o4yV7HzxyLuKY36jSBtKWdEwoKPK w4a9Yq/fvU/LrLqFx+caScVN2zc/RxO5mCK11YAMqBfhXO1H8v/XZf/9JxF//zEv9iGl 2Wy7W/eM8aBnDc6WXUd3MANTXZNgwXEGWskY1XdrcVaOXkIv4XKK7Htl9QPu0961E0+0 KAJfqfpZJgjDvNy6Az4Z6Dq0UXlSyqXX0WjBFg/H/vwUgzm9r50cNnT3feg6D/TYrNsP 0W7MSRExKlkqNcnH5SjuavGaLNX1JmrpD0kdD8HRpMsgwnBJMH+vaG9w84KC7DkZ20Of SeLg==; 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-52412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52412-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=1; AJvYcCVne8xWMCBrqWU2IDIw8qAVrIG3jvoOE4GDdR5VBh69sTSs8wTVIl38B4WX1ROmnIucPnPCRQOzKyk7CO+s9yklGNBTPDVif4rf4k9nRg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h23-20020a170902ac9700b001d71de11ca5si6071820plr.493.2024.02.05.02.31.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 02:31:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-52412-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52412-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 66718282545 for ; Mon, 5 Feb 2024 10:29:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8F73171B4; Mon, 5 Feb 2024 10:29:10 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4FE9A17582; Mon, 5 Feb 2024 10:29:07 +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=1707128950; cv=none; b=BnEXBeOqbG4En9atHUgr9rTRTGK8gJTnhRk2OxKD85me4PZ+2VirdF7KBeVZcNQ46jbnHusSVTOpZLf10gtsqjYDhgw/6LMDZkK1jp9DdbjieOPBYK/J/KCgOpuLKa/nZEpjthdwQtCGBrYj2tV/nGy/Z5rsYTlxip+ekHao4Qw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707128950; c=relaxed/simple; bh=s0mnT/cdLHBbbew5fqdPMxLP/4VYZ1bC8Ao2a37JfpU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rm/82kY1BEZ+qGvKmVrfTdrc5TiVITYWZ7xzKWkxkG2oK7UaGNZZG3tvSgpp1MfPSLqny0EOppXqKZCOjDMqe8XIaGay33lXqVLkmz+gVlDuiIbrbtO26FRhOsUGbsXgTFz9XdOpwYSnWog3oEjEfbKIOXgui2Kah/zdEfImNZ8= 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 DC4441FB; Mon, 5 Feb 2024 02:29:47 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.66.84]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 23ED63F762; Mon, 5 Feb 2024 02:29:04 -0800 (PST) Date: Mon, 5 Feb 2024 10:28:57 +0000 From: Mark Rutland To: richard clark Cc: nico@fluxnic.net, Steven Rostedt , mhiramat@kernel.org, linux-arm-kernel@lists.infradead.org, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Question about the ipi_raise filter usage and output Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Feb 05, 2024 at 05:57:29PM +0800, richard clark wrote: > Hi guys, > > With the ipi_raise event enabled and filtered with: > echo 'reason == "Function call interrupts"' > filter, then the 'cat > trace' output below messages: > ... > insmod-3355 [010] ....1.. 24479.230381: ipi_raise: > target_mask=00000000,00000bff (Function call interrupts) > ... > The above output is triggered by my kernel module where it will smp > cross call a remote function from cpu#10 to cpu#11, for the > 'target_mask' value, what does the '00000000,00000bff' mean? That's a cpumask bitmap: 0xbff is 0b1011_1111_1111, which is: ,- CPU 10 | 1011_1111_1111 | '__________' | | | `- CPUs 9 to 0 | `- CPU 11 Note that bitmap has CPUs 0-9 and CPU 11 set, but CPU 10 is not set. I suspect your kernel module has generated the bitmap incorrectly; it looks like you have a mask for CPUs 0-11 minus a mask for CPU 10? For CPUs 10 and 11, that should be 0xc00 / 0b1100_0000_0000. > ~~~~~~~~~~~~~~ > > Another question is for the filter, I'd like to catch the IPI only > happening on cpu#11 *AND* a remote function call, so how to write the > 'target_cpus' in the filter expression? > > I try to write below: > echo 'target_cpus == 11 && reason == "Function call interrupts"' > > events/ipi/ipi_raise/filter The '=' checks if the target_cpus bitmap *only* contains CPU 11. If the cpumask contains other CPUs, the filter will skip the call. I believe you can use '&' to check whether a cpumask contains a CPU, e.g. 'target_cpus & 11' Thanks, Mark.