printf extern share

anyway to print pointer data in kernel declared as
extern shared int test; like to print result of test at each step

You want to print the pointer value itself? Or the data that it points to?

For the pointer value itself, try:

printf("%p\n", test);