Closed
Bug 739800
Opened 14 years ago
Closed 14 years ago
Format profiler address tags with "0x" prefix
Categories
(Core :: Gecko Profiler, defect)
Core
Gecko Profiler
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: vladan, Assigned: vladan)
References
Details
Attachments
(1 file)
|
900 bytes,
patch
|
BenWa
:
review+
vladan
:
checkin+
|
Details | Diff | Splinter Review |
The profiler uses different formats for l-tag addresses on different platforms. I suspect this is probably because of some global localization setting.
This patch forces all addresses to have a "0x" prefix. Surprisingly, specifying stringstream flags was not effective.
| Assignee | ||
Updated•14 years ago
|
OS: Windows 7 → All
Hardware: x86_64 → All
| Assignee | ||
Updated•14 years ago
|
Attachment #609901 -
Flags: review?(bgirard)
Comment 1•14 years ago
|
||
Comment on attachment 609901 [details] [diff] [review]
Force all l-tag addresses to have a "0x" prefix
This change should include a comment explaining the problem we saw on windows.
Attachment #609901 -
Flags: review?(bgirard) → review+
Comment 2•14 years ago
|
||
Comment on attachment 609901 [details] [diff] [review]
Force all l-tag addresses to have a "0x" prefix
Does this work?
stream << entry.mTagName << "-0x" << std::hex << reinterpret_cast<uintptr_t>(entry.mTagData) << "\n";
Comment 3•14 years ago
|
||
We had tried that on windows. It works in a test app but not in firefox.
Comment 4•14 years ago
|
||
Err nevermind that comments, I misread. Perhaps the above would work everywhere.
| Assignee | ||
Comment 5•14 years ago
|
||
(In reply to Markus Stange from comment #2)
> Comment on attachment 609901 [details] [diff] [review]
> Force all l-tag addresses to have a "0x" prefix
>
> Does this work?
>
> stream << entry.mTagName << "-0x" << std::hex <<
> reinterpret_cast<uintptr_t>(entry.mTagData) << "\n";
Yes, this would probably work although I think there might still be a small chance for inconsistency across environments since this format does not specify whether the hex alphabetic characters should be uppercase or lowercase.
Comment 6•14 years ago
|
||
(In reply to Vladan Djeric (:vladan) from comment #5)
> there might still be a small
> chance for inconsistency across environments since this format does not
> specify whether the hex alphabetic characters should be uppercase or
> lowercase.
The C++ spec draft at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3092.pdf says in table 84 on page 685 to use lowercase characters (%x) as long as the "uppercase" flag isn't set (as you'd do with cout << hex << uppercase << 10, for example). Looks safe to me.
| Assignee | ||
Comment 7•14 years ago
|
||
I a(In reply to Markus Stange from comment #6)
> (In reply to Vladan Djeric (:vladan) from comment #5)
> > there might still be a small
> > chance for inconsistency across environments since this format does not
> > specify whether the hex alphabetic characters should be uppercase or
> > lowercase.
>
> The C++ spec draft at
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3092.pdf says in
> table 84 on page 685 to use lowercase characters (%x) as long as the
> "uppercase" flag isn't set (as you'd do with cout << hex << https://vdjeric@github.com/vdjeric/Gecko-Profiler-Addon.git<< 10,
> for example). Looks safe to me.
I agree that makes sense and it's what we first tried but for some reason we are seeing stringstream ignore our format specifiers on Windows Firefox but not in test apps.
It ignored setting "profile.flags(profile.flags() | std::ios::showbase)" as well as "profile << std::hex << std::showbase << ...", which is why i'm a little paranoid about trusting it to honor any string stream formatters.
Also, I just tried your suggestion and it seems to always format the hex addresses with "uppercase" and completely ignores any "nouppercase" format specifier :(
Comment 8•14 years ago
|
||
Okay, strange. Then go ahead :)
| Assignee | ||
Comment 9•14 years ago
|
||
| Assignee | ||
Updated•14 years ago
|
Attachment #609901 -
Flags: checkin+
Comment 10•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•