From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 9821C175A7B for ; Thu, 4 Jun 2026 13:21:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780579310; cv=none; b=dpZZqQYHzdocYYo2mLu41vq08ok+MJ41bAPJLMoq+X8wIOypy8bfZmSguBy6xn20iXtWxCHQ1H4Kp9A1Y4RTwzB57NBWj5BNM8iBHv7tRCnYzDFNDU/mGPpwaV4aTe5TF9QrUv2V/xdtp8vbYHyaUiK65x3NYm9Rb6gKYla8fJM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780579310; c=relaxed/simple; bh=R4Qd1UZS19xLGwI+6b1+VkqpzA2WHtPOvF+YQJ5gNJw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bv0q4IJiASSNbdu7BLaldCy+PB/i2r0B4P1pV02q5gjHzOMJ8D/hh4fkHHHRflcZX6NC7k7EiRVxsuGUceIX6iP6lYZElUh7I5SZonS2rld+06na9tojP5qCHhiW2XdSiB6R9DioaAQW3ym5IVo7DRz5OQQUHWAJrOKvytaBANg= 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=zgdatk9A; arc=none smtp.client-ip=209.85.128.53 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="zgdatk9A" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-490ac357c55so8681485e9.1 for ; Thu, 04 Jun 2026 06:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780579307; x=1781184107; 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=nAM+rRAaT8WOAGvky0RLKEaSXTjKAfYZq1zaY/oNR/s=; b=zgdatk9A3+oqtGDlof2gqUaumIx3TxVlLl8puY4sp+C/Ochf3ibjtlo/W7l7F7RWFg p8uEOUytpU9BDswUnxP/aj4vj/wjsIBW0ldeL4wVBdMVgf6wbg4w5lJw6tRyuoCxY8ak nGCi8EhRaw85AezttRakyArgGArfjKw9LvQuWkJFPRdFKhLlHeGXLnxEieOM88VdygVh OGEe1EYOAeWxOC3kl0fPbSygiybBRYmvRHaomYzuSEAPgpdrgQPhRQDhqKheGEE6q0i5 t0JphQu/b2RRowWrJBX6U0TNsIJW107kObdns8aaONWV4QHE2+PeiW00Yk14SuuTvRRS lgTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780579307; x=1781184107; 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=nAM+rRAaT8WOAGvky0RLKEaSXTjKAfYZq1zaY/oNR/s=; b=SFRYlAoRuKclFLCByNLjxmmWEXoSdgatFp4WMVShwDdDaIdH8oFmZPLz9MTMerHknN UQJSHAjzdMjUVU4qeePY7iqOlC2c+J9y6EL9HcDJUEiqX8vrLrfTE25YTg/5T0mnu6T/ ux7AAx4Q92mtVLFNyNSrvpPH1sQCQLwbpVDltOeI9UuD6K9qOiX8y/I7GbIU5XrY2Mir QND8n9kHUk6UXl4lrc08wBJsifmtohzTnYPPt+uOov1kasR3T6VcjwN54rhiBDH44YZG TWS0l6kKMBKl8YG0k5PD72IW61zfDJAHkHPGEHZe5iTMsXFqm2UsgsgOHAadmExDNtIc 6B+g== X-Forwarded-Encrypted: i=1; AFNElJ+KpJn51wSQo8NVEzGz04FTdYUywVrVERKSp8/Owi0D3okhpywYs1eGZkpMfK3cOlXhiU+ha5MdnPbI+58=@vger.kernel.org X-Gm-Message-State: AOJu0Ywan6mbbTNb4dKJG5AgGzq4Bl7EdFWw5bc72bQ2kryAAMMGNnj7 rbUTgpgHwDRYWyFP0hOj0SF6q1R2j8KfYaZNZL6ZGv0zCdQcQoU2c3y/ZfX8/KoKrPc= X-Gm-Gg: Acq92OGPs5GT8gy5OnHgPSGxQ+cfzoyteZLaBPj3EZr6GnWMX7oBrmjvehqIsMfQWQn ddPT4V/PdIr7U5Inx2Q+SnhSUczBUsL0aLyUkWEsCOHnKpKQXw/9TFUCFC3VmOLgoCQQEJQ3W35 h5bIPRr1ix5PUY9m4oRhTpLnHh9hp3yb1iitE4pc8elo+7bk7V1yzGhpipR8gw0viwe4kCUfyFa 4s4sMQJBwE4okEObm7rrEyG9PYOHPteJhlHYNsca2hjAdkWm7S2uyAqYOtMo1N9wx8062bsjE7h F6UJqdpE2ugSDvGSqGTiPLnSJgr5lPkMa+viZxlW9L4JpYfioHa3FpFMvzs7FZkCJyEYhGJjx2F 0MyyVgrLEGBi/kK+cDlTHbjz39r4kw859PsGaWYbaY3LW7l8v52ypNtYKw0DmDhwtvtqNt9ETrw oKV/KHWz6tzMW8mz3BPbFdvwjf5Q6Cj1Gtm5R1uVY= X-Received: by 2002:a05:600c:a088:b0:48f:f64c:c2fe with SMTP id 5b1f17b1804b1-490b5ee1983mr137859005e9.22.1780579307027; Thu, 04 Jun 2026 06:21:47 -0700 (PDT) Received: from [192.168.1.3] ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490bc391aaasm83198855e9.1.2026.06.04.06.21.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jun 2026 06:21:46 -0700 (PDT) Message-ID: Date: Thu, 4 Jun 2026 14:21:45 +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 06/18] perf test cs-etm: Replace unroll loop thread with deterministic decode test 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-6-85b5ce6f55c6@linaro.org> <20260603140803.GV101133@e132581.arm.com> <2f1db2b3-93e8-4c32-b207-304e3a43ce77@linaro.org> <20260603170823.GA101133@e132581.arm.com> Content-Language: en-US From: James Clark In-Reply-To: <20260603170823.GA101133@e132581.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 03/06/2026 6:08 pm, Leo Yan wrote: > On Wed, Jun 03, 2026 at 05:01:02PM +0100, James Clark wrote: > > [...] > >>>> +# Remove open brace lines as they may not be hit depending on the compiler >>>> +sed -i \ >>>> + -e '/deterministic.c:8$/d' \ >>>> + -e '/deterministic.c:15$/d' \ >>>> + -e '/deterministic.c:23$/d' \ >>>> + "$tmpdir/script" >>> >>> Is this related to the function definition? >>> >>> I can see the brace lines with change below. It might be more reliable >>> if adding unused function argument, which can give chance for hit >>> function entry. >>> >>> static int function1(void) >>> { >>> ... >>> >>> return 0; >>> } >> >> Originally I included the brace lines in the test and it was working even >> without function arguments, but Sashiko mentioned that they may not always >> be hit. > > I tried Clang to build the program and can see the brace lines are > missed for function1() / function2(). > > Does Sashiko mention any reasons causing the issue? > >> I think its point was that there is no hard rule about debug symbols for >> open braces and the behavior might change from one version of the compiler >> to the next, or whether there is a function prologue or inlining or not etc. >> >> I don't think it's important to the test at all though? So to err on the >> side of caution it makes sense to not test for them. Unless there's a reason >> you think testing for open braces is important? Surely just testing for >> actual lines of code appearing in a certain order is enough. > > As the test program is named as "deterministic", wouldn't we expect the > test to hit every code line run in the program? > > It is fine for me to skip some checks _if_ we know the reason. I dumped > the disassembly, it shows function entry is a distinguished position > from the first calculation sentence (same for both GCC and Clang). And > there have no difference for a function entry after I tweaked the > function return type from "void" to "int". I still have no clue why > brace lines are misses. > > Thanks, > Leo Seems like the compiler is free to emit a prologue or not for a static function. Adding an argument might force it to for one version, but I don't see that being reliable for every future version. And I don't think we gain anything by testing the braces. Testing clang did reveal that it returns back to the call site where GCC didn't though. So I'll also filter out the call site and only test the "dt_work += 7;" lines. That's enough to check that the decode has done everything in the right order and shouldn't be fragile to anything that isn't a real bug.