This is an archive of the discontinued LLVM Phabricator instance.

Search for kext variants is searching from parent directory when it should not be
ClosedPublic

Authored by jasonmolenda on Jun 18 2018, 4:04 PM.

Details

Summary

There's a small perf issue after the changes to r334205; the patch is intended to search all the executables in a kext bundle to discover variants, e.g.

/System/Library/Extensions/AppleUSB.kext

everything under the AppleUSB.kext subdir should be searched. But the patch used the FileSpec's GetDirectory method, so we ended up recursively searching all the kexts in the parent directory.

Functionally, these are equivalent - recursively searching from the parent dir will yield the same result because we require a binary's UUID match before we use it. But it has a high performance cost if we search from the wrong base directory.

rdar://problem/41227170

Diff Detail

Repository
rL LLVM

Event Timeline

jasonmolenda created this revision.Jun 18 2018, 4:04 PM
JDevlieghere accepted this revision.Jun 19 2018, 3:03 AM

Thanks Jason, good catch!

This revision is now accepted and ready to land.Jun 19 2018, 3:03 AM
This revision was automatically updated to reflect the committed changes.