Assume that the profiles hashmap of ports is always non-NULL.