Closed Bug 970412 Opened 10 years ago Closed 7 years ago

Add path to fileIOReports

Categories

(Toolkit :: Telemetry, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: rvitillo, Assigned: bugzilla)

Details

Attachments

(2 files, 1 obsolete file)

Currently fileIOReports contains only filenames without their paths. Simple map-reduce jobs have shown that we collect thousands of unique filenames. Many of those files are accessed from add-ons and without the path it's difficult to track down the culprits. Furthermore, the same filename could be used by different add-ons.
As discussed with Roberto on IRC, I think that we can satisfy this while respecting privacy by substituting the real bin/profile path with a placeholder.
Assignee: nobody → aklotz
Status: NEW → ASSIGNED
This patch substitutes the real binary and profile paths with {bin} and {profile}, respectively.
Attachment #8373776 - Flags: review?(nfroyd)
Comment on attachment 8373776 [details] [diff] [review]
Modify Telemetry.fileIOReports to include limited path information

Review of attachment 8373776 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the change below.

::: toolkit/components/telemetry/Telemetry.cpp
@@ +368,5 @@
>  {
>    nsAutoString xreDirPath;
>    nsresult rv = aXreDir->GetPath(xreDirPath);
>    if (NS_SUCCEEDED(rv)) {
> +    AddPath(xreDirPath, NS_LITERAL_STRING("{bin}"));

Nit: can we make this {xre}?

@@ +406,3 @@
>  #else
> +      if (!std::char_traits<char16_t>::compare(filename,
> +                                               mSafeDirs[i].mPath.get(),

Unrelated to this patch: I think this is just:

if (!StringBeginsWith(filenameStr, mSafeDirs[i].mPath)) {
  ...
}

from nsReadableUtils.h.  Followup patch for that would be great.
Attachment #8373776 - Flags: review?(nfroyd) → review+
Also, a test for this would be good, to ensure that we substitute the filename appropriately.
Whiteboard: [leave open]
Updated patch with {bin} -> {xre} modification as requested. Carrying forward r+.

Flagged [leave open] for follow-up patches.
Attachment #8373776 - Attachment is obsolete: true
Attachment #8374391 - Flags: review+
Follow up patch to use StringBeginsWith as requested.
Attachment #8375168 - Flags: review?(nfroyd)
Attachment #8375168 - Flags: review?(nfroyd) → review+
Hey Aaron, is there anything left to do here?
Flags: needinfo?(aklotz)
I cannot remember. I'm happy to resolve. We can always file another bug! ;-)
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Flags: needinfo?(aklotz)
Resolution: --- → FIXED
Whiteboard: [leave open]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: