c - how to reuse the variable in linux kernel? -
extern unsigned long current_rx_time; export_symbol(current_rx_time); int netif_rx(struct sk_buff *skb) { current_rx_time = jiffies; } i modified kernel source code in dev.c shown above. later creating loadable kernel module in procfs , using currentrx_time send user space shown below : static int my_proc_show(struct seq_file *m, void *v) { //i printing value below seq_printf(m, "%lu\n", current_rx_time *1000/hz); return 0; } but getting error when compile module above current_rx_time undeclared. tell me how solve problem? first need declare variable , can export it. so declare in dev.c unsigned long current_rx_time; then export in dev.c export_symbol(current_rx_time); and in other loadable module want use (let's in temp2.c)... extern unsigned long current_rx_time; now make sure when going compile temp2.c @ time dev.c getting compile.