All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Senna Tschudin <peter.senna@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Gustavo Sousa <gustavo.sousa@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH i-g-t 2/2] lib/igt_kmod: Add IGT_HOOK_POST_GPUKMOD_UNBIND
Date: Thu, 3 Jul 2025 21:26:49 +0200	[thread overview]
Message-ID: <ef8c0cb2-b298-479f-a2f1-750d270082ab@linux.intel.com> (raw)
In-Reply-To: <20250703150304.101208-3-peter.senna@linux.intel.com>

Sorry Lucas and Gustavo for the typo in your email address...

On 7/3/2025 5:03 PM, Peter Senna Tschudin wrote:
> Adds an igt_hook after the unbind operation of the GPU kmod intended as
> a strategice entry point for kmemleak scans.
> 
> Can be used with --hook  'post-gpukmod-unbind:...'
> 

Cc: Lucas de Marchi <lucas.demarchi@intel.com>> Cc: Gustavo Souza
<gustavo.souza@linux.intel.com>
> Signed-off-by: Peter Senna Tschudin <peter.senna@linux.intel.com>
> ---
>  lib/igt_hook.c | 5 +++++
>  lib/igt_hook.h | 1 +
>  lib/igt_kmod.c | 7 +++++++
>  3 files changed, 13 insertions(+)
> 
> diff --git a/lib/igt_hook.c b/lib/igt_hook.c
> index 8932d118d..a3f92acd4 100644
> --- a/lib/igt_hook.c
> +++ b/lib/igt_hook.c
> @@ -74,6 +74,8 @@ static const char *igt_hook_evt_type_to_name(enum igt_hook_evt_type evt_type)
>  		return "post-subtest";
>  	case IGT_HOOK_POST_TEST:
>  		return "post-test";
> +	case IGT_HOOK_POST_GPUKMOD_UNBIND:
> +		return "post-gpukmod-unbind";
>  	case IGT_HOOK_NUM_EVENTS:
>  		break;
>  	/* No "default:" case, to force a warning from -Wswitch in case we miss
> @@ -470,6 +472,9 @@ below:\n\
>  		case IGT_HOOK_POST_TEST:
>  			desc = "Occurs after a test case has finished.";
>  			break;
> +		case IGT_HOOK_POST_GPUKMOD_UNBIND:
> +			desc = "Occurs after the GPU kernel module is unbound from the device.";
> +			break;
>  		default:
>  			desc = "MISSING DESCRIPTION";
>  		}
> diff --git a/lib/igt_hook.h b/lib/igt_hook.h
> index e9f97b79b..92d3986e8 100644
> --- a/lib/igt_hook.h
> +++ b/lib/igt_hook.h
> @@ -39,6 +39,7 @@ enum igt_hook_evt_type {
>  	IGT_HOOK_POST_DYN_SUBTEST,
>  	IGT_HOOK_POST_SUBTEST,
>  	IGT_HOOK_POST_TEST,
> +	IGT_HOOK_POST_GPUKMOD_UNBIND,
>  	IGT_HOOK_NUM_EVENTS /* This must always be the last one. */
>  };
>  
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index 6d7f5705c..e300b743a 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -41,6 +41,7 @@
>  #include "igt_aux.h"
>  #include "igt_core.h"
>  #include "igt_debugfs.h"
> +#include "igt_hook.h"
>  #include "igt_kmod.h"
>  #include "igt_ktap.h"
>  #include "igt_sysfs.h"
> @@ -604,6 +605,7 @@ int __igt_intel_driver_unload(char **who, const char *driver)
>   */
>  int igt_kmod_unbind(const char *mod_name, const char *pci_device)
>  {
> +	struct igt_hook *igt_hook = NULL;
>  	char path[PATH_MAX];
>  	struct dirent *de;
>  	int dirlen;
> @@ -633,6 +635,11 @@ int igt_kmod_unbind(const char *mod_name, const char *pci_device)
>  	}
>  
>  	closedir(dir);
> +	igt_hook = igt_hook_get_pointer();
> +	igt_hook_event_notify(igt_hook, &(struct igt_hook_evt){
> +		.evt_type = IGT_HOOK_POST_GPUKMOD_UNBIND,
> +		.target_name = mod_name,
> +	});
>  
>  	return 0;
>  }


  reply	other threads:[~2025-07-03 19:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 15:03 [PATCH i-g-t 0/2] Add post-gpukmod-unbind igt_hook Peter Senna Tschudin
2025-07-03 15:03 ` [PATCH i-g-t 1/2] igt_core: igt_hook_get_pointer() for external hooks Peter Senna Tschudin
2025-07-03 19:25   ` Peter Senna Tschudin
2025-07-11 13:04   ` Gustavo Sousa
2025-07-03 15:03 ` [PATCH i-g-t 2/2] lib/igt_kmod: Add IGT_HOOK_POST_GPUKMOD_UNBIND Peter Senna Tschudin
2025-07-03 19:26   ` Peter Senna Tschudin [this message]
2025-07-11 13:20   ` Gustavo Sousa
2025-07-03 19:25 ` [PATCH i-g-t 0/2] Add post-gpukmod-unbind igt_hook Peter Senna Tschudin
2025-07-03 21:10 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-07-03 21:12 ` ✓ i915.CI.BAT: " Patchwork
2025-07-04  3:41 ` ✗ i915.CI.Full: failure " Patchwork
2025-07-05 13:33 ` ✗ Xe.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef8c0cb2-b298-479f-a2f1-750d270082ab@linux.intel.com \
    --to=peter.senna@linux.intel.com \
    --cc=gustavo.sousa@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.