Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A simple question about guider usage #5

Closed
honggyukim opened this issue Oct 24, 2017 · 12 comments
Closed

A simple question about guider usage #5

honggyukim opened this issue Oct 24, 2017 · 12 comments

Comments

@honggyukim
Copy link
Contributor

Hi @iipeace,

Is it possible to run "guider top" with a fixed number of iteration counts? Thanks.

@honggyukim
Copy link
Contributor Author

Otherwise is there any other way to run it for a specific time duration? for example, I would like to run guider for only 3 seconds using any kind of command.

@honggyukim honggyukim changed the title A simple question of guider top A simple question about guider usage Oct 24, 2017
@iipeace
Copy link
Owner

iipeace commented Oct 24, 2017

Hi, @honggyukim,
You can use -i option and -N option.
$ guider top -N 3
$.guider top -N 1 -i 3

@honggyukim
Copy link
Contributor Author

honggyukim commented Oct 24, 2017

Thanks but I got the below error:

$ guider top -N 1 -i 3

[Error] wrong option value with -N option, input [REPORT_ALWAYS|REPORT_BOUND]@IP:PORT in format

@iipeace
Copy link
Owner

iipeace commented Oct 24, 2017

I am sorry @honggyukim,
I am little bit confused ;(
You can use -R option.
$ guider top -R 3, 1
$ guider top -R 1, 3

@honggyukim
Copy link
Contributor Author

Thanks @iipeace! It works now. I have one more question. : )
Is it possible to see the result without screen clear?

@iipeace
Copy link
Owner

iipeace commented Oct 24, 2017

@honggyukim,
You can use -R option and -o option.
$ guider top -R 1, 3 -o .

and check guider.out file :)

@honggyukim
Copy link
Contributor Author

Thanks! It would also be really nice for me to print the output on console as well in some ways.

@iipeace
Copy link
Owner

iipeace commented Oct 24, 2017

may I ask you the reason why do you wanna get the output without screen clear?

@honggyukim
Copy link
Contributor Author

To give you an idea, I'm writing uftrace.py for python script so want to target guider program while developing and testing it although I'm just prototyping as of now.
Here is just a snippet of the output as of now. : )

 __________________________
/ g.u.i.d.e.r   ver.3.8.8 /
--------------------------
 401.020 us [77222] |           } /* pipePrint */
 694.036 us [77222] |         } /* printTitle */
   1.532  s [77222] |         guider.py(18482):             SystemManager.pipePrint(SystemManager.bufferString)
            [77222] |         pipePrint() {
  18.835 us [77222] |           guider.py(7613):         if SystemManager.pipeForPrint == None and SystemManager.selectMenu == None and \
  44.823 us [77222] |           guider.py(7614):             SystemManager.printFile == None and SystemManager.isTopMode() is False and \
            [77222] |           isTopMode() {
  18.120 us [77222] |             guider.py(8511):         if sys.argv[1] == 'top':
  41.962 us [77222] |             guider.py(8512):             return True
  66.042 us [77222] |           } /* isTopMode */
 155.926 us [77222] |           guider.py(7624):         if SystemManager.pipeForPrint != None:
 180.960 us [77222] |           guider.py(7633):         if SystemManager.printFile != None and SystemManager.fileForPrint == None:
 205.994 us [77222] |           guider.py(7670):         if SystemManager.fileForPrint != None:
 229.836 us [77222] |           guider.py(7680):             print(line)

[Top Info] [Time: 4952345.020] [Interval: 6.5] [Ctxt: 79384] [Fork: 3] [IRQ: 19007] [Core: 40] [Task: 754/876] [RAM: 64310] [Swap: 65439] [Unit: %/MB/NR]
==========================================================================================================================================================
  ID   | CPU (Usr/Ker/Blk/IRQ)| Mem (Free/Anon/File/Slab)| Swap (Used/ InOut )| Reclaim  | BlkRW | NrFlt | NrBlk | NrSIRQ  | NrMlk | NrDrt  |   NetIO    |
----------------------------------------------------------------------------------------------------------------------------------------------------------
Total  |  7 %( 4 / 2 / 0 / 0 )|1893 (150 /-152/ 0  / 2  )| 3812 ( 0  /  0/0  )|   0/0    |  0/0  |   0   |   0   |  11745  |  915  |   14   |   78K/3M   |
==========================================================================================================================================================
    Process      ( ID  / Pid / Nr / Pri)| CPU(Usr/Ker/Dly)|  Mem(RSS/Txt/Shr/Swp)| Blk( RD / WR /NrFlt)| Yld | Prmt | FD | LifeTime|    SignalHandler    |
----------------------------------------------------------------------------------------------------------------------------------------------------------
 qemu-system-x86 (52786/    1/  18/C  0)|  89( 89/  0/  -)| 14087(7024/  0/  2/1366)|   0(   -/   -/    0)|    -|     -|  64|704:28:29|      180004243      |
              vi (71892/71891/   1/C  0)|  87( 18/ 69/  -)| 18567(18498/  0/  5/  0)|   0(   -/   -/    0)|    -|     -|  64|  1:31:36|      1ef804eff      |
            tmux (41733/    1/   1/C  0)|  31( 29/  2/  -)|  171(145/  0/  2/  0)|   0(   -/   -/    0)|    -|     -| 512|1351:28:47|      188034201      |
          guider (77222/73881/   1/C  0)|  12( 11/  1/  -)|   39( 18/  2/  4/  0)|   0(   -/   -/    0)|    -|     -|1024|  0: 0: 7|      180000006      |
  kworker/u386:2 (77163/    2/   1/C  0)|   1(  0/  1/  -)|    0(  0/  0/  0/  -)|   0(   -/   -/    0)|    -|     -|  64|  0: 1:28|                     |
  kworker/u386:1 (76495/    2/   1/C  0)|   1(  0/  1/  -)|    0(  0/  0/  0/  -)|   0(   -/   -/    0)|    -|     -|  64|  0:25:42|                     |
            ksmd (  213/    2/   1/C  5)|   1(  0/  1/  -)|    0(  0/  0/  0/  -)|   0(   -/   -/    0)|    -|     -|  64|1375:39: 4|                     |
            sshd (15233/15142/   1/C  0)|   1(  0/  1/  -)|   95(  4/  0/  3/  0)|   0(   -/   -/    0)|    -|     -|  64| 31:13:22|      180010000      |
----------------------------------------------------------------------------------------------------------------------------------------------------------

 316.858 us [77222] |         } /* pipePrint */
   1.533  s [77222] |         guider.py(18483):             SystemManager.clearPrint()
            [77222] |         clearPrint() {
  17.881 us [77222] |           guider.py(7161):         del SystemManager.bufferString
  44.823 us [77222] |           guider.py(7162):         SystemManager.bufferString = ''
  71.049 us [77222] |           guider.py(7163):         SystemManager.bufferRows = 0
  95.844 us [77222] |         } /* clearPrint */
   1.533  s [77222] |       } /* printSystemStat */
  10.541  s [77222] |       guider.py(10509):                 self.reportSystemStat()

@honggyukim
Copy link
Contributor Author

I just want to see the contiguous guider output with uftrace without cleaning up the screen.

@iipeace
Copy link
Owner

iipeace commented Oct 24, 2017

It looks nice and seems python version of uftrace! 👍
But is it useful if I know all code of guider and use python cpu profiler(i.e., python -m cProfile)?
Anyway, I added a option -Q to print all lines in a stream for you!
I always wait for your contribution :)

@honggyukim
Copy link
Contributor Author

Thanks for your help! I've found that it works fine now. I need to do something else at the moment but I will come again to continue this work later. Thanks!

@iipeace iipeace closed this as completed Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants