add debug log for recording input buffer's r/w pos