update stack_phv to count event number