xcode DYLD_PRINT_STATISTICS 没有显示任何内容

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33776715/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:13:21  来源:igfitidea点击:

DYLD_PRINT_STATISTICS not showing anything

iosxcodedynamic-linkingdyld

提问by deanWombourne

I'm trying to profile app startup after moving from static libraries to frameworks. We have 30 or so frameworks (fyi: cocoapods) so I want to check that it's not affecting performance. Anecdotal testing in the team says that it isn't, but I would like some numbers as well!

从静态库转移到框架后,我试图分析应用程序的启动情况。我们有 30 个左右的框架(仅供参考:cocoapods)所以我想检查它是否不会影响性能。团队中的轶事测试表明它不是,但我也想要一些数字!

I've added the environment variables DYLD_PRINT_STATISTICSand DYLD_PRINT_LIBRARIESto see what the linker is doing, but all the output I get is from the DYLD_PRINT_LIBRARIESvariable. I can see that the frameworks are loading correctly, but get no statistics from them.

我已经添加了环境变量DYLD_PRINT_STATISTICSDYLD_PRINT_LIBRARIES查看链接器在做什么,但我得到的所有输出都来自DYLD_PRINT_LIBRARIES变量。我可以看到框架正在正确加载,但没有从中获取统计信息。

I've tried restarting the device to make sure that the frameworks aren't in memory already but that hasn't helped.

我尝试重新启动设备以确保框架不在内存中,但这并没有帮助。

Any other suggestions as to why I'm not getting any output from DYLD_PRINT_STATISTICS?

关于为什么我没有得到任何输出的任何其他建议DYLD_PRINT_STATISTICS

采纳答案by Rhythmic Fistman

While other flags, like DYLD_PRINT_BINDINGSwork fine on the device, DYLD_PRINT_STATISTICSonly seems to work on the simulator (for me, iOS 9.0).

其他标志,如DYLD_PRINT_BINDINGS在设备DYLD_PRINT_STATISTICS上正常工作,似乎只能在模拟器上工作(对我来说,iOS 9.0)。

In this (possibly unrelated) version of dyld.cpp, from osx 10.10.5there doesn't seem to be any obvious exclusion of DYLD_PRINT_STATISTICSfor devices, although there are conditionally compiled TARGET_IPHONE_SIMULATORs sprinkled throughout the code.

dyld.cpp 的这个(可能不相关)版本中,从 osx 10.10.5 开始,似乎没有任何明显的DYLD_PRINT_STATISTICS设备排除,尽管有条件编译的TARGET_IPHONE_SIMULATORs 散布在整个代码中。

I guess it's a bug.

我想这是一个错误。

回答by Corey Floyd

Looks like you can do it on device if you enable both environment variables in your scheme: DYLD_PRINT_APIS = YES DYLD_PRINT_STATISTICS = YES

如果在您的方案中启用这两个环境变量,您似乎可以在设备上执行此操作: DYLD_PRINT_APIS = YES DYLD_PRINT_STATISTICS = YES

Reference: https://github.com/artsy/eigen/issues/586#issuecomment-118606377

参考:https: //github.com/artsy/eigen/issues/586#issuecomment-118606377