Bug 6524

Summary: yocto project tools latencytop cannot run in target
Product: [Yocto Project Subprojects] Eclipse Plugin Reporter: Chunrong Guo <b40290>
Component: eclipse-pluginAssignee: Todor Minchev <todor.minchev>
Status: VERIFIED FIXED QA Contact: Valentin Hangan <valentinx.hangan>
Severity: normal    
Priority: Medium CC: alexandru.costinx.roman, ioanax.grigoropol, meta.mr.watcher, meta.watcher, poky.adt.watcher, poky.watcher, richard.purdie, sgw, todor.minchev, valentinx.hangan, yp.ep.watcher, yp.watcher
Version: unspecified   
Target Milestone: 1.9 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Chunrong Guo 2014-07-14 02:44:44 UTC
I run YoctoProjectTools->lantencytop
and there is the following error log:
root@p1020rdb-pd:/# export TERM=xterm;export PATH=$PATH:/usr/local/sbin:/usr/sb
in:/sbin; cd; sudo latencytop
bash: sudo: command not found


I think "latencytop" should replace "sudo latencytop".
Comment 1 Saul Wold 2014-11-11 22:31:17 UTC
Can you confirm what image you installed?  sudo is not part of most images.  
ALso you are already running as root user so no need to use sudo.  Was there a 
specific script or something that you cut and pasted?
Comment 2 Chunrong Guo 2014-12-16 02:27:28 UTC
" initCmd ": set default value in classs LatencytopHandler.

I think "sudo " should be removed . 


public class LatencytopHandler extends DialogHandler {
     
    protected String changeTerm = "export TERM=xterm;";
    private static String initCmd="export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin; cd; sudo latencytop\r";
     
     @Override
     protected String getInitCmd() {
         return initCmd;
     }
     @Override
     protected String changeTerm() {
         return changeTerm;
     }
     @Override
     protected String getConnnectionName() {
         return IBaseConstants.CONNECTION_NAME_LATENCYTOP;                                                                        
     }
     @Override
     protected String getDialogTitle() {
         return IBaseConstants.DIALOG_TITLE_LATENCYTOP;
     }
Comment 3 Stephen K Jolley 2014-12-29 19:13:08 UTC
Information supplied
Comment 4 Stephen K Jolley 2014-12-29 19:13:42 UTC
See above
Comment 5 Saul Wold 2015-01-06 15:04:17 UTC
Where does that script come from?  Can change the line with sudo in it, to 
remove sudo reference?  The script does appear to be part of the Yocto Project.
Comment 6 Saul Wold 2015-01-06 18:35:54 UTC
see prior comment, can you remove the sudo from your script, that script does 
not seem to be part of the latencytop.
Comment 7 Richard Purdie 2015-02-12 22:08:44 UTC
This looks like it is an eclipse plugin issue, reclassifying
Comment 8 Todor Minchev 2015-02-13 08:58:53 UTC
The "sudo" call is done in the plugin, because latencytop requires root access to run. It mounts debugfs and writes to /proc/sys/kernel/latencytop and both of these require UID 0 permissions.
Comment 9 Todor Minchev 2015-06-16 21:56:47 UTC
The sudo call was removed from the latencytop command launch. By default the QEMU images generated by Yocto have only root user and also sudo is not included in all images.
Comment 10 Alexandru Roman 2015-08-28 11:27:26 UTC
Verified on luna-master: 45aa5c77523bdf051d548fff4305382942db2ebb