Closed Bug 831133 Opened 7 years ago Closed 7 years ago

Record only the basename

Categories

(Toolkit :: Telemetry, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: espindola, Assigned: espindola)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
https://tbpl.mozilla.org/?tree=Try&rev=78ab105e4c80

For the symbolication server we only want the basename, since this is what is used to store the .sym files. Unfortunately we have to do this is Telemetry for now an the current profiler plugin needs the full file name on OS X.
Attachment #702638 - Flags: review?(vdjeric)
Comment on attachment 702638 [details] [diff] [review]
patch

> #ifdef MOZ_ENABLE_PROFILER_SPS
>   for (unsigned i = 0, n = rawModules.GetSize(); i != n; ++i) {
>     const SharedLibrary &info = rawModules.GetEntry(i);
>+    const std::string &name = info.GetName();
>+    size_t pos = name.rfind('/');

This works but how about #ifdef'ing XP_MACOSX around some of this logic and calling basename()?

>+    std::string basename;
>+    if (pos != std::string::npos)
>+      basename = name.substr(pos + 1);
>+    else
>+      basename = name;

Style rules say you need curlies for these
Attachment #702638 - Flags: review?(vdjeric) → review+
https://hg.mozilla.org/mozilla-central/rev/8d0071573033
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.