int __init net_profile_init(void) { int i; #ifdef CONFIG_PROC_FS create_proc_read_entry("net/profile", 0, 0, profile_read_proc, NULL); #endif register_netdevice(&whitehole_dev); printk("Evaluating net profiler cost ..."); #ifdef __alpha__ alpha_tick(0); #endif for (i=0; i<1024; i++) { NET_PROFILE_ENTER(total); NET_PROFILE_LEAVE(total); } if (net_prof_total.accumulator.tv_sec) { printk(" too high!\n"); } else { net_profile_adjust.tv_usec = net_prof_total.accumulator.tv_usec>>10; printk("%ld units\n", net_profile_adjust.tv_usec); } net_prof_total.hits = 0; net_profile_stamp(&net_prof_total.entered); return 0; }
__initfunc(int net_profile_init(void)) { int i; #ifdef CONFIG_PROC_FS struct proc_dir_entry *ent; ent = create_proc_entry("net/profile", 0, 0); ent->read_proc = profile_read_proc; #endif register_netdevice(&whitehole_dev); printk("Evaluating net profiler cost ..."); #if CPU == 586 || CPU == 686 if (!(boot_cpu_data.x86_capability & X86_FEATURE_TSC)) { printk(KERN_ERR "Sorry, your CPU does not support TSC. Net profiler disabled.\n"); return -1; } #endif start_bh_atomic(); #ifdef __alpha__ alpha_tick(0); #endif for (i=0; i<1024; i++) { NET_PROFILE_ENTER(total); NET_PROFILE_LEAVE(total); } if (net_prof_total.accumulator.tv_sec) { printk(" too high!\n"); } else { net_profile_adjust.tv_usec = net_prof_total.accumulator.tv_usec>>10; printk("%ld units\n", net_profile_adjust.tv_usec); } net_prof_total.hits = 0; net_profile_stamp(&net_prof_total.entered); end_bh_atomic(); return 0; }