From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D37233101BC for ; Sun, 31 May 2026 09:18:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780219130; cv=none; b=NIv1xRXw7MIllC6Apdy3wDNKHWFRSiqYNr5Lw4FM7dgCei5Vq3SpaevEtLoeztej297DN55kPpexHdRPm2LbR1ntZpn2kow4KSmKFvNu5IQ4kGgLcVGhV82075JmAsyuRhaI4uWscmvvuW3F5w6BbT0v62wINInVrH/b3SXe1Ug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780219130; c=relaxed/simple; bh=Oi9TOfRM00yKh2hjFmYWzrjR4gdAQnsqLvjS47ZWXt0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fRcy+GbcGQfEK3Zc0xHa7VoBG3YrmDrUbgpvnXuH/JGxeohZORTykitB7Bhb3lWZHmvfesH+TPhvF1Yiqw+r/VXBwfWI1vWsjcxi6ouUuQa5y8G/RmQ9MV7GQLLPi0IuMWcbbuuoBfaPUxtpdwlwgcWe9kfr43AfceBD5wnf0mE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=I85kX9iH; arc=none smtp.client-ip=91.218.175.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="I85kX9iH" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1780219125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pUXlvjUSNqO6nqpsnfmoQbgmo6bJELXxqIMM5q8DZak=; b=I85kX9iHuSB4rgELtUXiTKxp4LeoVAJXY9ZiGYr1JFPIhsY68s9PiOoNM8YX9CUag5u9qs WOhcmabCUD/dnIWkLMCpicmBHd4yclTqlOYvf/wfm6KmJxrs9uVDwk1xmLIuxFKRdU97f6 4C/NRfHTqAiXngV82B0AoXZTN63E6Zo= From: Kunwu Chan To: sj@kernel.org, shuah@kernel.org Cc: damon@lists.linux.dev, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Kunwu Chan , Wang Lian , Kunwu Chan Subject: [PATCH 3/5] selftests/damon/damos_tried_regions: fix expectation output and join TypeError Date: Sun, 31 May 2026 17:17:22 +0800 Message-ID: <20260531091724.84381-3-kunwu.chan@linux.dev> In-Reply-To: <20260531091724.84381-1-kunwu.chan@linux.dev> References: <20260531085633.48626-1-kunwu.chan@linux.dev> <20260531091724.84381-1-kunwu.chan@linux.dev> Precedence: bulk X-Mailing-List: damon@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Kunwu Chan The expectation print has wrong operator precedence: '%' binds before the conditional expression, so the else branch prints 'not met' without the prefix 'expectation (>= 14) is'. Add parentheses to fix it. Also, '\n'.join() on the list of ints raises TypeError; convert to str in the list comprehension. Co-developed-by: Wang Lian Signed-off-by: Wang Lian Signed-off-by: Kunwu Chan --- tools/testing/selftests/damon/damos_tried_regions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/damon/damos_tried_regions.py b/tools/testing/selftests/damon/damos_tried_regions.py index 3b347eb28bd2..d6472e6a6e08 100755 --- a/tools/testing/selftests/damon/damos_tried_regions.py +++ b/tools/testing/selftests/damon/damos_tried_regions.py @@ -55,10 +55,10 @@ def main(): collected_nr_regions.sort() sample = collected_nr_regions[4] print('50-th percentile nr_regions: %d' % sample) - print('expectation (>= 14) is %s' % 'met' if sample >= 14 else 'not met') + print('expectation (>= 14) is %s' % ('met' if sample >= 14 else 'not met')) if collected_nr_regions[4] < 14: print('full nr_regions:') - print('\n'.join(collected_nr_regions)) + print('\n'.join(['%d' % x for x in collected_nr_regions])) exit(1) if __name__ == '__main__': -- 2.43.0