From c0c005ac56eaa771cac7b63088ef76a975b39c50 Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Mon, 26 Mar 2018 11:05:24 +0300 Subject: [PATCH 1/4] Documentation: tools: labs: Use assignments subfolder for assignments Signed-off-by: Razvan Deaconescu --- .../{hello_assignment/hello-world => assignments/00-hello}/Kbuild | 0 .../00-hello}/checker/hello-world-checker | 0 .../hello-world => assignments/00-hello}/hello-world.c | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename tools/labs/templates/{hello_assignment/hello-world => assignments/00-hello}/Kbuild (100%) rename tools/labs/templates/{hello_assignment => assignments/00-hello}/checker/hello-world-checker (100%) rename tools/labs/templates/{hello_assignment/hello-world => assignments/00-hello}/hello-world.c (100%) diff --git a/tools/labs/templates/hello_assignment/hello-world/Kbuild b/tools/labs/templates/assignments/00-hello/Kbuild similarity index 100% rename from tools/labs/templates/hello_assignment/hello-world/Kbuild rename to tools/labs/templates/assignments/00-hello/Kbuild diff --git a/tools/labs/templates/hello_assignment/checker/hello-world-checker b/tools/labs/templates/assignments/00-hello/checker/hello-world-checker similarity index 100% rename from tools/labs/templates/hello_assignment/checker/hello-world-checker rename to tools/labs/templates/assignments/00-hello/checker/hello-world-checker diff --git a/tools/labs/templates/hello_assignment/hello-world/hello-world.c b/tools/labs/templates/assignments/00-hello/hello-world.c similarity index 100% rename from tools/labs/templates/hello_assignment/hello-world/hello-world.c rename to tools/labs/templates/assignments/00-hello/hello-world.c From 75e2e0a9918b271dfa7cb6964c502ee45edbad97 Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Mon, 26 Mar 2018 11:05:52 +0300 Subject: [PATCH 2/4] Documentation: tools: labs: Use _checker script name for 00-hello assignment Signed-off-by: Razvan Deaconescu --- .../00-hello/checker/{hello-world-checker => _checker} | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) rename tools/labs/templates/assignments/00-hello/checker/{hello-world-checker => _checker} (75%) diff --git a/tools/labs/templates/assignments/00-hello/checker/hello-world-checker b/tools/labs/templates/assignments/00-hello/checker/_checker similarity index 75% rename from tools/labs/templates/assignments/00-hello/checker/hello-world-checker rename to tools/labs/templates/assignments/00-hello/checker/_checker index b641ac23c4085f..4b8a0869da2adf 100755 --- a/tools/labs/templates/assignments/00-hello/checker/hello-world-checker +++ b/tools/labs/templates/assignments/00-hello/checker/_checker @@ -1,10 +1,8 @@ #!/bin/sh -[ $# -ne 1 ] && { echo "Usage: $0 path-hello-world.ko"; exit 1; } - /bin/dmesg -c > /dev/null 2>&1 /sbin/rmmod hello-world > /dev/null 2>&1 -/sbin/insmod $1 +/sbin/insmod hello-world.ko /bin/dmesg | grep 'Hello, World!' > /dev/null 2>&1 if test $? -eq 0; then echo "Test PASSED." From 4822c7baee1fe80d643af61be47415d650ff4054 Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Mon, 26 Mar 2018 11:06:13 +0300 Subject: [PATCH 3/4] Documentation: tools: labs: Add skeleton and checker for assignment 0-list Signed-off-by: Razvan Deaconescu --- .../labs/templates/assignments/0-list/Kbuild | 1 + .../assignments/0-list/checker/_checker | 775 ++++++++++++++++++ .../labs/templates/assignments/0-list/list.c | 117 +++ 3 files changed, 893 insertions(+) create mode 100644 tools/labs/templates/assignments/0-list/Kbuild create mode 100755 tools/labs/templates/assignments/0-list/checker/_checker create mode 100644 tools/labs/templates/assignments/0-list/list.c diff --git a/tools/labs/templates/assignments/0-list/Kbuild b/tools/labs/templates/assignments/0-list/Kbuild new file mode 100644 index 00000000000000..5e45a816841549 --- /dev/null +++ b/tools/labs/templates/assignments/0-list/Kbuild @@ -0,0 +1 @@ +obj-m = list.o diff --git a/tools/labs/templates/assignments/0-list/checker/_checker b/tools/labs/templates/assignments/0-list/checker/_checker new file mode 100755 index 00000000000000..a57f7785b310cd --- /dev/null +++ b/tools/labs/templates/assignments/0-list/checker/_checker @@ -0,0 +1,775 @@ +#!/bin/sh + +# +# List kernel API checker +# +# + +# Enable/disable debug (1/0). +DEBUG_=1 + +DEBUG() +{ + if test "x$DEBUG_" = "x1"; then + $@ 1>&2 + fi +} + +max_points=90 + +# Enable/disable exiting when program fails. +EXIT_IF_FAIL=0 + +test_do_fail() +{ + points=$1 + printf "failed [ 0/%02d]\n" "$max_points" + if test "x$EXIT_IF_FAIL" = "x1"; then + exit 1 + fi +} + +test_do_pass() +{ + points=$1 + printf "passed [%02d/%02d]\n" "$points" "$max_points" +} + +basic_test() +{ + message=$1 + points=$2 + shift 2 + test_command=$@ + + printf "%s" "$message" + + i=0 + limit=$((60 - ${#message})) + while test "$i" -lt "$limit"; do + printf "." + i=$(($i+1)) + done + + $test_command > /dev/null 2>&1 + if test $? -eq 0; then + test_do_pass "$points" + else + test_do_fail "$points" + fi +} + +module="list" +module_file="$module".ko +proc_folder="/proc/list" +preview="$proc_folder/preview" +management="$proc_folder/management" + +init_test() +{ + dmesg -c > /dev/null 2>&1 + insmod "$module_file" + if test $? -ne 0; then + echo "Error inserting module." 1>&2 + exit 1 + fi + sleep 1 +} + +cleanup_test() +{ + rmmod "$module" +} + +test_module_exists() +{ + init_test + + lsmod 2> /dev/null | grep -w list > /dev/null 2>&1 + basic_test "module_exists" 1 test "$?" -eq 0 + + cleanup_test +} + +test_proc_folder_exits() +{ + init_test + + basic_test "folder_exists" 1 test -d "$proc_folder" + + cleanup_test +} + +test_preview_exits() +{ + init_test + + basic_test "preview_exists" 1 test -f "$preview" + + cleanup_test +} + +test_management_exits() +{ + init_test + + basic_test "management_exists" 1 test -f "$management" + + cleanup_test +} + +test_preview_is_readable() +{ + init_test + + cat "$preview" > /dev/null 2>&1 + basic_test "preview_is_readable" 1 test $? -eq 0 + + cleanup_test +} + +test_preview_is_not_writable() +{ + init_test + + echo "hello" 2>&1 > "$preview" | grep "Input/output error" > /dev/null + basic_test "preview_is_not_writable" 1 test $? -eq 0 + + cleanup_test +} + +test_management_is_writable() +{ + init_test + + echo "hello" 2>&1 > "$management" | grep "Input/output error" > /dev/null + basic_test "management_is_writable" 1 test $? -ne 0 + + cleanup_test +} + +test_management_is_not_readable() +{ + init_test + + cat "$management" > /dev/null 2>&1 + basic_test "management_is_not_readable" 1 test $? -ne 0 + + cleanup_test +} + +test_addf_no_error() +{ + init_test + + echo "addf lorem" > "$management" 2> /dev/null + basic_test "addf_no_error" 2 test $? -eq 0 + + cleanup_test +} + +test_addf_print() +{ + init_test + + echo "addf lorem" > "$management" + cat "$preview" | grep "lorem" > /dev/null + basic_test "addf_print" 2 test $? -eq 0 + + cleanup_test +} + +test_addf_print_once() +{ + init_test + + echo "addf lorem" > "$management" + no=$(cat "$preview" | grep "lorem" | wc -l) + basic_test "addf_print_once" 2 test "$no" -eq 1 + + cleanup_test +} + +test_adde_no_error() +{ + init_test + + echo "adde lorem" > "$management" 2> /dev/null + basic_test "adde_no_error" 2 test $? -eq 0 + + cleanup_test +} + +test_adde_print() +{ + init_test + + echo "adde lorem" > "$management" + cat "$preview" | grep "lorem" > /dev/null + basic_test "adde_print" 2 test $? -eq 0 + + cleanup_test +} + +test_adde_print_once() +{ + init_test + + echo "adde lorem" > "$management" + no=$(cat "$preview" | grep "lorem" | wc -l) + basic_test "adde_print_once" 2 test "$no" -eq 1 + + cleanup_test +} + +test_addf_two_number() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf ipsum" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "addf_two_number" 2 test "$no" -eq 2 + + cleanup_test +} + +test_addf_two_content() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf ipsum" > "$management" + cat "$preview" | grep "lorem" > /dev/null + ret1=$? + cat "$preview" | grep "ipsum" > /dev/null + ret2=$? + basic_test "addf_two_content" 2 test "$ret1" -eq 0 -a "$ret2" -eq 0 + + cleanup_test +} + +test_addf_same_twice_number() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf lorem" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "addf_same_twice_number" 2 test "$no" -eq 2 + + cleanup_test +} + +test_addf_same_twice_content() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf lorem" > "$management" + cat "$preview" | grep "lorem" > /dev/null + basic_test "addf_same_twice_content" 2 test $? -eq 0 + + cleanup_test +} + +test_addf_same_twice_content_number() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf lorem" > "$management" + no=$(cat "$preview" | grep "lorem" | wc -l) + basic_test "addf_same_twice_content_number" 2 test "$no" -eq 2 + + cleanup_test +} + +test_adde_two_number() +{ + init_test + + echo "adde lorem" > "$management" + echo "adde ipsum" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "adde_two_number" 2 test "$no" -eq 2 + + cleanup_test +} + +test_adde_two_content() +{ + init_test + + echo "adde lorem" > "$management" + echo "adde ipsum" > "$management" + cat "$preview" | grep "lorem" > /dev/null + ret1=$? + cat "$preview" | grep "ipsum" > /dev/null + ret2=$? + basic_test "adde_two_content" 2 test "$ret1" -eq 0 -a "$ret2" -eq 0 + + cleanup_test +} + +test_adde_same_twice_number() +{ + init_test + + echo "adde lorem" > "$management" + echo "adde lorem" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "adde_same_twice_number" 2 test "$no" -eq 2 + + cleanup_test +} + +test_adde_same_twice_content() +{ + init_test + + echo "adde lorem" > "$management" + echo "adde lorem" > "$management" + cat "$preview" | grep "lorem" > /dev/null + basic_test "adde_same_twice_content" 2 test $? -eq 0 + + cleanup_test +} + +test_adde_same_twice_content_number() +{ + init_test + + echo "adde lorem" > "$management" + echo "adde lorem" > "$management" + no=$(cat "$preview" | grep "lorem" | wc -l) + basic_test "adde_same_twice_content_number" 2 test "$no" -eq 2 + + cleanup_test +} + +test_addf_front_after_addf() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf ipsum" > "$management" + + # "ipsum" must be first. + cat "$preview" | head -n 1 | grep "ipsum" > /dev/null + basic_test "addf_front_after_addf" 2 test $? -eq 0 + + cleanup_test +} + +test_addf_front_after_adde() +{ + init_test + + echo "adde lorem" > "$management" + echo "addf ipsum" > "$management" + + # "ipsum" must be first. + cat "$preview" | head -n 1 | grep "ipsum" > /dev/null + basic_test "addf_front_after_adde" 2 test $? -eq 0 + + cleanup_test +} + +test_addf_front_after_adde_addf() +{ + init_test + + echo "adde lorem" > "$management" + echo "addf ipsum" > "$management" + echo "addf dolor" > "$management" + + # "dolor" must be first. + cat "$preview" | head -n 1 | grep "dolor" > /dev/null + basic_test "addf_front_after_adde_addf" 2 test $? -eq 0 + + cleanup_test +} + +test_addf_front_after_addf_adde() +{ + init_test + + echo "addf lorem" > "$management" + echo "adde ipsum" > "$management" + echo "addf dolor" > "$management" + + # "dolor" must be first. + cat "$preview" | head -n 1 | grep "dolor" > /dev/null + basic_test "addf_front_after_addf_adde" 2 test $? -eq 0 + + cleanup_test +} + +test_adde_end_after_addf() +{ + init_test + + echo "addf lorem" > "$management" + echo "adde ipsum" > "$management" + + # "ipsum" must be last. + cat "$preview" | tail -n -1 | grep "ipsum" > /dev/null + basic_test "adde_end_after_addf" 2 test $? -eq 0 + + cleanup_test +} + +test_adde_end_after_adde() +{ + init_test + + echo "adde lorem" > "$management" + echo "adde ipsum" > "$management" + + # "ipsum" must be last. + cat "$preview" | tail -n -1 | grep "ipsum" > /dev/null + basic_test "addf_end_after_adde" 2 test $? -eq 0 + + cleanup_test +} + +test_adde_end_after_adde_addf() +{ + init_test + + echo "adde lorem" > "$management" + echo "addf ipsum" > "$management" + echo "adde dolor" > "$management" + + # "dolor" must be last. + cat "$preview" | tail -n -1 | grep "dolor" > /dev/null + basic_test "adde_end_after_adde_addf" 2 test $? -eq 0 + + cleanup_test +} + +test_adde_end_after_addf_adde() +{ + init_test + + echo "addf lorem" > "$management" + echo "adde ipsum" > "$management" + echo "adde dolor" > "$management" + + # "dolor" must be last. + cat "$preview" | tail -n -1 | grep "dolor" > /dev/null + basic_test "adde_end_after_addf_adde" 2 test $? -eq 0 + + cleanup_test +} + +test_delf_no_error() +{ + init_test + + echo "addf lorem" > "$management" + echo "delf lorem" > "$management" + basic_test "delf_no_error" 2 test $? -eq 0 + + cleanup_test +} + +test_delf_removes_front() +{ + init_test + + echo "addf lorem" > "$management" + echo "delf lorem" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "delf_removes_front" 2 test "$no" -eq 0 + + cleanup_test +} + +test_delf_removes_end() +{ + init_test + + echo "adde lorem" > "$management" + echo "delf lorem" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "delf_removes_end" 2 test "$no" -eq 0 + + cleanup_test +} + +test_delf_front_number() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf ipsum" > "$management" + echo "addf dolor" > "$management" + echo "delf lorem" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "delf_front_number" 2 test "$no" -eq 2 + + cleanup_test +} + +test_delf_front_content() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf ipsum" > "$management" + echo "addf dolor" > "$management" + echo "delf lorem" > "$management" + cat "$preview" | grep "lorem" > /dev/null + basic_test "delf_front_content" 2 test $? -ne 0 + + cleanup_test +} + +test_delf_first() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf ipsum" > "$management" + echo "addf dolor" > "$management" + echo "delf ipsum" > "$management" + cat "$preview" | grep "ipsum" > /dev/null + basic_test "delf_first" 2 test $? -ne 0 + + cleanup_test +} + +test_delf_none() +{ + init_test + + echo "addf lorem" > "$management" + echo "adde ipsum" > "$management" + echo "delf dolor" > "$management" 2> /dev/null + no=$(cat "$preview" | wc -l) + basic_test "delf_none" 2 test "$no" -eq 2 + + cleanup_test +} + +test_dela_one_number() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf ipsum" > "$management" + echo "addf dolor" > "$management" + echo "dela ipsum" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "dela_one_number" 2 test "$no" -eq 2 + + cleanup_test +} + +test_dela_one_content() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf ipsum" > "$management" + echo "addf dolor" > "$management" + echo "dela ipsum" > "$management" + cat "$preview" | grep "ipsum" > /dev/null + basic_test "dela_one_content" 2 test $? -ne 0 + + cleanup_test +} + +test_dela_two_number() +{ + init_test + + echo "addf lorem" > "$management" + echo "addf ipsum" > "$management" + echo "addf dolor" > "$management" + echo "adde ipsum" > "$management" + echo "dela ipsum" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "dela_one_number" 2 test "$no" -eq 2 + + cleanup_test +} + +test_dela_two_content() +{ + init_test + + echo "adde lorem" > "$management" + echo "addf ipsum" > "$management" + echo "addf dolor" > "$management" + echo "adde ipsum" > "$management" + echo "dela ipsum" > "$management" + cat "$preview" | grep "ipsum" > /dev/null + basic_test "dela_one_content" 2 test $? -ne 0 + + cleanup_test +} + +test_dela_all_five_number() +{ + init_test + + echo "addf lorem" > "$management" + echo "adde lorem" > "$management" + echo "addf lorem" > "$management" + echo "adde lorem" > "$management" + echo "addf lorem" > "$management" + echo "dela lorem" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "dela_all_five_number" 2 test "$no" -eq 0 + + cleanup_test +} + +test_dela_all_five_content() +{ + init_test + + echo "addf lorem" > "$management" + echo "adde lorem" > "$management" + echo "addf lorem" > "$management" + echo "adde lorem" > "$management" + echo "addf lorem" > "$management" + echo "dela lorem" > "$management" + cat "$preview" | grep "lorem" > /dev/null + basic_test "dela_all_five_content" 2 test $? -ne 0 + + cleanup_test +} + +test_dela_none() +{ + init_test + + echo "adde lorem" > "$management" + echo "addf ipsum" > "$management" + echo "dela dolor" > "$management" 2> /dev/null + no=$(cat "$preview" | wc -l) + basic_test "dela_none" 2 test "$no" -eq 2 + + cleanup_test +} + +test_mix_number() +{ + init_test + + echo "addf lorem" > "$management" + echo "adde ipsum" > "$management" + echo "adde dolor" > "$management" + echo "addf sit" > "$management" + echo "adde sit" > "$management" + echo "addf sit" > "$management" + echo "addf lorem" > "$management" + echo "delf lorem" > "$management" + echo "delf dolor" > "$management" + echo "adde dolor" > "$management" + echo "dela sit" > "$management" + echo "delf ipsum" > "$management" + echo "delf ipsum" > "$management" + echo "dela dolor" > "$management" + no=$(cat "$preview" | wc -l) + basic_test "mix_number" 3 test "$no" -eq 1 + + cleanup_test +} + +test_mix_content() +{ + init_test + + echo "addf lorem" > "$management" + echo "adde ipsum" > "$management" + echo "adde dolor" > "$management" + echo "addf sit" > "$management" + echo "adde sit" > "$management" + echo "addf sit" > "$management" + echo "addf lorem" > "$management" + echo "delf lorem" > "$management" + echo "delf dolor" > "$management" + echo "adde dolor" > "$management" + echo "dela sit" > "$management" + echo "delf ipsum" > "$management" + echo "delf ipsum" > "$management" + echo "dela dolor" > "$management" + cat "$preview" | grep "lorem" > /dev/null + basic_test "mix_content" 3 test "$no" -eq 1 + + cleanup_test +} + +run_tests() +{ + test_module_exists + test_proc_folder_exits + test_preview_exits + test_management_exits + test_preview_is_readable + test_preview_is_not_writable + test_management_is_writable + test_management_is_not_readable + test_addf_no_error + test_addf_print + test_addf_print_once + test_adde_no_error + test_adde_print + test_adde_print_once + test_addf_two_number + test_addf_two_content + test_addf_same_twice_number + test_addf_same_twice_content + test_addf_same_twice_content_number + test_adde_two_number + test_adde_two_content + test_adde_same_twice_number + test_adde_same_twice_content + test_adde_same_twice_content_number + test_addf_front_after_addf + test_addf_front_after_adde + test_addf_front_after_adde_addf + test_addf_front_after_addf_adde + test_adde_end_after_addf + test_adde_end_after_adde + test_adde_end_after_adde_addf + test_adde_end_after_addf_adde + test_delf_no_error + test_delf_removes_front + test_delf_removes_end + test_delf_front_number + test_delf_front_content + test_delf_first + test_delf_none + test_dela_one_number + test_dela_one_content + test_dela_two_number + test_dela_two_content + test_dela_all_five_number + test_dela_all_five_content + test_dela_none + test_mix_number + test_mix_content +} + +run_tests | tee results.txt + +cat results.txt | grep '\[.*\]$' | awk -F '[] /[]+' ' +BEGIN { + sum=0 +} + +{ + sum += $(NF-2); +} + +END { + printf "\n%66s [%02d/90]\n", "Total:", sum; +}' + +rm results.txt diff --git a/tools/labs/templates/assignments/0-list/list.c b/tools/labs/templates/assignments/0-list/list.c new file mode 100644 index 00000000000000..39db4cef953ad2 --- /dev/null +++ b/tools/labs/templates/assignments/0-list/list.c @@ -0,0 +1,117 @@ +/* + * list.c - Linux kernel list API + * + * TODO 1/0: Fill in name / email + * Author: FirstName LastName + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#define PROCFS_MAX_SIZE 1024 + +#define procfs_dir_name "list" +#define procfs_file_read "preview" +#define procfs_file_write "management" + +struct proc_dir_entry *proc_list; +struct proc_dir_entry *proc_list_read; +struct proc_dir_entry *proc_list_write; + +/* TODO 2/0: define your list! */ + +static int list_proc_show(struct seq_file *m, void *v) +{ + /* TODO 3/0: print your list. One element / line. */ + seq_puts(m, "Remove this line\n"); + + return 0; +} + +static int list_read_open(struct inode *inode, struct file *file) +{ + return single_open(file, list_proc_show, NULL); +} + +static int list_write_open(struct inode *inode, struct file *file) +{ + return single_open(file, list_proc_show, NULL); +} + +static ssize_t list_write(struct file *file, const char __user *buffer, + size_t count, loff_t *offs) +{ + char local_buffer[PROCFS_MAX_SIZE]; + unsigned long local_buffer_size = 0; + + local_buffer_size = count; + if (local_buffer_size > PROCFS_MAX_SIZE) + local_buffer_size = PROCFS_MAX_SIZE; + + memset(local_buffer, 0, PROCFS_MAX_SIZE); + if (copy_from_user(local_buffer, buffer, local_buffer_size)) + return -EFAULT; + + /* local_buffer contains your command written in /proc/list/management + * TODO 4/0: parse the command and add/delete elements. + */ + + return local_buffer_size; +} + +static const struct file_operations r_fops = { + .owner = THIS_MODULE, + .open = list_read_open, + .read = seq_read, + .release = single_release, +}; + +static const struct file_operations w_fops = { + .owner = THIS_MODULE, + .open = list_write_open, + .write = list_write, + .release = single_release, +}; + +static int list_init(void) +{ + proc_list = proc_mkdir(procfs_dir_name, NULL); + if (!proc_list) + return -ENOMEM; + + proc_list_read = proc_create(procfs_file_read, 0000, proc_list, + &r_fops); + if (!proc_list_read) + goto proc_list_cleanup; + + proc_list_write = proc_create(procfs_file_write, 0000, proc_list, + &w_fops); + if (!proc_list_write) + goto proc_list_read_cleanup; + + return 0; + +proc_list_read_cleanup: + proc_remove(proc_list_read); +proc_list_cleanup: + proc_remove(proc_list); + return -ENOMEM; +} + +static void list_exit(void) +{ + proc_remove(proc_list); +} + +module_init(list_init); +module_exit(list_exit); + +MODULE_DESCRIPTION("Linux kernel list API"); +/* TODO 5/0: Fill in your name / email address */ +MODULE_AUTHOR("FirstName LastName Date: Mon, 26 Mar 2018 11:06:31 +0300 Subject: [PATCH 4/4] Documentation: tools: labs: Move skeleton and checker for 1-tracer in assigments/ subfolder Signed-off-by: Razvan Deaconescu --- .../{tracer_assignment => assignments/1-tracer}/checker/Makefile | 0 .../{tracer_assignment => assignments/1-tracer}/checker/README | 0 .../{tracer_assignment => assignments/1-tracer}/checker/_checker | 0 .../1-tracer}/checker/_helper/Kbuild | 0 .../1-tracer}/checker/_helper/helper.h | 0 .../1-tracer}/checker/_helper/tracer_helper.c | 0 .../1-tracer}/checker/_test/Makefile | 0 .../1-tracer}/checker/_test/debug.h | 0 .../1-tracer}/checker/_test/helper.h | 0 .../1-tracer}/checker/_test/test.h | 0 .../1-tracer}/checker/_test/tracer.h | 0 .../1-tracer}/checker/_test/tracer_test.c | 0 .../1-tracer}/checker/_test/tracer_test.h | 0 .../1-tracer}/checker/_test/util.h | 0 .../kprobe-tracer => assignments/1-tracer}/tracer.h | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/Makefile (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/README (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_checker (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_helper/Kbuild (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_helper/helper.h (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_helper/tracer_helper.c (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_test/Makefile (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_test/debug.h (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_test/helper.h (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_test/test.h (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_test/tracer.h (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_test/tracer_test.c (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_test/tracer_test.h (100%) rename tools/labs/templates/{tracer_assignment => assignments/1-tracer}/checker/_test/util.h (100%) rename tools/labs/templates/{tracer_assignment/kprobe-tracer => assignments/1-tracer}/tracer.h (100%) diff --git a/tools/labs/templates/tracer_assignment/checker/Makefile b/tools/labs/templates/assignments/1-tracer/checker/Makefile similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/Makefile rename to tools/labs/templates/assignments/1-tracer/checker/Makefile diff --git a/tools/labs/templates/tracer_assignment/checker/README b/tools/labs/templates/assignments/1-tracer/checker/README similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/README rename to tools/labs/templates/assignments/1-tracer/checker/README diff --git a/tools/labs/templates/tracer_assignment/checker/_checker b/tools/labs/templates/assignments/1-tracer/checker/_checker similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_checker rename to tools/labs/templates/assignments/1-tracer/checker/_checker diff --git a/tools/labs/templates/tracer_assignment/checker/_helper/Kbuild b/tools/labs/templates/assignments/1-tracer/checker/_helper/Kbuild similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_helper/Kbuild rename to tools/labs/templates/assignments/1-tracer/checker/_helper/Kbuild diff --git a/tools/labs/templates/tracer_assignment/checker/_helper/helper.h b/tools/labs/templates/assignments/1-tracer/checker/_helper/helper.h similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_helper/helper.h rename to tools/labs/templates/assignments/1-tracer/checker/_helper/helper.h diff --git a/tools/labs/templates/tracer_assignment/checker/_helper/tracer_helper.c b/tools/labs/templates/assignments/1-tracer/checker/_helper/tracer_helper.c similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_helper/tracer_helper.c rename to tools/labs/templates/assignments/1-tracer/checker/_helper/tracer_helper.c diff --git a/tools/labs/templates/tracer_assignment/checker/_test/Makefile b/tools/labs/templates/assignments/1-tracer/checker/_test/Makefile similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_test/Makefile rename to tools/labs/templates/assignments/1-tracer/checker/_test/Makefile diff --git a/tools/labs/templates/tracer_assignment/checker/_test/debug.h b/tools/labs/templates/assignments/1-tracer/checker/_test/debug.h similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_test/debug.h rename to tools/labs/templates/assignments/1-tracer/checker/_test/debug.h diff --git a/tools/labs/templates/tracer_assignment/checker/_test/helper.h b/tools/labs/templates/assignments/1-tracer/checker/_test/helper.h similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_test/helper.h rename to tools/labs/templates/assignments/1-tracer/checker/_test/helper.h diff --git a/tools/labs/templates/tracer_assignment/checker/_test/test.h b/tools/labs/templates/assignments/1-tracer/checker/_test/test.h similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_test/test.h rename to tools/labs/templates/assignments/1-tracer/checker/_test/test.h diff --git a/tools/labs/templates/tracer_assignment/checker/_test/tracer.h b/tools/labs/templates/assignments/1-tracer/checker/_test/tracer.h similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_test/tracer.h rename to tools/labs/templates/assignments/1-tracer/checker/_test/tracer.h diff --git a/tools/labs/templates/tracer_assignment/checker/_test/tracer_test.c b/tools/labs/templates/assignments/1-tracer/checker/_test/tracer_test.c similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_test/tracer_test.c rename to tools/labs/templates/assignments/1-tracer/checker/_test/tracer_test.c diff --git a/tools/labs/templates/tracer_assignment/checker/_test/tracer_test.h b/tools/labs/templates/assignments/1-tracer/checker/_test/tracer_test.h similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_test/tracer_test.h rename to tools/labs/templates/assignments/1-tracer/checker/_test/tracer_test.h diff --git a/tools/labs/templates/tracer_assignment/checker/_test/util.h b/tools/labs/templates/assignments/1-tracer/checker/_test/util.h similarity index 100% rename from tools/labs/templates/tracer_assignment/checker/_test/util.h rename to tools/labs/templates/assignments/1-tracer/checker/_test/util.h diff --git a/tools/labs/templates/tracer_assignment/kprobe-tracer/tracer.h b/tools/labs/templates/assignments/1-tracer/tracer.h similarity index 100% rename from tools/labs/templates/tracer_assignment/kprobe-tracer/tracer.h rename to tools/labs/templates/assignments/1-tracer/tracer.h