-
Notifications
You must be signed in to change notification settings - Fork 40
Emit memory reports to debug link time memory usage #620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -43,6 +43,9 @@ class ZOption; | |||||
| * - attribute of input files | ||||||
| */ | ||||||
| class GeneralOptions { | ||||||
| public: | ||||||
| static std::string getTypeName() { return "GeneralOptions"; } | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we please return |
||||||
|
|
||||||
| public: | ||||||
| typedef llvm::StringMap<std::string> SymbolRenameMap; | ||||||
|
|
||||||
|
|
@@ -834,6 +837,16 @@ class GeneralOptions { | |||||
| void setTimingStatsFile(std::string StatsFile) { | ||||||
| TimingStatsFile = StatsFile; | ||||||
| } | ||||||
| //--------------------Memory Report-------------------------------- | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this feature useful to anyone other than an eld developer?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only eld developer.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can make this option hidden if that is what you were hinting at. |
||||||
| // --print-memory-report | ||||||
| bool showMemoryReport() const { return PrintMemoryReport; } | ||||||
|
|
||||||
| void setPrintMemoryReport() { PrintMemoryReport = true; } | ||||||
|
|
||||||
| // --emit-memory-report <file> | ||||||
| std::string getMemoryReportFile() const { return MemoryReportFile; } | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| void setMemoryReportFile(std::string F) { MemoryReportFile = F; } | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should try to use
Suggested change
|
||||||
| //--------------------Plugin Config-------------------------------- | ||||||
| void addPluginConfig(const std::string &Config) { | ||||||
| PluginConfig.push_back(Config); | ||||||
|
|
@@ -1233,6 +1246,7 @@ class GeneralOptions { | |||||
| bool BExecuteOnly = false; // --execute-only | ||||||
| bool BPrintTimeStats = false; // --print-stats | ||||||
| bool BPrintAllUserPluginTimeStats = false; | ||||||
| bool PrintMemoryReport = false; // --print-memory-report | ||||||
| bool BDemangle = true; // --demangle-style | ||||||
| bool ValidateArchOpts = false; // check -mabi with backend | ||||||
| bool DisableGuardForWeakUndefs = false; // hexagon specific option to | ||||||
|
|
@@ -1265,7 +1279,8 @@ class GeneralOptions { | |||||
| std::string Filter; | ||||||
| std::string MapFile; // Mapfile | ||||||
| std::string TarFile; // --reproduce output tarfile name | ||||||
| std::string TimingStatsFile; | ||||||
| std::string TimingStatsFile; // --emit-timing-stats | ||||||
| std::string MemoryReportFile; // --emit-memory-report | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use one option |
||||||
| std::string MappingFileName; // --Mapping-file | ||||||
| std::string MappingDumpFile; // --dump-mapping-file | ||||||
| std::string ResponseDumpFile; // --dump-response-file | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we use macros to get these? Adding this to every single type feels needlessly complex and hard to scale.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I think that is much better. Let me explore