Add some tracing functions to fix that the samples/tracing code cannot generate coverage by twister. Fixed #38323 Signed-off-by: Lixin Guo <lixinx.guo@intel.com>