You only have 75 posts on this account... seems pretty junior. ;)
Yeah, but I log in as "mikk" on the main wowace/curseforge sites... and then I become "dpsgnome" here.
Funnily/annoyingly, "mikk" is a moderator account so he gets all the reported post spam, but I can't do squat about it since I can't actually be mikk in the forums!
Sigh, move reporting to coroutine - adding functions made it take too much time to execute during combat.
r11
Add "/cputhieves track FUNCNAME" for tracking specific functions. It gets executed as a Lua expression so you can even give it e.g. MyAddon.blah[5].func
We now track all OnEvent/OnUpdate that we have seen a frame use, and include their CPU usage in the stats. This doesn't necessarily mean all the ones that it ever used (we might have missed it between polls!), but it's a lot better than nothing.
r9:
Add in CPU polling of individual functions.
This is a VERY GOOD idea because:
1. C_Timer based timers tend to not show up in AddOn/Frame CPU usage (sometimes yes sometimes no - unsure why so far)
2. API calls that take time do not show up as AddOn time
By default, we monitor:
- C_Timer callouts (and where they were registered the first time)
- All GameTooltip APIs (you'd be surprised how much time they take!)
- All functions in the global namespace on startup (the "!" in "!CPUThieves" means we load before pretty much everything else)
- OnUpdate CPU usage now included in frame CPU usage (manual polling yay). Addon checks if this is necessary or not on start-up. (Future safe)
- If we ever report high CPU on an unnamed frame, it is now assigned a global name e.g. UnnamedFrame01234567 and reported as such. This allows you to prod it yourself with e.g. /dump
- New command "/cputhieves identify VARNAME" that does its best to find out just where the hell that variable came from.
- - It loops through ALL global vars&tables, up to 6 deep, trying to find someone pointing at it
- - For frames, it loops ALL Script handlers and does the same global scan
- - For any table, it loops all members and does issecurevariable() on them, trying to find mention of addons
If anyone else has any creative ideas on how to identify unnamed frames, I'm all ears!
So... unnamed, unparented frames. Very unhelpful to find out what addon it is.
Any useful ideas on how to identify them?
I optimistically tried issecurevariable(theFrame, 0) but it turns out that you can't even do this with nonstring table indices (argh blizzard). (It always returns true,nil - the same it does with nonexistant indices)
IF the frame table has other members, they can certainly be identified, but what if it doesn't have any? (All 3 high-CPU frames I see in my system right now only has the [0])
Then I thought about :GetScript("OnEvent"/"OnUpdate"/etc) .. but that only gets me a function reference which I can't do much with unless someone named the code chunk in question (fat chance).
I will also point out that GetFrameCPUUsage() has MANY MANY quirks. If you see funny situations with frames spamming you with excessive CPU usage reports, but you can clearly see for yourself that nothing is going on ... sorry, I can't fix it.
Well.. what we MIGHT be able to pull off is an option in the default UI (that nearly everyone uses), something along the lines of "Make ALL your characters use this profile!" - which would get unchecked as soon as an individual selection is made.
At least I _think_ it's possible, but Nev knows AceDB better than I do.
You all know the standard profiling addons that show you how much CPU has been used, and how useless they are at helping you find out which addon just froze your WoW for 3 seconds...
It'll monitor for FPS hickups and spit out recent CPU usages like:
CPUThieves: Detected 182ms FPS hickup DURING COMBAT. (174ms = Lua)
CPUThieves: 170 0.2s WowLua
CPUThieves: 170 0.2s F:WowLuaButton_Config
CPUThieves: .. and 3 more frames with same handler function
CPUThieves: 170 0.2s F:WowLuaButton_Previous
CPUThieves: 170 0.2s F:WowLuaButton_Next
CPUThieves: 170 0.2s F:WowLuaButton_Redo
CPUThieves: .. and 5 more frames with same handler function
Yes, it requires profiling enabled, obviously. Which makes it suck in raid on a subpar CPU. I can't help you there, sorry :P
(Naming frames is generally a good practice even if you do not use the names yourself. Helps you understand where $randomframe came from if you can :GetName() it)
0
Yeah, but I log in as "mikk" on the main wowace/curseforge sites... and then I become "dpsgnome" here.
Funnily/annoyingly, "mikk" is a moderator account so he gets all the reported post spam, but I can't do squat about it since I can't actually be mikk in the forums!
Mikk: http://forums.wowace.com/member.php?u=62492 - no activity after 2009 since I can't use it.
0
0
Sigh, move reporting to coroutine - adding functions made it take too much time to execute during combat.
r11
Add "/cputhieves track FUNCNAME" for tracking specific functions. It gets executed as a Lua expression so you can even give it e.g. MyAddon.blah[5].func
0
We now track all OnEvent/OnUpdate that we have seen a frame use, and include their CPU usage in the stats. This doesn't necessarily mean all the ones that it ever used (we might have missed it between polls!), but it's a lot better than nothing.
r9:
Add in CPU polling of individual functions.
This is a VERY GOOD idea because:
1. C_Timer based timers tend to not show up in AddOn/Frame CPU usage (sometimes yes sometimes no - unsure why so far)
2. API calls that take time do not show up as AddOn time
By default, we monitor:
- C_Timer callouts (and where they were registered the first time)
- All GameTooltip APIs (you'd be surprised how much time they take!)
- All functions in the global namespace on startup (the "!" in "!CPUThieves" means we load before pretty much everything else)
0
- OnUpdate CPU usage now included in frame CPU usage (manual polling yay). Addon checks if this is necessary or not on start-up. (Future safe)
- If we ever report high CPU on an unnamed frame, it is now assigned a global name e.g. UnnamedFrame01234567 and reported as such. This allows you to prod it yourself with e.g. /dump
- New command "/cputhieves identify VARNAME" that does its best to find out just where the hell that variable came from.
- - It loops through ALL global vars&tables, up to 6 deep, trying to find someone pointing at it
- - For frames, it loops ALL Script handlers and does the same global scan
- - For any table, it loops all members and does issecurevariable() on them, trying to find mention of addons
If anyone else has any creative ideas on how to identify unnamed frames, I'm all ears!
0
Edit: 240ms if i don't scan the _G inside the _G, oops.
0
Any useful ideas on how to identify them?
I optimistically tried issecurevariable(theFrame, 0) but it turns out that you can't even do this with nonstring table indices (argh blizzard). (It always returns true,nil - the same it does with nonexistant indices)
IF the frame table has other members, they can certainly be identified, but what if it doesn't have any? (All 3 high-CPU frames I see in my system right now only has the [0])
Then I thought about :GetScript("OnEvent"/"OnUpdate"/etc) .. but that only gets me a function reference which I can't do much with unless someone named the code chunk in question (fat chance).
0
0
(Sigh, documentation is never easy)
0
http://wowpedia.org/API_GetFrameCPUUsage explains it
0
0
0
At least I _think_ it's possible, but Nev knows AceDB better than I do.
0
Well, I wrote something that might help with that:
http://www.wowace.com/addons/cputhieves/
It'll monitor for FPS hickups and spit out recent CPU usages like:
Yes, it requires profiling enabled, obviously. Which makes it suck in raid on a subpar CPU. I can't help you there, sorry :P
0