[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 04/17] xenctx: Add command line options -b (--bytes-per-line) and -l (--lines)



Grrr.  Line wrapping strikes again.
    -Don Slutz

On 03/22/14 16:08, Don Slutz wrote:

On 03/21/14 10:32, Ian Campbell wrote:
On Thu, 2014-03-20 at 15:06 -0400, Don Slutz wrote:
   -b <bytes>, --bytes-per-line <bytes>
change the number of bytes per line output for Stack. (default 32) Note: rounded to native size (4 or 8 bytes).
I can just about see a use for this.

This is much more useful when used with --decode-as-ascii or when you have a wide "terminal".

   -l <lines>, --lines <lines>
change the number of lines output for Stack. (default 5) Can be specified as MAX. Note: Fewer lines will be output
                      if Stack limit reached.
What is this useful for which "less", "head" or "tail" can't achieve?

By default only part of the stack is dumped:



tools/xentrace/xenctx -s ~/zzm 4 -n 2
rip: ffffffff81346876 io_serial_in+0x16
flags: 00000002 nz
rsp: ffff8800385a5ab8
rax: 000000000000006f   rcx: 0000000000000000   rdx: 00000000000003fd
rbx: ffffffff81ff8f00   rsi: 0000000000000005   rdi: ffffffff81ff8f00
rbp: ffff8800385a5ab8    r8: ffffffff81c03a10    r9: 0000000000000080
r10: 0000000000000005   r11: 0000000000000046   r12: 000000000000270f
r13: 0000000000000020   r14: 0000000000000025   r15: ffffffff81346f20
 cs: 0010        ss: 0018        ds: 0000        es: 0000
 fs: 0000 @ 00007f07972f3700
 gs: 0000 @ ffff88000b400000/0000000000000000/
Code (instr addr ffffffff81346876)
48 89 e5 0f 1f 44 00 00 0f b6 4f 41 0f b7 57 08 d3 e6 01 f2 ec <0f> b6 c0 c9 c3 0f 1f 44 00 00 55


Stack:
 ffff8800385a5ae8 ffffffff81346e64 ffffffff81ff8f00 0000000000000072
 0000000000000064 0000000000000025 ffff8800385a5b08 ffffffff81346f46
 ffffffff81e3e430 ffffffff81ff8f00 ffff8800385a5b48 ffffffff813428de
 ffffffff8100bc0e 0000000000000000 ffffffff81ff8f00 0000000000000001
 0000000000000064 ffffffff81e3e40c ffff8800385a5b98 ffffffff813472ad

Call Trace:
  [<ffffffff81346876>] io_serial_in+0x16 <--
  [<ffffffff81346e64>] wait_for_xmitr+0x24
  [<ffffffff81346f46>] serial8250_console_putchar+0x26
  [<ffffffff813428de>] uart_console_write+0x3e
  [<ffffffff8100bc0e>] apic_timer_interrupt+0xe
  [<ffffffff813472ad>] serial8250_console_write+0xbd
  [<ffffffff8106b8f5>] __call_console_drivers+0x75
  [<ffffffff8106b95a>] _call_console_drivers+0x4a
  [<ffffffff8106be6e>] release_console_sem+0x4e
  [<ffffffff8106c628>] vprintk+0x248
  [<ffffffff814fd363>] printk+0x41


Here is the same data with a bigger -l (domU is paused):

tools/xentrace/xenctx -s ~/zzm 4 -n 2 -l 10
rip: ffffffff81346876 io_serial_in+0x16
flags: 00000002 nz
rsp: ffff8800385a5ab8
rax: 000000000000006f   rcx: 0000000000000000   rdx: 00000000000003fd
rbx: ffffffff81ff8f00   rsi: 0000000000000005   rdi: ffffffff81ff8f00
rbp: ffff8800385a5ab8    r8: ffffffff81c03a10    r9: 0000000000000080
r10: 0000000000000005   r11: 0000000000000046   r12: 000000000000270f
r13: 0000000000000020   r14: 0000000000000025   r15: ffffffff81346f20
 cs: 0010        ss: 0018        ds: 0000        es: 0000
 fs: 0000 @ 00007f07972f3700
 gs: 0000 @ ffff88000b400000/0000000000000000/
Code (instr addr ffffffff81346876)
48 89 e5 0f 1f 44 00 00 0f b6 4f 41 0f b7 57 08 d3 e6 01 f2 ec <0f> b6 c0 c9 c3 0f 1f 44 00 00 55


Stack:
 ffff8800385a5ae8 ffffffff81346e64 ffffffff81ff8f00 0000000000000072
 0000000000000064 0000000000000025 ffff8800385a5b08 ffffffff81346f46
 ffffffff81e3e430 ffffffff81ff8f00 ffff8800385a5b48 ffffffff813428de
 ffffffff8100bc0e 0000000000000000 ffffffff81ff8f00 0000000000000001
 0000000000000064 ffffffff81e3e40c ffff8800385a5b98 ffffffff813472ad
 00000000385a5cd8 0000000000000006 ffff8800385a5c08 ffffffff81affa00
 ffffffff81c03800 000000000001696c 0000000000000064 0000000000000046
 ffff8800385a5bc8 ffffffff8106b8f5 00000000000169d0 ffffffff81e2797c
 00000000000169d0 00000000000169d0 ffff8800385a5be8 ffffffff8106b95a
 206465697272616d 00000000fffff167 ffff8800385a5c28 ffffffff8106be6e

Call Trace:
  [<ffffffff81346876>] io_serial_in+0x16 <--
  [<ffffffff81346e64>] wait_for_xmitr+0x24
  [<ffffffff81346f46>] serial8250_console_putchar+0x26
  [<ffffffff813428de>] uart_console_write+0x3e
  [<ffffffff8100bc0e>] apic_timer_interrupt+0xe
  [<ffffffff813472ad>] serial8250_console_write+0xbd
  [<ffffffff8106b8f5>] __call_console_drivers+0x75
  [<ffffffff8106b95a>] _call_console_drivers+0x4a
  [<ffffffff8106be6e>] release_console_sem+0x4e
  [<ffffffff8106c628>] vprintk+0x248
  [<ffffffff814fd363>] printk+0x41


"less", "head" or "tail" are unable to change xenctx, only control what you see of xenctx's output.




In both cases though it seems to make the code more complicated for what
seems to be a not all that useful increase in functionality.

It is true that using the existing -S:

tools/xentrace/xenctx -s ~/zzm 4 -S
rip: ffffffff81346876 io_serial_in+0x16
flags: 00000002 nz
rsp: ffff8800385a5ab8
rax: 000000000000006f   rcx: 0000000000000000   rdx: 00000000000003fd
rbx: ffffffff81ff8f00   rsi: 0000000000000005   rdi: ffffffff81ff8f00
rbp: ffff8800385a5ab8    r8: ffffffff81c03a10    r9: 0000000000000080
r10: 0000000000000005   r11: 0000000000000046   r12: 000000000000270f
r13: 0000000000000020   r14: 0000000000000025   r15: ffffffff81346f20
 cs: 0010        ss: 0018        ds: 0000        es: 0000
 fs: 0000 @ 00007f07972f3700
 gs: 0000 @ ffff88000b400000/0000000000000000/
Code (instr addr ffffffff81346876)
48 89 e5 0f 1f 44 00 00 0f b6 4f 41 0f b7 57 08 d3 e6 01 f2 ec <0f> b6 c0 c9 c3 0f 1f 44 00 00 55


Stack:
 ffff8800385a5ae8 ffffffff81346e64 ffffffff81ff8f00 0000000000000072
 0000000000000064 0000000000000025 ffff8800385a5b08 ffffffff81346f46
 ffffffff81e3e430 ffffffff81ff8f00 ffff8800385a5b48 ffffffff813428de
 ffffffff8100bc0e 0000000000000000 ffffffff81ff8f00 0000000000000001
 0000000000000064 ffffffff81e3e40c ffff8800385a5b98 ffffffff813472ad

Stack Trace:
* [<ffffffff81346876>] io_serial_in+0x16 <--
    ffff8800385a5ae8
  [<ffffffff81346e64>] wait_for_xmitr+0x24
    ffffffff81ff8f00
    0000000000000072
    0000000000000064
    0000000000000025
    ffff8800385a5b08
  [<ffffffff81346f46>] serial8250_console_putchar+0x26
    ffffffff81e3e430
    ffffffff81ff8f00
    ffff8800385a5b48
  [<ffffffff813428de>] uart_console_write+0x3e
  [<ffffffff8100bc0e>] apic_timer_interrupt+0xe
    0000000000000000
    ffffffff81ff8f00
    0000000000000001
    0000000000000064
    ffffffff81e3e40c
    ffff8800385a5b98
  [<ffffffff813472ad>] serial8250_console_write+0xbd
    00000000385a5cd8
    0000000000000006
    ffff8800385a5c08
    ffffffff81affa00
    ffffffff81c03800
    000000000001696c
    0000000000000064
    0000000000000046
    ffff8800385a5bc8
  [<ffffffff8106b8f5>] __call_console_drivers+0x75
    00000000000169d0
    ffffffff81e2797c
    00000000000169d0
    00000000000169d0
    ffff8800385a5be8
  [<ffffffff8106b95a>] _call_console_drivers+0x4a
    206465697272616d
    00000000fffff167
    ffff8800385a5c28
  [<ffffffff8106be6e>] release_console_sem+0x4e
    ffff8800385a5c18
    ffff8800385a5c6d
    ffffffff81ea7b24
    0000000000000064
    ffff8800385a5c58
    0000000000000034
    ffff8800385a5cc8
  [<ffffffff8106c628>] vprintk+0x248
    ffff8800385a5c98
    0000000000000246
    7420666f00000000
    ffff8800385a5ca8
    ffff8800385a5c68
    343931206e692072
    7365727065722035
    ffff8800385a5ca8
    0000000000002710
    0000000000002710
    ffffffff81c03a10
    00000000d863e02e
    ffff8800385a5d28
    ffff8800385a5d38
    000000000000003b
    00000000021b9010
    00007f07972b1010
    0000000000000003
    ffff8800385a5d28
  [<ffffffff814fd363>] printk+0x41
    6874202c00000010
    ffff8800385a5d38
    ffff8800385a5cf8
    656e696863616d20
    616820796c6e6f20
    ffff8800385a5d38
    0000000000002710
    0000000000002710
    ffffffff81c03a10
    0000000000000080
    ffff8800385a5db8
    ffffffffa00a919d
    696261706163206e
    6977202c7974696c
    20612074756f6874
    206c6172746e6563
    742079726f6d656d
    2065726f7473206f
    736d6172676f7270
    74616420646e6120
    754a206e49202e61
    2c3534393120656e
    6f76206e686f4a20
    6e616d75654e206e
    000000007570206e
    00000000d863e02e
    ffff8800385a5dc8
    000000000000003a
    ffff8800385a5e48
    ffffffffa00a91e8
    2064656873696c62
    2072657061702061
    64656c7469746e65
    2074737269462720
    666f207466617264
    726f706572206120
    656874206f742074
    2c27434156444520
    6820657265687720
    6e696c74756f2065
    6565726874206465
    6320636973616220
    000000006f706d6f
    00000000d863e02e
    ffff8800385a5e58
    0000000000000039
    ffff8800385a5ed8
    ffffffffa00a91e8
    6f662073746e656e
    726f747320612072
    72676f72702d6465
    75706d6f63206d61
    293128203a726574
    726f6d656d206120
    6961746e6f632079
    746f6220676e696e
    6120617461642068
    7274736e6920646e
    3b736e6f69746375
    6320612029322820
    0000000075636c61
    00000000d863e02e
    ffff8800385a5ee8
    0000000000000038
    ffff8800385a5f68
    ffffffffa00a91e8
    7520676e6974616c
    617061632074696e
    7020666f20656c62
    6e696d726f667265
    612068746f622067
    6974656d68746972
    6f6c20646e612063
    706f206c61636967
    736e6f6974617265
    20656874206e6f20
    6e61202c61746164
    2061202933282064
    00000000746e6f63
    00000000d863e02e
    ffff8800385a5f78
    0000000000000037
    ffff8800385a5ff8
    ffffffffa00a91e8
    74696e75206c6f72
    65746e69206f7420
    6e69207465727072
    6f69746375727473
    65726f747320736e
    6d656d206e692064
    20646e612079726f
    63656e20656b616d
    6120797261737365
    202e736e6f697463
    2073692073696854
    63206f7320656874
    00000000656c6c61
    00000000d863e02e
    ffff8800385a6008
    0000000000000036
    ffff8800385a6088


And other tools, you can reformat this output into what -l gives.


It is not that each change makes a big difference, that happens when several are used at one time:


tools/xentrace/xenctx -s ~/zzm 4 -l 200 -D -t -b 64
rip: ffffffff81346876 io_serial_in+0x16
flags: 00000002 nz
rsp: ffff8800385a5ab8
rax: 000000000000006f   rcx: 0000000000000000   rdx: 00000000000003fd
rbx: ffffffff81ff8f00   rsi: 0000000000000005   rdi: ffffffff81ff8f00
rbp: ffff8800385a5ab8    r8: ffffffff81c03a10    r9: 0000000000000080
r10: 0000000000000005   r11: 0000000000000046   r12: 000000000000270f
r13: 0000000000000020   r14: 0000000000000025   r15: ffffffff81346f20
 cs: 0010        ss: 0018        ds: 0000        es: 0000
 fs: 0000 @ 00007f07972f3700
 gs: 0000 @ ffff88000b400000/0000000000000000/
Code (instr addr ffffffff81346876)
48 89 e5 0f 1f 44 00 00 0f b6 4f 41 0f b7 57 08 d3 e6 01 f2 ec <0f> b6 c0 c9 c3 0f 1f 44 00 00 55


Stack:
ffff8800385a5ab8: ffff8800385a5ae8 ffffffff81346e64 ffffffff81ff8f00 0000000000000072 0000000000000064 0000000000000025 ffff8800385a5b08 ffffffff81346f46 .ZZ8....dn4.............r.......d.......%........[Z8....Fo4..... ffff8800385a5af8: ffffffff81e3e430 ffffffff81ff8f00 ffff8800385a5b48 ffffffff813428de ffffffff8100bc0e 0000000000000000 ffffffff81ff8f00 0000000000000001 0...............H[Z8.....(4..................................... ffff8800385a5b38: 0000000000000064 ffffffff81e3e40c ffff8800385a5b98 ffffffff813472ad 00000000385a5cd8 0000000000000006 ffff8800385a5c08 ffffffff81affa00 d................[Z8.....r4......\Z8.............\Z8............ ffff8800385a5b78: ffffffff81c03800 000000000001696c 0000000000000064 0000000000000046 ffff8800385a5bc8 ffffffff8106b8f5 00000000000169d0 ffffffff81e2797c .8......li......d.......F........[Z8.............i......|y...... ffff8800385a5bb8: 00000000000169d0 00000000000169d0 ffff8800385a5be8 ffffffff8106b95a 206465697272616d 00000000fffff167 ffff8800385a5c28 ffffffff8106be6e .i.......i.......[Z8....Z.......married g.......(\Z8....n....... ffff8800385a5bf8: ffff8800385a5c18 ffff8800385a5c6d ffffffff81ea7b24 0000000000000064 ffff8800385a5c58 0000000000000034 ffff8800385a5cc8 ffffffff8106c628 .\Z8....m\Z8....${......d.......X\Z8....4........\Z8....(....... ffff8800385a5c38: ffff8800385a5c98 0000000000000246 7420666f00000000 ffff8800385a5ca8 ffff8800385a5c68 343931206e692072 7365727065722035 ffff8800385a5ca8 .\Z8....F...........of t.\Z8....h\Z8....r in 1945 repres.\Z8.... ffff8800385a5c78: 0000000000002710 0000000000002710 ffffffff81c03a10 00000000d863e02e ffff8800385a5d28 ffff8800385a5d38 000000000000003b 00000000021b9010 .'.......'.......:........c.....(]Z8....8]Z8....;............... ffff8800385a5cb8: 00007f07972b1010 0000000000000003 ffff8800385a5d28 ffffffff814fd363 6874202c00000010 ffff8800385a5d38 ffff8800385a5cf8 656e696863616d20 ..+.............(]Z8....c.O........., th8]Z8.....\Z8.... machine ffff8800385a5cf8: 616820796c6e6f20 ffff8800385a5d38 0000000000002710 0000000000002710 ffffffff81c03a10 0000000000000080 ffff8800385a5db8 ffffffffa00a919d only ha8]Z8.....'.......'.......:...............]Z8............ ffff8800385a5d38: 696261706163206e 6977202c7974696c 20612074756f6874 206c6172746e6563 742079726f6d656d 2065726f7473206f 736d6172676f7270 74616420646e6120 n capability, without a central memory to store programs and dat ffff8800385a5d78: 754a206e49202e61 2c3534393120656e 6f76206e686f4a20 6e616d75654e206e 000000007570206e 00000000d863e02e ffff8800385a5dc8 000000000000003a a. In June 1945, John von Neumann pu......c......]Z8....:....... ffff8800385a5db8: ffff8800385a5e48 ffffffffa00a91e8 2064656873696c62 2072657061702061 64656c7469746e65 2074737269462720 666f207466617264 726f706572206120 H^Z8............blished a paper entitled 'First draft of a repor ffff8800385a5df8: 656874206f742074 2c27434156444520 6820657265687720 6e696c74756f2065 6565726874206465 6320636973616220 000000006f706d6f 00000000d863e02e t to the EDVAC', where he outlined three basic compo......c..... ffff8800385a5e38: ffff8800385a5e58 0000000000000039 ffff8800385a5ed8 ffffffffa00a91e8 6f662073746e656e 726f747320612072 72676f72702d6465 75706d6f63206d61 X^Z8....9........^Z8............nents for a stored-program compu ffff8800385a5e78: 293128203a726574 726f6d656d206120 6961746e6f632079 746f6220676e696e 6120617461642068 7274736e6920646e 3b736e6f69746375 6320612029322820 ter: (1) a memory containing both data and instructions; (2) a c ffff8800385a5eb8: 0000000075636c61 00000000d863e02e ffff8800385a5ee8 0000000000000038 ffff8800385a5f68 ffffffffa00a91e8 7520676e6974616c 617061632074696e alcu......c......^Z8....8.......h_Z8............lating unit capa ffff8800385a5ef8: 7020666f20656c62 6e696d726f667265 612068746f622067 6974656d68746972 6f6c20646e612063 706f206c61636967 736e6f6974617265 20656874206e6f20 ble of performing both arithmetic and logical operations on the ffff8800385a5f38: 6e61202c61746164 2061202933282064 00000000746e6f63 00000000d863e02e ffff8800385a5f78 0000000000000037 ffff8800385a5ff8 ffffffffa00a91e8 data, and (3) a cont......c.....x_Z8....7........_Z8............ ffff8800385a5f78: 74696e75206c6f72 65746e69206f7420 6e69207465727072 6f69746375727473 65726f747320736e 6d656d206e692064 20646e612079726f 63656e20656b616d rol unit to interpret instructions stored in memory and make nec ffff8800385a5fb8: 6120797261737365 202e736e6f697463 2073692073696854 63206f7320656874 00000000656c6c61 00000000d863e02e ffff8800385a6008 0000000000000036 essary actions. This is the so calle......c......`Z8....6.......
ffff8800385a5ff8: ffff8800385a6088 .`Z8....

Call Trace:
  [<ffffffff81346876>] io_serial_in+0x16 <--
  [<ffffffff81346e64>] wait_for_xmitr+0x24
  [<ffffffff81346f46>] serial8250_console_putchar+0x26
  [<ffffffff813428de>] uart_console_write+0x3e
  [<ffffffff8100bc0e>] apic_timer_interrupt+0xe
  [<ffffffff813472ad>] serial8250_console_write+0xbd
  [<ffffffff8106b8f5>] __call_console_drivers+0x75
  [<ffffffff8106b95a>] _call_console_drivers+0x4a
  [<ffffffff8106be6e>] release_console_sem+0x4e
  [<ffffffff8106c628>] vprintk+0x248
  [<ffffffff814fd363>] printk+0x41


    -Don Slutz

Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx>
---
Ian.




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.