[bootlin/training-materials updates] master: debugging: labs: remove unused lab data (4b876546)

Alexis Lothoré alexis.lothore at bootlin.com
Thu Aug 3 14:39:00 CEST 2023


Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/4b876546ba8ebbcc1cfe8ce79cb96e4a4dc6a387

>---------------------------------------------------------------

commit 4b876546ba8ebbcc1cfe8ce79cb96e4a4dc6a387
Author: Alexis Lothoré <alexis.lothore at bootlin.com>
Date:   Thu Aug 3 14:22:28 2023 +0200

    debugging: labs: remove unused lab data
    
    irqs latency lab has been removed a while ago, so remove associated labs
    data
    
    Signed-off-by: Alexis Lothoré <alexis.lothore at bootlin.com>


>---------------------------------------------------------------

4b876546ba8ebbcc1cfe8ce79cb96e4a4dc6a387
 .../debugging/nfsroot/root/irqs_latency/Makefile   | 10 ---
 .../debugging/nfsroot/root/irqs_latency/irqs_off.c | 73 ----------------------
 2 files changed, 83 deletions(-)

diff --git a/lab-data/debugging/nfsroot/root/irqs_latency/Makefile b/lab-data/debugging/nfsroot/root/irqs_latency/Makefile
deleted file mode 100644
index e3c75198..00000000
--- a/lab-data/debugging/nfsroot/root/irqs_latency/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-ifneq ($(KERNELRELEASE),)
-obj-m := irqs_off.o
-else
-KDIR ?= $(HOME)/debugging-labs/src/linux
-all:
-	$(MAKE) -C $(KDIR) M=$$PWD
-
-clean:
-	$(MAKE) -C $(KDIR) M=$$PWD clean
-endif
diff --git a/lab-data/debugging/nfsroot/root/irqs_latency/irqs_off.c b/lab-data/debugging/nfsroot/root/irqs_latency/irqs_off.c
deleted file mode 100644
index 7794ca65..00000000
--- a/lab-data/debugging/nfsroot/root/irqs_latency/irqs_off.c
+++ /dev/null
@@ -1,73 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-
-#include <linux/module.h>
-#include <linux/delay.h>
-#include <linux/kthread.h>
-
-#define DELAY_MSEC	1
-
-static struct task_struct *kthread_cpu[CONFIG_NR_CPUS];
-
-struct task_struct *__kthread_create_on_cpu(int (*threadfn)(void *data),
-					    void *data, unsigned int cpu,
-					    const char *namefmt)
-{
-	struct task_struct *p;
-
-	p = kthread_create_on_node(threadfn, data, cpu_to_node(cpu), namefmt,
-				   cpu);
-	if (IS_ERR(p))
-		return p;
-	kthread_bind(p, cpu);
-
-	return p;
-}
-
-static int thread_routine(void *data)
-{
-	unsigned long flags;
-	
-	while(1) {
-		local_irq_save(flags);
-		mdelay(DELAY_MSEC);
-		local_irq_restore(flags);
-
-		usleep_range(1000, 2000);
-
-		if (kthread_should_stop())
-			break;
-	}
-
-	return 0;
-}
-
-static int worker_module_init(void)
-{
-	int cpu;
-
-	for_each_online_cpu(cpu) {
-		kthread_cpu[cpu] = __kthread_create_on_cpu(thread_routine,
-							   &kthread_cpu[cpu], cpu,
-							   "irqsworker");
-		if (!kthread_cpu[cpu])
-			return -EINVAL;
-
-		wake_up_process(kthread_cpu[cpu]);
-	}
-
-	return 0;
-}
-
-static void worked_module_exit(void)
-{
-	int cpu;
-
-	for (cpu = 0; cpu < CONFIG_NR_CPUS; cpu++) {
-		if (kthread_cpu[cpu])
-			kthread_stop(kthread_cpu[cpu]);
-	}
-}
-
-module_init(worker_module_init);
-module_exit(worked_module_exit);
-MODULE_LICENSE("GPL");
\ No newline at end of file




More information about the training-materials-updates mailing list