trim profiles name
(cherry-picked from a7d8736)
reviewer: anton makeev