Closed Bug 972536 Opened 12 years ago Closed 12 years ago

add handy tool for gathering USS memory data for a process over time

Categories

(Firefox OS Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
1.4 S2 (28feb)

People

(Reporter: huseby, Assigned: huseby)

Details

(Keywords: perf, Whiteboard: [c=memory p=1 s= u=])

Attachments

(1 file, 1 obsolete file)

while working on another bug, I wrote a handy shell script that takes an app title and an output file name and it will use adb shell b2g-procrank to get the USS memory usage for the app repeatedly and store the value in a CSV file for analysis/graphic in any spreadsheet app. It's really handy for checking for memory leaks.
Attached patch Bug_972536.patch (obsolete) — Splinter Review
Attachment #8375759 - Flags: review?(dbaron)
Flags: needinfo?(dbaron)
Comment on attachment 8375759 [details] [diff] [review] Bug_972536.patch ># HG changeset patch ># User > > > Needs a username, bug number, and commit message. (And I generally want to review commit messages as part of code review, but I'll give you a pass this time.) >diff --git a/tools/memory/collect_uss_data.sh b/tools/memory/collect_uss_data.sh Maybe collect_b2g_uss_data.sh to give a little more context? And maybe a code comment saying what USS is? >+if [ $# -ne 2 ] >+then >+ echo "Usage: `basename $0` <app title> <output_file.csv>" >+ exit 0 Want a nonzero exit status (1, by default) for errors. >+fi >+ >+while true; No need for the semicolon where you have the newline. (I prefer the newline over the semicolon, though I'm aware both styles exist.) >+do >+ sample=`adb shell b2g-procrank | grep ^${1} | awk '{ print $6 }' | sed 's/.$//'` Should the argument to grep be in "" ? >+ echo $sample >+ echo $sample >> $2 Same for the $2, also in "" ? (I even might put "" about both occurrences of $sample, though it's probably not needed.) r=dbaron with that
Attachment #8375759 - Flags: review?(dbaron) → review+
Status: NEW → ASSIGNED
Whiteboard: [c= p= s= u=] → [c= p=1 s= u=]
Priority: -- → P2
Whiteboard: [c= p=1 s= u=] → [c=memory p=1 s= u=]
Target Milestone: --- → 1.4 S1 (14feb)
Attached patch Bug_972536.patchSplinter Review
I figured out the correct way to do git to hg patching :) I updated the patch per your feedback.
Attachment #8375759 - Attachment is obsolete: true
Attachment #8378620 - Flags: review?(dbaron)
Comment on attachment 8378620 [details] [diff] [review] Bug_972536.patch I already granted review, so you shouldn't ask again. (But if you did something new that wasn't covered previously, you should say what when asking... though really you should make the new thing a separate patch.)
Attachment #8378620 - Flags: review?(dbaron)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
oops
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Target Milestone: 1.4 S1 (14feb) → 1.4 S2 (28feb)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: