Message ID | 20240112001240.1710962-1-lucas.demarchi@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-24174-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp1806128dyi; Thu, 11 Jan 2024 16:13:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6cW/lvX/SWj1YuCCacjCV1uD1S3RH1k0wB02S1xHmZ/5hIhkRsbx108yLnz6qgHMdR5dT X-Received: by 2002:a05:6871:3745:b0:206:a710:6f4d with SMTP id np5-20020a056871374500b00206a7106f4dmr620606oac.43.1705018422389; Thu, 11 Jan 2024 16:13:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705018422; cv=none; d=google.com; s=arc-20160816; b=rj70d/n4gSZ+MRsqvXs+N3V0byqSds73L+DNZ/QDvQY+fFqCbaardCqD/zWAonbYsh k9qr4IwMg7/DHqPzVFy3AgAF6561HV1LAhEgxQVyGHiIXn/PyNeo3RBJAgmdQBdz83Sa PQDz1Y8pRfIRw7nP9b7MzPwuThjumzZYnOzj1i78iJcXAXHR5S7cuJQ7yiEP2G2uol/n pFFkCc0Vs4Q8gjkUyUKaySMDCunwfKCylVg5TVja1H5Jy/Crkm29fiWSexxo6n1+Uvrz 6BZ4SikNBUvq/+COlFyDosokMYwCFqqfeEtyBgNxR2QYQFNUK6gIihkSYsjx7GtMamQw x6hA== ARC-Message-Signature: i=1; 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=1y+a7Ey96VXZG8B/l1cwUkrlwzPCNBxt1/TAGxpOCeM=; fh=dje/RpDf2arD7EJ1G0YDPeYMwG3A5h7qtVPc/nCt1hA=; b=KhTuGIdR2a2ftwGTtV7fxRcTHP7U3+JmpN3yv1YVzJ+z1h5cB41f6PIvDK4oQnJdy4 FONU9yYrUj7WmFT58Ho9g116iahSvH6M4QYGbuvuH7rhANkquLcnXLi6l3kMM3bVtsXW B/t6enYls7tv3NMvFFficCfrFL3VC6HRP7OQFGT76IZpPXesUsUrPb9c7FkTtbLx0vJt miq8z9PK7l5T+sWXR+C5YabXx3zreYjKPN8iEhMQ2DL3ANK7LE8PQjIuAwBxn6wATUge n1QDfTzmD53HoC3vTUQFRboxC2aam3m9JbFnDh+7pJDiB7cYmJpORtxLs2MGe0QzCEc+ WD2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CPrprL4R; spf=pass (google.com: domain of linux-kernel+bounces-24174-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24174-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b21-20020a656695000000b005bd3da15474si2023073pgw.839.2024.01.11.16.13.41 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 16:13:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24174-ouuuleilei=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=@intel.com header.s=Intel header.b=CPrprL4R; spf=pass (google.com: domain of linux-kernel+bounces-24174-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24174-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BC877B236D9 for <ouuuleilei@gmail.com>; Fri, 12 Jan 2024 00:13:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C578A38; Fri, 12 Jan 2024 00:13:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CPrprL4R" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) (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 20DF562A; Fri, 12 Jan 2024 00:13:17 +0000 (UTC) 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=1705018398; x=1736554398; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=AAr1jyF5ycUc3fnsLZxVVxgsc9+kH7u4LIsdUC1Iv88=; b=CPrprL4RslQDBzP9Wkh9a1me/QYZkRnhRHgHzsZqzOakB5P5qgSHSb8i EBX3Cm3pd4tO1ZLC5TNF27m2K+pEIwy821Wz1C9dzu6d3My8QN6CXdpW5 9nFZs65aXwt+EDbiRlUjXfZIultIqaueQwcCYF8Jq/lL/sxniI0C09dX6 5nGBDDRWl7lBaCeZiH9Scnit/Jzz9gr3EYdvbjpw3Lt1FpwOfzXjmGbda XgGqJO6xS6sgeIQ5VZrFfWQ1M4+VeegsyA2yJ8ULBXPcdrZOAJ1j2EyIx GGaD1x/hk+Nu1WcRD6U0gdT1rAKfh/Jur57RT9F77I/NCYVO1v1K+Z3Jg g==; X-IronPort-AV: E=McAfee;i="6600,9927,10950"; a="397915559" X-IronPort-AV: E=Sophos;i="6.04,187,1695711600"; d="scan'208";a="397915559" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 16:13:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10950"; a="853120102" X-IronPort-AV: E=Sophos;i="6.04,187,1695711600"; d="scan'208";a="853120102" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.196]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 16:13:16 -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: David Gow <davidgow@google.com>, Brendan Higgins <brendan.higgins@linux.dev>, <intel-xe@lists.freedesktop.org>, Lucas De Marchi <lucas.demarchi@intel.com> Subject: [PATCH] kunit: Mark filter_glob param as rw Date: Thu, 11 Jan 2024 16:12:40 -0800 Message-Id: <20240112001240.1710962-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: 1787841397270311612 X-GMAIL-MSGID: 1787841397270311612 |
Series |
kunit: Mark filter_glob param as rw
|
|
Commit Message
Lucas De Marchi
Jan. 12, 2024, 12:12 a.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
References: https://lore.kernel.org/intel-xe/dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
lib/kunit/executor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Jan 18, 2024 at 05:23:33PM -0500, Rae Moar wrote: >On Thu, Jan 11, 2024 at 7:13 PM 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 >> >> References: https://lore.kernel.org/intel-xe/dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/ >> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> > >Hello! > >I have tested this and this looks good to me. I agree this is very >helpful and I wonder if we should do the same with the other module >parameters (filter, filter_action). yeah, after I sent this I was wondering about the other parameters. I don't have a use for them right now, but I can try a few things and spin a new version if people find it useful. > >It did worry me to make filter_glob writable due to the recent patch >that requires the output of filtering to be a valid virtual address >but I think there is a sufficient amount of checking of filter_glob. > >Thanks! >-Rae > >Reviewed-by: Rae Moar <rmoar@google.com> thanks Lucas De Marchi
On Friday, 19 January 2024 00:29:33 CET Lucas De Marchi wrote: > On Thu, Jan 18, 2024 at 05:23:33PM -0500, Rae Moar wrote: > >On Thu, Jan 11, 2024 at 7:13 PM 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 > >> > >> References: https://lore.kernel.org/intel-xe/ dzacvbdditbneiu3e3fmstjmttcbne44yspumpkd6sjn56jqpk@vxu7sksbqrp6/ > >> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> > > > >Hello! > > > >I have tested this and this looks good to me. I agree this is very > >helpful and I wonder if we should do the same with the other module > >parameters (filter, filter_action). > > yeah, after I sent this I was wondering about the other parameters. I > don't have a use for them right now, but I can try a few things and spin > a new version if people find it useful. Yes, please do. I find it very useful for improving the current implementation of IGT kunit which now depends the ability to unload and reload the kunit base module with specific filter parameters in order to get a KTAP formatted list of test cases without executing them, then to run those test cases filtered one by one. Thanks, Janusz > > > > >It did worry me to make filter_glob writable due to the recent patch > >that requires the output of filtering to be a valid virtual address > >but I think there is a sufficient amount of checking of filter_glob. > > > >Thanks! > >-Rae > > > >Reviewed-by: Rae Moar <rmoar@google.com> > > thanks > Lucas De Marchi > > --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN. Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych. Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
diff --git a/lib/kunit/executor.c b/lib/kunit/executor.c index 1236b3cd2fbb..30ed9d321c19 100644 --- a/lib/kunit/executor.c +++ b/lib/kunit/executor.c @@ -31,7 +31,7 @@ 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);