handle parens in process names in b2g-info #130
Conversation
|
the regex fragment will match the scanf argument |
|
here's a sample program and tests you can confirm with: https://gist.github.com/lloyd/7452319 Seems like we have three options for parsing these lines:
#2 is insufficiently expressive to parse the grammar. #1 is more work than it's worth (but I do love writing parsers), so that leaves us with #3. and given this is a command line tool, I think the efficiency arguments w.r.t parsing are unimportant. |
|
(but w.r.t efficiency, I can get you before/after numbers for scanf regex if you like, convinced the delta won't even register, but am often wrong - at least that's what my wife tells me) |
|
Thanks for the test program. It's obviously using a greedy .* which is why it works. This particular program (b2g-info) was created because getting the same information using sh was taking too long (IIRC its used by the get memory script). So there is a performance consideration, but the differences between the 2 implementation, as you suggest, may be inconsequential. |
|
(still have to actually build and test that patch, will do so in several hours and can squash into a single commit for clarity, please hold on merge) |
|
@dhylands In |
|
All nits addressed except for Ready for final review and merge? |
|
I'll say leave it as NULL then. We're outside of the gecko code, and its a pretty minor difference. I'm just wrapping up for the day, so I'll take a look at this tomorrow morning and merge. Good catch on the memory leak. |
handle parens in process names in b2g-info. r=dhylands
would fix issue #129