Track Handle Creation Time For Dump Outputs#1110
Conversation
|
Example of sm_dump_handles output |
|
LGTM. It might be a good idea to log the latest (and possibly oldest) time in |
public void OnPluginStart()
{
ArrayList pacc = new ArrayList();
RegConsoleCmd("sm_test", Command_Test);
}
public Action Command_Test(int client, int args)
{
for (int i = 0; i < 32; i++)
{
DataPack pack = new DataPack();
}
}Using the above plugin and manually calling HandleSystem::TryAndFreeSomeHandles() yields us with the following output |
KyleSanderson
left a comment
There was a problem hiding this comment.
I like the idea of it - hopefully trivial fixes to make this a winner.
core/logic/HandleSys.cpp
Outdated
| } | ||
|
|
||
| #if defined SUBPLATFORM_SECURECRT | ||
| _invalid_parameter_handler handler = _set_invalid_parameter_handler(_ignore_invalid_parameter); |
There was a problem hiding this comment.
This is begging for some RAII but otherwise patch looks fine to me.
There was a problem hiding this comment.
@Headline ack what dvander said. can you make this a class that does nothing on platforms outside of windows? Happy to take afterwards.
|
Hope this will be added sooner than not, a very helpful thing. |
core/logic/HandleSys.cpp
Outdated
| } | ||
|
|
||
| #if defined SUBPLATFORM_SECURECRT | ||
| _invalid_parameter_handler handler = _set_invalid_parameter_handler(_ignore_invalid_parameter); |
There was a problem hiding this comment.
@Headline ack what dvander said. can you make this a class that does nothing on platforms outside of windows? Happy to take afterwards.
d9b6ee1 to
558f922
Compare
handlesys: Output allocation timestamp during panic (alliedmodders#1110)
Closes #1063
We save a timestamp for every Handle creation that way users are able to get more information on when certain handles are being created when using sm_dump_handles.