カーネルモジュールの中でkthreadを生成し、定期処理を行なうサンプル実装
実行確認
$ sudo insmod skel_drv.ko $ sudo rmmod skel_drv $ dmesg : [514702.117329] skel_init [514702.117332] SKEL_DRV: char driver major number is 243 [514702.117482] kthread_main pid:127959 [514702.117546] my_kthread:I 1548054143358956 HZ-250 [514703.117142] my_kthread_main:1548054144358638 [514704.117105] my_kthread_main:1548054145358691 [514705.117307] my_kthread_main:1548054146358977 [514706.117366] my_kthread_main:1548054147359125 [514706.425008] skel_exit [514706.425015] my_kthread_main:1548054147666807 [514706.425016] my_kthread:O