Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1957598lqm; Fri, 3 May 2024 11:04:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUzkAENaANB4PKFRJxaQx48sgxGDzUGQTUIKOh6zHZ9ErQVsKgqAWV7DQNnlytcb6UFupzxOkwqdOBjKh3G6p5p8mwZJpqDXrKaTgsFEw== X-Google-Smtp-Source: AGHT+IGZ7juHcVKU9TH34y+8LV3ZpGApLKNtqyt3/x+AnDJa67ff7KLDroPKA57ucnwrG7mdHZqw X-Received: by 2002:a05:6a21:2788:b0:1a9:90e0:4760 with SMTP id rn8-20020a056a21278800b001a990e04760mr2791147pzb.56.1714759471130; Fri, 03 May 2024 11:04:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714759471; cv=pass; d=google.com; s=arc-20160816; b=Ta9Z36LbYydsNQ9hhY2ElbCfTHCLCNM+4IgATS/zEkC9VLr0uBWmd64UwEJZ6eCSFM /leWDcYr8ooJiqMtgk/TNaZHEyeiRCrlbSavUFOaj+fORWkHJZZt0H3wRlLt+ShhjefM B70mbeCFxxIJKFW9R613Dc9K4/2y3dbDrcfzWOSAEv0K5W5UP8Gm/GtB7r1aS9Scg3yr bp+xFGP/m3XyJwb9ETrJ4JBCjNID6YuKoBmtvpdY8+6mKio2jnS/UFtVPBYcBLtMx+y8 tCDd/A09niv3yvjFScO57gsKJRSKatyB+0hJ3LZp+IeZLTPP/HQuLw17dWPOYReIofyU 5Bgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7rPprOqM7s4oaACo2XLRlluoW10D3cY9uQtSM5vBkQY=; fh=9H4z7/o7y4OLn0xLmjdSk9Pth53+ED/R+iGnGlnIr7g=; b=LMAhslj+i3+JgexOmPD0unF0W9k7e8JX7kxjp5PpSr5wRkjbsgAgsb1kZutz59rfYV oOLMBqQSKaGFBQyK/JxQLJal3GfNn/hQHnIZq4vWe0iEPwNgfCJuBnfywFhOMTq7N2x2 cFY8Bi/8RrIiOL1mIQw6iBiLSbAI05xn4G0dNx15vBI2YEIUT04VRsuu1E3WkkYvjMpo Lb1s2klrSFgv6dhuFv0UeUhcwArM08DAZFGCl89uMIcWrlqeJQoQpuWqVicdGngIwsqc vILY1pWm/o3IhO56E48XMVCVqPGUVhKNI3RrRJCh0grxCauNiUvsCX/wl4OjPBTVdN8M 4KYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mNN27e7D; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167998-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j16-20020a056a00131000b006eab1d8a23asi2498804pfu.172.2024.05.03.11.04.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 11:04:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mNN27e7D; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167998-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167998-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AA4ACB23004 for ; Fri, 3 May 2024 18:04:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 91E4615887B; Fri, 3 May 2024 18:03:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mNN27e7D" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AB0D2158845; Fri, 3 May 2024 18:03:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759404; cv=none; b=nVnOOiJNq2rjwd8c04nmUSjN7EgHhlHKYzDfxUbL8qt1V+pz/EqR2u1HdNM+YuPlkw2sbwxwiSOsW0KbKSPkFE/UpG9wxZrR+LVxGPedllJm9VTeu+yEyvRtGpI73GrPu5MbYcIklWr33lkVlvKt6UcLx/sY9vricjNVi0+kh4k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714759404; c=relaxed/simple; bh=3OCJo+mdOOU+eYdVwx29gwu7K+0FClrtGDmTiLBUZvo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ciuoz4YUwhiyZoNh+i8Fv1hJT1QsZFKDf+GNK1/JzG7ELLcMVUjJW16lJOKYs4Lmn38CAI+TtRpZBuKKBfCRRt0/akXP+a6F4vVOsT81J9K3IcLC56tyvjIeMQxWvvSzetdSXM8DfoOt4CB+4mW8vco/B1d9XhqWKPc8UHtJ6ys= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mNN27e7D; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BC55C4AF48; Fri, 3 May 2024 18:03:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714759404; bh=3OCJo+mdOOU+eYdVwx29gwu7K+0FClrtGDmTiLBUZvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mNN27e7D0zmbKWvmat7LzEJ39cI0NXToH46je6GTKxDPulfpOt3Z+Hq0yQfmDRFCG YzLjFaAxqfcNfFodwdGgqkgdn7gM23A0H3HOgN6wPDz6/JDzbYbwOwPvO8jLQ44148 NJRIPYUQcnKfnmYFVTsRN7zt2P/QM0wO6rnqCyceKpojejtqUUslxMcrkltmbeEP01 FNbdumleZNUFrX8fq9RtfVWcxYWrayO6CV/yLnhKeF8BpqGsvUywy5IqnIWqcouWzm IbdAeCODmvwrjnL4E5ZgHWDSl6aVG3/lDSrMYXIrKTnZmHP5lBUzfEDWcRm6YWo35Q kZG9dG+PQvCYA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/10] selftests/damon/_damon_sysfs: find sysfs mount point from /proc/mounts Date: Fri, 3 May 2024 11:03:11 -0700 Message-Id: <20240503180318.72798-4-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503180318.72798-1-sj@kernel.org> References: <20240503180318.72798-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit _damon_sysfs.py assumes sysfs is mounted at /sys. In some systems, that might not be true. Find the mount point from /proc/mounts file content. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_damon_sysfs.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py index fffa74a78bd7..5367e98817a9 100644 --- a/tools/testing/selftests/damon/_damon_sysfs.py +++ b/tools/testing/selftests/damon/_damon_sysfs.py @@ -2,7 +2,18 @@ import os -sysfs_root = '/sys/kernel/mm/damon/admin' +ksft_skip=4 + +sysfs_root = None +with open('/proc/mounts', 'r') as f: + for line in f: + dev_name, mount_point, dev_fs = line.split()[:3] + if dev_fs == 'sysfs': + sysfs_root = '%s/kernel/mm/damon/admin' % mount_point + break +if sysfs_root is None: + print('Seems sysfs not mounted?') + exit(ksft_skip) def write_file(path, string): "Returns error string if failed, or None otherwise" -- 2.39.2