Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Issue 302163004: telemetry: Robustify CrOSInterface._GetSessionManagerPid(). (Closed)

Created:
6 years, 6 months ago by Daniel Erat
Modified:
6 years, 6 months ago
Reviewers:
Chris Masone, achuithb
CC:
chromium-reviews, telemetry+watch_chromium.org
Visibility:
Public.

Description

telemetry: Robustify CrOSInterface._GetSessionManagerPid(). Allow the session_manager process name to use a relative path or to not have any arguments, rather than requiring it to have the prefix "/sbin/session_manager " (note trailing space). BUG=377301 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=274225

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M tools/telemetry/telemetry/core/backends/chrome/cros_interface.py View 1 chunk +2 lines, -1 line 3 comments Download

Messages

Total messages: 13 (0 generated)
Daniel Erat
6 years, 6 months ago (2014-06-02 00:03:40 UTC) #1
Chris Masone
lgtm lgtm
6 years, 6 months ago (2014-06-02 00:31:59 UTC) #2
Daniel Erat
The CQ bit was checked by derat@chromium.org
6 years, 6 months ago (2014-06-02 05:07:44 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/derat@chromium.org/302163004/1
6 years, 6 months ago (2014-06-02 05:08:04 UTC) #4
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: chromium_presubmit on tryserver.chromium ...
6 years, 6 months ago (2014-06-02 07:05:52 UTC) #5
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-02 07:08:31 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/chromium_presubmit/builds/70966)
6 years, 6 months ago (2014-06-02 07:08:32 UTC) #7
achuithb
lgtm https://codereview.chromium.org/302163004/diff/1/tools/telemetry/telemetry/core/backends/chrome/cros_interface.py File tools/telemetry/telemetry/core/backends/chrome/cros_interface.py (right): https://codereview.chromium.org/302163004/diff/1/tools/telemetry/telemetry/core/backends/chrome/cros_interface.py#newcode301 tools/telemetry/telemetry/core/backends/chrome/cros_interface.py:301: if argv and os.path.basename(argv[0]) == 'session_manager': argv should ...
6 years, 6 months ago (2014-06-02 08:51:20 UTC) #8
Daniel Erat
The CQ bit was checked by derat@chromium.org
6 years, 6 months ago (2014-06-02 13:35:09 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/derat@chromium.org/302163004/1
6 years, 6 months ago (2014-06-02 13:35:23 UTC) #10
Daniel Erat
https://codereview.chromium.org/302163004/diff/1/tools/telemetry/telemetry/core/backends/chrome/cros_interface.py File tools/telemetry/telemetry/core/backends/chrome/cros_interface.py (right): https://codereview.chromium.org/302163004/diff/1/tools/telemetry/telemetry/core/backends/chrome/cros_interface.py#newcode301 tools/telemetry/telemetry/core/backends/chrome/cros_interface.py:301: if argv and os.path.basename(argv[0]) == 'session_manager': On 2014/06/02 08:51:20, ...
6 years, 6 months ago (2014-06-02 13:38:23 UTC) #11
commit-bot: I haz the power
Change committed as 274225
6 years, 6 months ago (2014-06-02 13:41:57 UTC) #12
Daniel Erat
6 years, 6 months ago (2014-06-02 13:48:17 UTC) #13
Message was sent while issue was closed.
https://codereview.chromium.org/302163004/diff/1/tools/telemetry/telemetry/co...
File tools/telemetry/telemetry/core/backends/chrome/cros_interface.py (right):

https://codereview.chromium.org/302163004/diff/1/tools/telemetry/telemetry/co...
tools/telemetry/telemetry/core/backends/chrome/cros_interface.py:301: if argv
and os.path.basename(argv[0]) == 'session_manager':
On 2014/06/02 13:38:24, Daniel Erat wrote:
> On 2014/06/02 08:51:20, achuithb wrote:
> > argv should never be empty, right?
> 
> "".split() returns an empty array. i think that a process can rewrite its argv
> to be whatever it wants, so better safe than sorry, i figure.

(although i'm probably being overly paranoid, since ListProcesses() looks like
it'll fail an assert in this case. it'd probably be safer for this code to read
from /proc instead of running ps; that way it'd also be able to find the real
executable by reading the 'exe' symlink.)

Powered by Google App Engine
This is Rietveld 408576698