From 0268d73b0b267c6f5acdd4bf40ae917b3afff96c Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Thu, 1 Dec 2016 21:45:47 +0000 Subject: lib/igt_kmod: New library to support driver loading/unloading and additional helpers. lib/igt_aux: Added igt_pkill and igt_lsof helper. lib/igt_kmod: Added load/unload kmod helpers. v7: - document the case where leaving stray fd from drm_open_driver() might fail reloading the driver. - list also current opened files from /dev/dri in case we could not unload the driver. - convert igt_info to igt_warn (Chris Wilson) - added KMOD_|PROCPS CFLAGS (Chris Wilson) v6: - include latest modifications from tests/drv_module_reload: display all loaded modules and list information about opened files by processes (Petri Latvala) v5: - added igt_i915_driver_{load/unload}. - added kick_snd_hda_intel() to match current tests/drv_module_reload_basic and integrated into igt_i915_driver_load/unload. - added gtk-doc section for lib/igt_kmod v4: - decided to split libkmod helpers into their own file as there's another user lib/igt_gvt or tests/gvt_basic. - fixed some gtk-doc documentation. v3: - return -errno (igt_pkill()) in case of failure (Cris Wilson) - return bool for igt_kmod_is_loaded(), replaced strncasecmp with strncmp (Chris Wilson) v2: - Renamed libkmod helpers (Chris Wilson) - Removed SIGTERM/SIGKILL case where we repeatedly tried to terminate the process: just call kill(2) once (Chris Wilson) - Removed redundant check in igt_kmod_unload(), igt_module_in_use() (Chris Wilson) - Pass flags to igt_kmod_unload() from the caller (Chris Wilson) - Removed useless function igt_kill() which acts just as kill(2) (Chris Wilson) Signed-off-by: Marius Vlad --- lib/igt_aux.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/igt_aux.h') diff --git a/lib/igt_aux.h b/lib/igt_aux.h index 69894484..ca728c26 100644 --- a/lib/igt_aux.h +++ b/lib/igt_aux.h @@ -275,6 +275,9 @@ double igt_stop_siglatency(struct igt_mean *result); void igt_set_module_param(const char *name, const char *val); void igt_set_module_param_int(const char *name, int val); +int igt_terminate_process(int sig, const char *comm); +void igt_lsof(const char *dpath); + /* * This list data structure is a verbatim copy from wayland-util.h from the * Wayland project; except that wl_ prefix has been removed. -- cgit v1.2.3