Closed Bug 828869 Opened 11 years ago Closed 10 years ago

b2g-ps doesn't work in the emulator

Categories

(Firefox OS Graveyard :: GonkIntegration, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 969090

People

(Reporter: dhylands, Unassigned)

References

Details

Try to run b2g-ps in the emulator.

2222 >adb shell
# b2g-ps
/system/bin/b2g-ps: 29: Syntax error: Bad substitution
Depends on: 830890
Is this still broken?
It seems to be.

I just built an emulator on master and ran it, and b2g-ps now reports:

root@android:/ # b2g-ps                                                        
APPLICATION      USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
/proc/45/comm: No such file or directory
                 root      45    1     153896 68620 ffffffff 415ab0c8 R /system/b2g/b2g
/proc/136/comm: No such file or directory
                 app_136   136   45    62680  23436 ffffffff 400565cc S /system/b2g/plugin-container


So it appears that the emulator kernel doesn't support /proc/PID/comm

b2g-ps can workaround this by detecting that /proc/PID/comm doesn't exist and fallback to parsing /proc/PID/stat
So it looks like the emulator is built using a really ancient 2.6.29 version of the kernel (released Mar 2009)

/proc/PID/comm was introduced in 2.6.33 (released Feb 2010)

All of our devices are using 3.0.8 (3.0 was released in July 2011)

It would be really good if we could get our emulator kernel upgraded.

I added vicamo to the cc list, since he appears to have built the emulator kernel we're using.
AOSP has only goldfish kernel of version 2.6.29 and 3.4, and we had used goldfish-3.4[1] kernel once accidentally, which caused bug 852583 :~

[1]: https://code.google.com/p/android-source-browsing/source/browse?repo=kernel--goldfish&name=android-goldfish-3.4
Depends on: 908659
Is this going to be fixed automagically when we upgrade the kernel version in the emulator?  Is the JB emulator image going to use a new enough kernel?
(In reply to John Ford [:jhford] -- please use 'needinfo?' instead of a CC from comment #6)
> Is this going to be fixed automagically when we upgrade the kernel version
> in the emulator?  Is the JB emulator image going to use a new enough kernel?

Yep.

Or if sombody decides to fix b2g-ps to use /proc/PID/stat instead of /proc/PID/comm (this would be a good first-bug)
Confirmed it's now working on all emulator variants, ics, jb and kk.
Status: NEW → RESOLVED
Closed: 10 years ago
No longer depends on: 908659
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.