Closed
Bug 1038921
Opened 11 years ago
Closed 11 years ago
Extend system memory reporter to report kgsl memory
Categories
(Core :: XPCOM, defect)
Tracking
()
People
(Reporter: erahm, Assigned: erahm)
Details
(Whiteboard: [MemShrink:P2])
Attachments
(2 files)
|
3.87 KB,
patch
|
n.nethercote
:
review+
|
Details | Diff | Splinter Review |
|
5.61 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
It looks like we can break out kgsl memory usage per-process by looking at the |/d/kgsl/proc/<pid>/mem| file on b2g devices. The total should roughly equal the |gralloc| entry for the system process, but it would be nice to have a cleaner breakdown.
Proposed format is something like this:
152.72 MB (100.0%) -- kgsl
├───88.94 MB (58.24%) -- pid=123
│ ├──86.49 MB (56.63%) ── texture
│ └───2.45 MB (01.61%) ── arraybuffer
| Assignee | ||
Comment 1•11 years ago
|
||
This patch adds kgsl memory reporting to the SystemMemoryReporter.
Attachment #8459860 -
Flags: review?(n.nethercote)
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → erahm
Status: NEW → ASSIGNED
Comment 2•11 years ago
|
||
Comment on attachment 8459860 [details] [diff] [review]
Extend system memory reporter to report kgsl memory
Review of attachment 8459860 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks!
::: xpcom/base/SystemMemoryReporter.cpp
@@ +869,5 @@
> + struct DirGuard
> + {
> + DirGuard(DIR* aDir) : dir(aDir) {}
> + ~DirGuard() { closedir(dir); };
> + DIR* dir;
mDir
@@ +870,5 @@
> + {
> + DirGuard(DIR* aDir) : dir(aDir) {}
> + ~DirGuard() { closedir(dir); };
> + DIR* dir;
> + };
RAII is great! But we usually call classes like this Auto<whatever>. Though MFBT uses Scoped<whatever>, for some reason. Anyway, use one of those.
@@ +876,5 @@
> + struct FileGuard
> + {
> + FileGuard(FILE* aFile) : file(aFile) {}
> + ~FileGuard() { fclose(file); }
> + FILE* file;
mFile
@@ +890,5 @@
> + // gpuaddr useraddr size id flags type usage sglen
> + // hexaddr hexaddr int int str str str int
> + // We care primarily about the usage and size.
> +
> + // For simplicity numbers will be uint64_t, strings 15 chars max.
Do you know that 15 is enough? It's not clear from the comment. If not, maybe make it a bit higher, e.g. 63?
@@ +951,5 @@
> + flags, type, usage, &sglen) == kNumFields) {
> + nsPrintfCString entryPath("kgsl-memory/%s/%s", procName.get(), usage);
> + REPORT(entryPath,
> + size,
> + NS_LITERAL_CSTRING("A kgsl graphics memory allocation"));
Nit: Period at end of the sentence.
Attachment #8459860 -
Flags: review?(n.nethercote) → review+
| Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #2)
> Comment on attachment 8459860 [details] [diff] [review]
> RAII is great! But we usually call classes like this Auto<whatever>. Though
> MFBT uses Scoped<whatever>, for some reason. Anyway, use one of those.
I'll do AutoDir/AutoFile (I'm assuming that's what you meant, not AutoDirGuard). MFBT literally has a Scoped<T> class which I _could_ use, but it seems like overkill.
> Do you know that 15 is enough? It's not clear from the comment. If not,
> maybe make it a bit higher, e.g. 63?
The longest I've found is 15, but it's probably better to err on the side of caution.
Comment 4•11 years ago
|
||
> I'll do AutoDir/AutoFile (I'm assuming that's what you meant, not AutoDirGuard).
Yes!
| Assignee | ||
Comment 5•11 years ago
|
||
| Assignee | ||
Comment 6•11 years ago
|
||
Updated•11 years ago
|
Whiteboard: [MemShrink] → [MemShrink:P2]
Comment 7•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
| Assignee | ||
Comment 8•11 years ago
|
||
[Blocking Requested - why for this release]: Nom'ing for 2.0+, this should be useful for identifying and working on graphics memory regressions.
blocking-b2g: --- → 2.0?
blocking-b2g: 2.0? → 2.0+
Comment 9•11 years ago
|
||
status-b2g-v2.0:
--- → fixed
status-b2g-v2.1:
--- → fixed
status-firefox32:
--- → wontfix
status-firefox33:
--- → wontfix
status-firefox34:
--- → fixed
Comment 10•11 years ago
|
||
| Assignee | ||
Comment 11•11 years ago
|
||
Patch for the b2g 2.0 branch, adds missing function not on 2.0.
Attachment #8462809 -
Flags: review+
Flags: needinfo?(erahm)
| Assignee | ||
Updated•11 years ago
|
Keywords: branch-patch-needed
Comment 12•11 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•