acrntrace: break when finding the matching key

The key in the list is unique. So, it is better to break the loop
when find the matching key instead of traversing the whole list.

Tracked-On: #4175
Acked-by: Yan, Like <like.yan@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
This commit is contained in:
Kaige Fu 2019-11-29 00:39:19 +08:00 committed by wenlingz
parent 9655b9de15
commit 1e192f05d7

View File

@ -137,6 +137,7 @@ def parse_trace_data(ifile):
if event == LIST_EVENTS.get(key):
NR_EXITS[key] += 1
last_ev_id = key
break
else:
# Skip the non-VMEXIT trace event