Message ID | 20240122171408.3328510-1-lucas.demarchi@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-33760-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp2736306dyb; Mon, 22 Jan 2024 09:55:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7FuS96SD75AWeRpA7yMrfSNcbVjqItY5Fh//o1ggAuXZZVyeVVu//oX3hhCdH+nRLt4GG X-Received: by 2002:a17:903:185:b0:1d5:8ac6:3d0f with SMTP id z5-20020a170903018500b001d58ac63d0fmr8390551plg.50.1705946133329; Mon, 22 Jan 2024 09:55:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705946133; cv=pass; d=google.com; s=arc-20160816; b=Y3LB4Us+5NsDuY0uK0YJiGgZqTNe5t1r24HNXwKPiG+AdkPV8W8jzHf2PgR5b/LX4v A8BhjxHMWFbU3uG7Bt6RjZKJR4fus4Sje7pdT/4stTS8IDEjTAT/cVmqgaQCtrWrKHbv 8wGnMANlC6qT8/UIZpvJ+va1iCgP9wJPs+MHGb1m1TDJHdXZm8FUa7YrqnSR+2vNAIH8 z5O9MgeXVQPwKVOL1unXILsWjkEmQC5eYGN4wTRDhMhVQbSWNGOUypKZBoIWMCzW+DJ1 q9uytioN5RgfMpBfmrOKvLDc+Wg1M2mUZ4hTo1pzrAWcKkfoBkmSdZahyMTiI1cEV7Q9 aR4w== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=hkDrMppdo2YSOStvhrrgCQNeZyenCLj61ibX++y7gX0=; fh=/nRO8ERNpUyoJu1NMPcsy5Lo1TtPrSPgCo2eAnr30iY=; b=jA889PSDyUOcT/d2NfuBzoJKD0SExgGRWtIr+G8NKn6TyUuN5ACVTGraEDbJrdnv1M +59BUSUWTrpY1VSN83oaQIajIZCRaN54zRCS0IFr7sYNR5WyRav8XEG6Y84ms/UVnQM0 pgLIXNa4Bo5mDxb3UXo8dJm16idgxnvdtw6Mk3taLzuFRPgOaY51lN9Z5QJm/dHt4WuP Y/0sKlJ1rBzDy7EQXkaUBSsyFRcXK0WWFIp0SpM6QbfGHP+GFwXGX2qEJJkB03YULMRa n968i8qW9qmGLHW6slSf+yckFLMQ6YJjeXBpeUpToJi2oGmNkssSiUSHzZUYK6VaXjFJ m+iw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jhIFD7OI; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-33760-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33760-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jj18-20020a170903049200b001d5e1353698si8351663plb.201.2024.01.22.09.55.33 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 09:55:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33760-ouuuleilei=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; dkim=pass header.i=@intel.com header.s=Intel header.b=jhIFD7OI; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-33760-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33760-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 879902872E4 for <ouuuleilei@gmail.com>; Mon, 22 Jan 2024 17:48:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FBDB4CDF5; Mon, 22 Jan 2024 17:14:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jhIFD7OI" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (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 C1FAF4CB47; Mon, 22 Jan 2024 17:14:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705943664; cv=none; b=LAjE762TUIvFfRuXM/2ll6rVajRzHcUDFuuzW0VqzQE1a3kaKXwdMy9vNPednB3Repv3+qAswWax/wthtEA2PXLZd80Skvu3MyVGySqekabKsPazSla5b2VPXfsitjpFO8gWoyi4hBlxKIV8hRnRtyt/twDEEs56Z+paVzv+tvs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705943664; c=relaxed/simple; bh=QzD4pwvbiYZ9itdJVQhid9o2mLBqbUNnCZYBsNS9LKg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Kfdxj2cuETX2FBX5fxfLAZQeIGi2QT4uW0VagsWltQEflNICX3AX2fTP5RSgtgnc5gU80N8b9gnloPjws4FzLADEiMuV7Jkzjk/0ojUTvHZgTUZM0bVbVaPVM6u5kzYiHl06OoRgLX3qsGYe9tLXPz6fSr5zFOADffM+qp62je4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jhIFD7OI; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705943663; x=1737479663; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QzD4pwvbiYZ9itdJVQhid9o2mLBqbUNnCZYBsNS9LKg=; b=jhIFD7OIN2p7EndLpaeFtoLulbLkfBLPjhpddSstnXK7j/8HA/iQG9bn H3oa2UF3Ef7eookiQCPq1TAYTBxjgnJSaiXyRDs9zWkKVMEY5ipmbuFc6 xghY2XR/8QiySIT9wArQtJnWSh0TXpY31AIAJSo7bk4ZKC3kN81Qoo9tm TG8gDTpVbxMR4/4M72tdRg5Xi9mujHVKdcBZwY5P1VYc+DUINFIefKZD8 f5xofdrDhpjjolG2v2mRqH0oeob1Wcu4Jp25j54LIUEbbM1UTCVa2D5JX c0HSgBNs3pHLagf6R4UxBnoCF8gZnUG7/cJaB0u+U2Sz/2diEkS7NZMwu Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="8023203" X-IronPort-AV: E=Sophos;i="6.05,211,1701158400"; d="scan'208";a="8023203" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 09:14:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="735233041" X-IronPort-AV: E=Sophos;i="6.05,211,1701158400"; d="scan'208";a="735233041" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.196]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 09:14:21 -0800 From: Lucas De Marchi <lucas.demarchi@intel.com> To: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org Cc: Lucas De Marchi <lucas.demarchi@intel.com>, "Krzysztofik, Janusz" <janusz.krzysztofik@intel.com>, Rae Moar <rmoar@google.com>, "David Gow" <davidgow@google.com>, Brendan Higgins <brendan.higgins@linux.dev>, "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org> Subject: [PATCH v2] kunit: Mark filter* params as rw Date: Mon, 22 Jan 2024 09:14:08 -0800 Message-Id: <20240122171408.3328510-1-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788814172494962526 X-GMAIL-MSGID: 1788814172494962526 |
Series |
[v2] kunit: Mark filter* params as rw
|
|
Commit Message
Lucas De Marchi
Jan. 22, 2024, 5:14 p.m. UTC
By allowing the filter_glob parameter to be written to, it's possible to tweak the testsuites that will be executed on new module loads. This makes it easier to run specific tests without having to reload kunit and provides a way to filter tests on real HW even if kunit is builtin. Example for xe driver: 1) Run just 1 test # echo -n xe_bo > /sys/module/kunit/parameters/filter_glob # modprobe -r xe_live_test # modprobe xe_live_test # ls /sys/kernel/debug/kunit/ xe_bo 2) Run all tests # echo \* > /sys/module/kunit/parameters/filter_glob # modprobe -r xe_live_test # modprobe xe_live_test # ls /sys/kernel/debug/kunit/ xe_bo xe_dma_buf xe_migrate xe_mocs For completeness and to cover other use cases, also change filter and filter_action to rw. Link: https://lore.kernel.org/intel-xe/dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/ Reviewed-by: Rae Moar <rmoar@google.com> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> --- Rae, I kept your r-b from v1 since the additions are just what we talked about. v2: also change filter_action and filter to rw, testing with the xe module to see if filter=module=none filter_action=skip produces the result expected by igt lib/kunit/executor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On Tue, 23 Jan 2024 at 01:14, Lucas De Marchi <lucas.demarchi@intel.com> wrote: > > By allowing the filter_glob parameter to be written to, it's possible to > tweak the testsuites that will be executed on new module loads. This > makes it easier to run specific tests without having to reload kunit and > provides a way to filter tests on real HW even if kunit is builtin. > Example for xe driver: > > 1) Run just 1 test > # echo -n xe_bo > /sys/module/kunit/parameters/filter_glob > # modprobe -r xe_live_test > # modprobe xe_live_test > # ls /sys/kernel/debug/kunit/ > xe_bo > > 2) Run all tests > # echo \* > /sys/module/kunit/parameters/filter_glob > # modprobe -r xe_live_test > # modprobe xe_live_test > # ls /sys/kernel/debug/kunit/ > xe_bo xe_dma_buf xe_migrate xe_mocs > > For completeness and to cover other use cases, also change filter and > filter_action to rw. > > Link: https://lore.kernel.org/intel-xe/dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/ > Reviewed-by: Rae Moar <rmoar@google.com> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> > --- This looks good to me, and works here. Reviewed-by: David Gow <davidgow@google.com> Thanks, -- David > > Rae, I kept your r-b from v1 since the additions are just what we talked > about. > > v2: also change filter_action and filter to rw, testing with the xe > module to see if filter=module=none filter_action=skip produces > the result expected by igt > > lib/kunit/executor.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c > index 1236b3cd2fbb..371ddcee7fb5 100644 > --- a/lib/kunit/executor.c > +++ b/lib/kunit/executor.c > @@ -31,13 +31,13 @@ static char *filter_glob_param; > static char *filter_param; > static char *filter_action_param; > > -module_param_named(filter_glob, filter_glob_param, charp, 0400); > +module_param_named(filter_glob, filter_glob_param, charp, 0600); > MODULE_PARM_DESC(filter_glob, > "Filter which KUnit test suites/tests run at boot-time, e.g. list* or list*.*del_test"); > -module_param_named(filter, filter_param, charp, 0400); > +module_param_named(filter, filter_param, charp, 0600); > MODULE_PARM_DESC(filter, > "Filter which KUnit test suites/tests run at boot-time using attributes, e.g. speed>slow"); > -module_param_named(filter_action, filter_action_param, charp, 0400); > +module_param_named(filter_action, filter_action_param, charp, 0600); > MODULE_PARM_DESC(filter_action, > "Changes behavior of filtered tests using attributes, valid values are:\n" > "<none>: do not run filtered tests as normal\n" > -- > 2.40.1 >
On Tue, Jan 23, 2024 at 04:01:49PM +0800, David Gow wrote: >On Tue, 23 Jan 2024 at 01:14, Lucas De Marchi <lucas.demarchi@intel.com> wrote: >> >> By allowing the filter_glob parameter to be written to, it's possible to >> tweak the testsuites that will be executed on new module loads. This >> makes it easier to run specific tests without having to reload kunit and >> provides a way to filter tests on real HW even if kunit is builtin. >> Example for xe driver: >> >> 1) Run just 1 test >> # echo -n xe_bo > /sys/module/kunit/parameters/filter_glob >> # modprobe -r xe_live_test >> # modprobe xe_live_test >> # ls /sys/kernel/debug/kunit/ >> xe_bo >> >> 2) Run all tests >> # echo \* > /sys/module/kunit/parameters/filter_glob >> # modprobe -r xe_live_test >> # modprobe xe_live_test >> # ls /sys/kernel/debug/kunit/ >> xe_bo xe_dma_buf xe_migrate xe_mocs >> >> For completeness and to cover other use cases, also change filter and >> filter_action to rw. >> >> Link: https://lore.kernel.org/intel-xe/dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/ >> Reviewed-by: Rae Moar <rmoar@google.com> >> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> >> --- > >This looks good to me, and works here. > >Reviewed-by: David Gow <davidgow@google.com> are you going to merge this through kunit tree or should I carry it in drm ? thanks Lucas De Marchi > >Thanks, >-- David > >> >> Rae, I kept your r-b from v1 since the additions are just what we talked >> about. >> >> v2: also change filter_action and filter to rw, testing with the xe >> module to see if filter=module=none filter_action=skip produces >> the result expected by igt >> >> lib/kunit/executor.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c >> index 1236b3cd2fbb..371ddcee7fb5 100644 >> --- a/lib/kunit/executor.c >> +++ b/lib/kunit/executor.c >> @@ -31,13 +31,13 @@ static char *filter_glob_param; >> static char *filter_param; >> static char *filter_action_param; >> >> -module_param_named(filter_glob, filter_glob_param, charp, 0400); >> +module_param_named(filter_glob, filter_glob_param, charp, 0600); >> MODULE_PARM_DESC(filter_glob, >> "Filter which KUnit test suites/tests run at boot-time, e.g. list* or list*.*del_test"); >> -module_param_named(filter, filter_param, charp, 0400); >> +module_param_named(filter, filter_param, charp, 0600); >> MODULE_PARM_DESC(filter, >> "Filter which KUnit test suites/tests run at boot-time using attributes, e.g. speed>slow"); >> -module_param_named(filter_action, filter_action_param, charp, 0400); >> +module_param_named(filter_action, filter_action_param, charp, 0600); >> MODULE_PARM_DESC(filter_action, >> "Changes behavior of filtered tests using attributes, valid values are:\n" >> "<none>: do not run filtered tests as normal\n" >> -- >> 2.40.1 >>
On Wed, 24 Jan 2024 at 00:31, Lucas De Marchi <lucas.demarchi@intel.com> wrote: > > On Tue, Jan 23, 2024 at 04:01:49PM +0800, David Gow wrote: > >On Tue, 23 Jan 2024 at 01:14, Lucas De Marchi <lucas.demarchi@intel.com> wrote: > >> > >> By allowing the filter_glob parameter to be written to, it's possible to > >> tweak the testsuites that will be executed on new module loads. This > >> makes it easier to run specific tests without having to reload kunit and > >> provides a way to filter tests on real HW even if kunit is builtin. > >> Example for xe driver: > >> > >> 1) Run just 1 test > >> # echo -n xe_bo > /sys/module/kunit/parameters/filter_glob > >> # modprobe -r xe_live_test > >> # modprobe xe_live_test > >> # ls /sys/kernel/debug/kunit/ > >> xe_bo > >> > >> 2) Run all tests > >> # echo \* > /sys/module/kunit/parameters/filter_glob > >> # modprobe -r xe_live_test > >> # modprobe xe_live_test > >> # ls /sys/kernel/debug/kunit/ > >> xe_bo xe_dma_buf xe_migrate xe_mocs > >> > >> For completeness and to cover other use cases, also change filter and > >> filter_action to rw. > >> > >> Link: https://lore.kernel.org/intel-xe/dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/ > >> Reviewed-by: Rae Moar <rmoar@google.com> > >> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> > >> --- > > > >This looks good to me, and works here. > > > >Reviewed-by: David Gow <davidgow@google.com> > > are you going to merge this through kunit tree or should I carry it in > drm ? > I think we'll merge it via KUnit for 6.9, but if you need it sooner, I doubt it'd cause problems if it went in via DRM instead. -- David
On Wed, Jan 24, 2024 at 11:49:43AM +0800, David Gow wrote: >On Wed, 24 Jan 2024 at 00:31, Lucas De Marchi <lucas.demarchi@intel.com> wrote: >> >> On Tue, Jan 23, 2024 at 04:01:49PM +0800, David Gow wrote: >> >On Tue, 23 Jan 2024 at 01:14, Lucas De Marchi <lucas.demarchi@intel.com> wrote: >> >> >> >> By allowing the filter_glob parameter to be written to, it's possible to >> >> tweak the testsuites that will be executed on new module loads. This >> >> makes it easier to run specific tests without having to reload kunit and >> >> provides a way to filter tests on real HW even if kunit is builtin. >> >> Example for xe driver: >> >> >> >> 1) Run just 1 test >> >> # echo -n xe_bo > /sys/module/kunit/parameters/filter_glob >> >> # modprobe -r xe_live_test >> >> # modprobe xe_live_test >> >> # ls /sys/kernel/debug/kunit/ >> >> xe_bo >> >> >> >> 2) Run all tests >> >> # echo \* > /sys/module/kunit/parameters/filter_glob >> >> # modprobe -r xe_live_test >> >> # modprobe xe_live_test >> >> # ls /sys/kernel/debug/kunit/ >> >> xe_bo xe_dma_buf xe_migrate xe_mocs >> >> >> >> For completeness and to cover other use cases, also change filter and >> >> filter_action to rw. >> >> >> >> Link: https://lore.kernel.org/intel-xe/dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/ >> >> Reviewed-by: Rae Moar <rmoar@google.com> >> >> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> >> >> --- >> > >> >This looks good to me, and works here. >> > >> >Reviewed-by: David Gow <davidgow@google.com> >> >> are you going to merge this through kunit tree or should I carry it in >> drm ? >> > >I think we'll merge it via KUnit for 6.9, but if you need it sooner, I >doubt it'd cause problems if it went in via DRM instead. I think it's fine to have it on your tree. For our CI, we can just apply it on the side to have it working before the 6.9 merge window. thanks Lucas De Marchi
diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c index 1236b3cd2fbb..371ddcee7fb5 100644 --- a/lib/kunit/executor.c +++ b/lib/kunit/executor.c @@ -31,13 +31,13 @@ static char *filter_glob_param; static char *filter_param; static char *filter_action_param; -module_param_named(filter_glob, filter_glob_param, charp, 0400); +module_param_named(filter_glob, filter_glob_param, charp, 0600); MODULE_PARM_DESC(filter_glob, "Filter which KUnit test suites/tests run at boot-time, e.g. list* or list*.*del_test"); -module_param_named(filter, filter_param, charp, 0400); +module_param_named(filter, filter_param, charp, 0600); MODULE_PARM_DESC(filter, "Filter which KUnit test suites/tests run at boot-time using attributes, e.g. speed>slow"); -module_param_named(filter_action, filter_action_param, charp, 0400); +module_param_named(filter_action, filter_action_param, charp, 0600); MODULE_PARM_DESC(filter_action, "Changes behavior of filtered tests using attributes, valid values are:\n" "<none>: do not run filtered tests as normal\n"