From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 2D14D3955E7 for ; Wed, 3 Jun 2026 11:17:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780485436; cv=none; b=pIY5iufad9VjMjqQAgW0Tkd8N8s/q3xZNSYK88llmjdn1tjkvgYlJkvkKyrpwplKs5HOp/sJKoSiqtPcsIcMPQxkOt6larWP4MBLFuFHNQNX7A/fZqtt+pfaTjUf0B7OJ9GpmOf/U5ekZnALRiCyrmOfV1sGH7mEY7DOv2S/Tfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780485436; c=relaxed/simple; bh=YH1yDlcQ1Btc01IgTRsUEjs4GCr14HE188gaQM2nQnk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DisKWWuQHWoOEZx3mFULg54Ni6l/orbpm3r+Dif4W+aQpgShh02XsAwnj6Y+rD0ngVAPVvCvAH8B3kF9HyrqBujtxjD3vimcw1D+V2ebJUOJsOFaL3Y3HuncYuhjRihhiViZbt0t84Jk1hiqpyNQkdajnWgIjgQN/ja9evoORkQ= 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=xyWN6bgA; arc=none smtp.client-ip=209.85.128.49 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="xyWN6bgA" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-490b9318997so3926665e9.2 for ; Wed, 03 Jun 2026 04:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780485432; x=1781090232; 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=T+KyrkqrXHlGePKgaipm3bkHOjJ6TJi29svJlMHw/IA=; b=xyWN6bgAa4Ta8P3t/fTKYccMvqp+hFJRnJjzysXxF9frrIoNjXv74Iqg3xPB0pOpzX Xpx6MYQTZFYrifX+4DLkfnF7R3rj5RCdLheFzRuOWvNvzmj+Hlre0tOfXI6S6GeJDwy5 tyAGA3oDG5jLAYYv4k2lyCtHlH1im9wYIcpgldaqySc9T/dEFzX5kEmxwhkQ/Dh6WbKJ cZSyStjwhWZNQHNHRZiJaC0BPvoh8un2twBRyUDcZ2gtrsh3Kp390IShz1wUgYDu/21R gJXysm03VAmwu28uST/qa0wecP+dkeTktfNOgbA1NXvT8cxwLQTk4dFNZjts4yLjPdwy ZobQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780485432; x=1781090232; 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=T+KyrkqrXHlGePKgaipm3bkHOjJ6TJi29svJlMHw/IA=; b=sKjLhWEXmZx9nISwzgP2/K/ZFAiq+WSTdGwARIBDvgcGoeab6sX+cFqCXjXqZ3Nm7B UJB4mWtKTqiTcOeqIsSq0HLcPiGbT5KVC1BRLiXfLyv6dhBEVHnYC1nLoNiYrcj0yFYq TOB6MavRN9PCX7wCWnPHis4knelrwNN8CJFBbGiN/vARHP8qQSWj3HCnD4l5jRGSR0Zd MpSoe0GX3vGnfkNMxCAK9ANQOTxtVc/kIRaId/EwU0pNK0G+9Tux/MUyvTqklVibQ6zb WfcSqZkM+L7RQsiL/MngW/nkif2CTuv0DAvowGsE9ihFuGkV9lfcTDnvGJpLbVSG/R8H yw/g== X-Forwarded-Encrypted: i=1; AFNElJ8hmZSk5i28dht/20Z8UEOBLvhdp2kCZoY1lg0ZBG+rEodrCFQ4vCUbN/TXkQ4qfB4AsnqAp5faeGtMqyw=@vger.kernel.org X-Gm-Message-State: AOJu0YyDNgy6/gErpbrFYiiIQ0vdKLaNeOHeBdNjTTCA+EkFUzB39VvQ yZ0FUSxqNllVk6wytLoFXf+UHnDewIZ/0jWf3PBxx41DLgaVRzqYlywhEJZxMkYu9hA= X-Gm-Gg: Acq92OHfObK9/HmkjnbKenGZ711UZugTAZIJtqwzHCQvdKzzRXhMxTQ7wak+Vi23bgL VEiujykgYhUaO/P+fQ8LQVwFKz6w/1hE/6whmQWoPnVtRkKKwOVhDWrPSAld4FWTwGTscGVPG8q CAJz/ebGxTdKmDz6ufgk3OcU+Hrd5Z7bEF499z8NIO5JRYB/6KefpZKpyfeZ7EdiJBXiUbjRf+8 TThCccBGran3SzQaCDZStkR/dUJnRe2w1lHVNe7Q/RJkmlcBTN0+1ovUXL0M9tVQ2UIywQEQLsr skxYzMJlp2/oTf/uYOFG8Zu/VV7TqQhrhfVzkjPOKiC3YEmQRb0DFw5gHH2h8d6fEy19cYUhWDj 1k0ad3V38DCEvAdSLyJYylavtcuFq6/BcuFPTSznF6ukA8zDHwEcpMHe97/TNY8HcAocd1hesa6 CIvKb/pFyuDBFddv4sAkF1ikftmjpI9omWm2hzcoc= X-Received: by 2002:a05:600c:c092:b0:490:b724:5085 with SMTP id 5b1f17b1804b1-490b724521cmr29027425e9.33.1780485432205; Wed, 03 Jun 2026 04:17:12 -0700 (PDT) Received: from [192.168.1.3] ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b7e6c6a4sm20016975e9.2.2026.06.03.04.17.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jun 2026 04:17:11 -0700 (PDT) Message-ID: <34b3b085-cb13-47d2-aad4-fac8c7812bd3@linaro.org> Date: Wed, 3 Jun 2026 12:17:10 +0100 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 v2 03/18] perf test: Add a workload that forces context switches To: Leo Yan Cc: Suzuki K Poulose , Mike Leach , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Amir Ayupov , Jonathan Corbet , Shuah Khan , Paschalis Mpeis , coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , linux-doc@vger.kernel.org References: <20260602-james-cs-context-tracking-fix-v2-0-85b5ce6f55c6@linaro.org> <20260602-james-cs-context-tracking-fix-v2-3-85b5ce6f55c6@linaro.org> <20260603110621.GR101133@e132581.arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20260603110621.GR101133@e132581.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 03/06/2026 12:06 pm, Leo Yan wrote: > On Tue, Jun 02, 2026 at 03:26:45PM +0100, James Clark wrote: > > [...] > >> +/* Not static to avoid LTO clobbering the function name */ >> +void context_switch_loop_proc1(int in_fd, int out_fd); >> +noinline void context_switch_loop_proc1(int in_fd, int out_fd) >> +{ >> + for (int i = 0; i < loops; i++) { >> + read_block(in_fd); >> + context_switch_loop_work += i * 3; >> + write_block(out_fd); >> + } >> +} > > Rather than struggling with unexpected options, and "noinline" might > not work as it is not a standard compiler option (it is defined in > kernel header as AI reminded me), wouldn't it is reliable to use a > dedicated CFLAG rule same as other programs? > > Thanks, > Leo noinline seems to be used as standard across the tools codebase, so if it doesn't work there are bigger problems. Perf also only really seems to support GCC and Clang and they both work for this test. And I don't actually think it matters if this is inlined or not as long as the debug info reports those lines as being in this function. That's what what having it as a global symbol is supposed to achieve, but that's about renaming rather than inlining. Maybe inline is over the top, but its a pattern copied from other similar workloads and tests. Probably makes sense to wait for an actual failure to appear and then we can decide what to do with it then.