/** * detector_init - Standard module initialization code */ static int detector_init(void) { int ret = -ENOMEM; printk(KERN_INFO BANNER "version %s\n", VERSION); ret = init_stats(); if (0 != ret) goto out; ret = init_debugfs(); if (0 != ret) goto err_stats; if (enabled) ret = start_kthread(); goto out; err_stats: ring_buffer_free(ring_buffer); out: return ret; }
/* initialize/clean up */ static int __init mod_sysstat_recoder_init(void){ print_msg("initialize module"); print_msg("period_in_msecs: %ld", period_in_msecs); /* initialize a list of measured data */ snapshot_head = NULL; snapshot_tail = NULL; init_debugfs(); mod_sysstat_collect_start(); return 0; }