In reply to robert.liu:
The proper context should be pkg. The DPI is supposed to behave as if you never left SystemVerilog. If you had
package pkg;
//import "DPI-C" context function void show_context();
function void show_context();
print();
endfunction
function void print;
$display("%m");
endfunction
endpackage
module test;
import pkg::*;
initial show_context();
function void print;
$display("%m");
endfunction
endmodule
You would expect pkg::print to be called.