simplify table_histogram based on kp_tab_sort function

Signed-off-by: Jovi Zhangwei <jovi.zhangwei@gmail.com>