利用crash工具,我们可以很方便的查看正在运行内核的一些全局变量的数据结构,如TCP的ehash、bhash哈希桶,全局变量的查看比较简单。Crash工具还允许我们查看调用堆栈内部的局部变量,下面示例查看一个进程的listen sock结构(实际上从file->private_data中查看更为方便)

  1. ******@Inspiron:~$nc -lk 45678
  2. #接着在另一个终端上运行下面命令
  3. root@Inspiron:/home/******$ps -aux | grep 45678
  4. ******
  5.    5184  0.0  0.0   9184   816 pts/23   S+   23:20   0:00 nc -lk 45678
  6. root      5187  0.0  0.0  15984   944 pts/20   S+   23:20   0:00 grep --color=auto 45678
  7. root@Inspiron:/home/******$crash
  8. crash 7.1.4
  9. Copyright(C)2002-2015  RedHat,Inc.
  10. Copyright(C)2004,2005,2006,2010  IBM Corporation
  11. Copyright(C)1999-2006  Hewlett-PackardCo
  12. Copyright(C)2005,2006,2011,2012  FujitsuLimited
  13. Copyright(C)2006,2007  VA LinuxSystemsJapan K.K.
  14. Copyright(C)2005,2011  NEC Corporation
  15. Copyright(C)1999,2002,2007  SiliconGraphics,Inc.
  16. Copyright(C)1999,2000,2001,2002  MissionCriticalLinux,Inc.
  17. This program is free software, covered by the GNU GeneralPublicLicense,
  18. and you are welcome to change it and/or distribute copies of it under
  19. certain conditions.  Enter"help copying" to see the conditions.
  20. This program has absolutely no warranty.  Enter"help warranty"for details.
  21. GNU gdb (GDB)7.6
  22. Copyright(C)2013FreeSoftwareFoundation,Inc.
  23. LicenseGPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  24. This is free software: you are free to change and redistribute it.
  25. There is NO WARRANTY, to the extent permitted by law.  Type"show copying"
  26. and "show warranty"for details.
  27. This GDB was configured as "x86_64-unknown-linux-gnu"...
  28. crash: read error: kernel virtual address: ffffffff81a11e30  type:"cpu_possible_mask"
  29. crash: this kernel may be configured with CONFIG_STRICT_DEVMEM, which
  30.       renders /dev/mem unusable as a live memory source.
  31. crash: trying /proc/kcore as an alternative to /dev/mem
  32.      KERNEL:/lib/modules/4.4.13+/build/vmlinux
  33.    DUMPFILE:/proc/kcore
  34.        CPUS:4
  35.        DATE:MonNov  723:20:532016
  36.      UPTIME:02:28:15
  37. LOAD AVERAGE:1.10,0.86,0.77
  38.       TASKS:663
  39.    NODENAME: ******-Inspiron-N5010
  40.     RELEASE:4.4.13+
  41.     VERSION:#5 SMP Sat Nov 5 15:51:12 CST 2016
  42.     MACHINE: x86_64  (2526Mhz)
  43.      MEMORY:3.9 GB
  44.         PID:5191
  45.     COMMAND:"crash"
  46.        TASK: ffff88006fc80000  [THREAD_INFO: ffff8800672bc000]
  47.         CPU:1
  48.       STATE: TASK_RUNNING (ACTIVE)
  49. crash>set pid 5184
  50. set: invalid task or pid value: pid
  51.    PID:5184
  52. COMMAND:"nc"
  53.   TASK: ffff880035687080  [THREAD_INFO: ffff88006ca34000]
  54.    CPU:2
  55.  STATE: TASK_INTERRUPTIBLE
  56. crash> bt
  57. PID:5184   TASK: ffff880035687080  CPU:2   COMMAND:"nc"
  58. #0 [ffff88006ca37ca0] __schedule at ffffffff81825b8e
  59. #1 [ffff88006ca37cf0] schedule at ffffffff81826275
  60. #2 [ffff88006ca37d08] schedule_timeout at ffffffff81829395
  61. #3 [ffff88006ca37db8] inet_csk_accept at ffffffff81766b8b
  62. #4 [ffff88006ca37e30] inet_accept at ffffffff8179897c
  63. #5 [ffff88006ca37e68] SYSC_accept4 at ffffffff816fe523
  64. #6 [ffff88006ca37f40] sys_accept at ffffffff81700110
  65. #7 [ffff88006ca37f50] entry_SYSCALL_64_fastpath at ffffffff8182a372
  66.    RIP:00007fb0c2b504b0  RSP:00007ffd3bde40c8  RFLAGS:00000246
  67.    RAX: ffffffffffffffda  RBX:0000000001978010  RCX:00007fb0c2b504b0
  68.    RDX:00007ffd3bde4154  RSI:00007ffd3bde41e0  RDI:0000000000000003
  69.    RBP:0000000000000000   R8:0000000000000000   R9:0000000000000000
  70.    R10:000000000000071a  R11:0000000000000246  R12:0000000000000005
  71.    R13:0000000000405a21  R14:0000000000000000  R15:0000000000000000
  72.    ORIG_RAX:000000000000002b  CS:0033  SS:002b
  73. crash> bt -f
  74. PID:5184   TASK: ffff880035687080  CPU:2   COMMAND:"nc"
  75. #0 [ffff88006ca37ca0] __schedule at ffffffff81825b8e
  76.    ffff88006ca37ca8: ffffffff811e9d79 ffff880132818c80
  77.    ffff88006ca37cb8: ffff880035687080 ffff88006ca38000
  78.    ffff88006ca37cc8: ffff88006ca37e3c 7fffffffffffffff
  79.    ffff88006ca37cd8: ffff880035687080 ffff880106ad8780
  80.    ffff88006ca37ce8: ffff88006ca37d00 ffffffff81826275
  81. #1 [ffff88006ca37cf0] schedule at ffffffff81826275
  82.    ffff88006ca37cf8:7fffffffffffffff ffff88006ca37db0
  83.    ffff88006ca37d08: ffffffff81829395
  84. #2 [ffff88006ca37d08] schedule_timeout at ffffffff81829395
  85.    ffff88006ca37d10:7fffffffffffffff ffffffff81d6021d
  86.    ffff88006ca37d20:00000000000000000000000000000000
  87.    ffff88006ca37d30:00000000000000000000000000000000
  88.    ffff88006ca37d40:00000000000000000000000600000001
  89.    ffff88006ca37d50:00000000000000000000000000000246
  90.    ffff88006ca37d60:7fffffffffffffff ffff88006ca37d78
  91.    ffff88006ca37d70: ffffffff81829eae 0000000028c4ff93
  92.    ffff88006ca37d80: ffffffff817033ad 7fffffffffffffff
  93.    ffff88006ca37d90: ffff88006ca37e3c 7fffffffffffffff
  94.    ffff88006ca37da0: ffff880035687080 ffff880106ad8780
  95.    ffff88006ca37db0: ffff88006ca37e28 ffffffff81766b8b
  96. #3 [ffff88006ca37db8] inet_csk_accept at ffffffff81766b8b
  97.    ffff88006ca37dc0: ffff880035687080 ffff880035687080
  98.    ffff88006ca37dd0:0000000000000001 ffff880035687080
  99.    ffff88006ca37de0: ffffffff810c2a80 ffff88006c990908
  100.    ffff88006ca37df0: ffff88006c990908 0000000028c4ff93
  101.    ffff88006ca37e00: ffff88009a505b80 ffff88009a505400
  102.    ffff88006ca37e10:000000000000000400007ffd3bde41e0
  103.    ffff88006ca37e20: ffff88009a505400 ffff88006ca37e60
  104. #从inet_csk_accept反汇编代码中可以确定listen sock存储与R15寄存器,在函数调用过程中,R15寄存器存于调用堆栈中,如下代码push   %r15
  105. crash> dis -l schedule_timeout
  106. /home/******/MyRes/linux-source-4.4.0/kernel/time/timer.c:1494
  107. 0xffffffff818291e0<schedule_timeout>:  data32 data32 data32 xchg %ax,%ax [FTRACE NOP]
  108. 0xffffffff818291e5<schedule_timeout+5>:        push   %rbp
  109. 0xffffffff818291e6<schedule_timeout+6>:        mov    %rsp,%rbp
  110. 0xffffffff818291e9<schedule_timeout+9>:        push   %r15
  111. 0xffffffff818291eb<schedule_timeout+11>:       push   %r14
  112. 0xffffffff818291ed<schedule_timeout+13>:       push   %r13
  113. 0xffffffff818291ef<schedule_timeout+15>:       push   %r12
  114. 0xffffffff818291f1<schedule_timeout+17>:       push   %rbx
  115. 0xffffffff818291f2<schedule_timeout+18>:       and    $0xfffffffffffffff0,%rsp
  116. 0xffffffff818291f6<schedule_timeout+22>:       sub    $0x70,%rsp
  117. 0xffffffff818291fa<schedule_timeout+26>:       mov    %gs:0x28,%rax
  118. 0xffffffff81829203<schedule_timeout+35>:       mov    %rax,0x68(%rsp)
  119. 0xffffffff81829208<schedule_timeout+40>:       xor    %eax,%eax
  120. /home/******/MyRes/linux-source-4.4.0/kernel/time/timer.c:1498
  121. 0xffffffff8182920a<schedule_timeout+42>:       movabs $0x7fffffffffffffff,%rax
  122. 0xffffffff81829214<schedule_timeout+52>:       cmp    %rax,%rdi
  123. 0xffffffff81829217<schedule_timeout+55>:       je     0xffffffff8182938c<schedule_timeout+428>
  124. /home/******/MyRes/linux-source-4.4.0/kernel/time/timer.c:1518
  125. 0xffffffff8182921d<schedule_timeout+61>:       test   %rdi,%rdi
  126. 0xffffffff81829220<schedule_timeout+64>:       js     0xffffffff81829422<schedule_timeout+578>
  127. /home/******/MyRes/linux-source-4.4.0/kernel/time/timer.c:1527
  128. #从bt -f显示的调用堆栈中确定在运行inet_csk_accept函数的时候,R15寄存器的值为ffff880106ad8780,取出listen sock地址
  129. crash> struct sock ffff880106ad8780
  130. struct sock {
  131.  __sk_common ={
  132.    {
  133.      skc_addrpair =0,
  134.      {
  135.        skc_daddr =0,
  136.        skc_rcv_saddr =0
  137.      }
  138.    },
  139.    {
  140.      skc_hash =0,
  141.      skc_u16hashes ={0,0}
  142.    },
  143.    {
  144.      skc_portpair =2993553408,
  145.      {
  146.        skc_dport =0,
  147.        skc_num =45678
  148.      }
  149.    },
  150.    skc_family =2,
  151.    skc_state =10'\n',
  152.    skc_reuse =1'\001',
  153.    skc_reuseport =0'\000',
  154.    skc_ipv6only =0'\000',
  155.    skc_net_refcnt =1'\001',
  156.    debug =0'\000',
  157.    skc_bound_dev_if =0,
  158.    {
  159.      skc_bind_node ={
  160.        next =0x0,
  161.        pprev =0xffff88006c9909e8
  162.      },
  163.      skc_portaddr_node ={
  164.        next =0x0,
  165.        pprev =0xffff88006c9909e8
  166.      }
  167.    },
  168.    skc_prot =0xffffffff81efa160<tcp_prot>,
  169.    skc_net ={
  170.      net =0xffffffff81ef3e00<init_net>
  171.    },
  172.    skc_v6_daddr ={
  173.      in6_u ={
  174.        u6_addr8 ="\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
  175.        u6_addr16 ={0,0,0,0,0,0,0,0},
  176.        u6_addr32 ={0,0,0,0}
  177.      }
  178.    },
  179.    skc_v6_rcv_saddr ={
  180.      in6_u ={
  181.        u6_addr8 ="\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
  182.        u6_addr16 ={0,0,0,0,0,0,0,0},
  183.        u6_addr32 ={0,0,0,0}
  184.      }
  185.    },
  186.    skc_cookie ={
  187.      counter =0
  188.    },
  189.    {
  190.      skc_flags =768,
  191.      skc_listener =0x300,
  192.      skc_tw_dr =0x300
  193.    },
  194.    skc_dontcopy_begin =0xffff880106ad87e8,
  195.    {
  196.      skc_node ={
  197.        next =0x4000000d,
  198.        pprev =0xffffffff821f61a8<tcp_hashinfo+168>
  199.      },
  200.      skc_nulls_node ={
  201.        next =0x4000000d,
  202.        pprev =0xffffffff821f61a8<tcp_hashinfo+168>
  203.      }
  204.    },
  205.    skc_tx_queue_mapping =-1,
  206.    {
  207.      skc_incoming_cpu =-1,
  208.      skc_rcv_wnd =4294967295,
  209.      skc_tw_rcv_nxt =4294967295
  210.    },
  211.    skc_refcnt ={
  212.      counter =1
  213.    },
  214.    skc_dontcopy_end =0xffff880106ad8804,
  215.    {
  216.      skc_rxhash =0,
  217.      skc_window_clamp =0,
  218.      skc_tw_snd_nxt =0
  219.    }
  220.  },
  221.  sk_lock ={
  222.    slock ={
  223.      {
  224.        rlock ={
  225.          raw_lock ={
  226.            val ={
  227.              counter =0
  228.            }
  229.          }
  230.        }
  231.      }
  232.    },
  233.    owned =0,
  234.    wq ={
  235.      lock ={
  236.        {
  237.          rlock ={
  238.            raw_lock ={
  239.              val ={
  240.                counter =0
  241.              }
  242.            }
  243.          }
  244.        }
  245.      },
  246.      task_list ={
  247.        next =0xffff880106ad8818,
  248.        prev =0xffff880106ad8818
  249.      }
  250.    }
  251.  },
  252.  sk_receive_queue ={
  253.    next =0xffff880106ad8828,
  254.    prev =0xffff880106ad8828,
  255.    qlen =0,
  256.    lock ={
  257.      {
  258.        rlock ={
  259.          raw_lock ={
  260.            val ={
  261.              counter =0
  262.            }
  263.          }
  264.        }
  265.      }
  266.    }
  267.  },
  268.  sk_backlog ={
  269.    rmem_alloc ={
  270.      counter =0
  271.    },
  272.    len =0,
  273.    head =0x0,
  274.    tail =0x0
  275.  },
  276.  sk_forward_alloc =0,
  277.  sk_txhash =0,
  278.  sk_napi_id =0,
  279.  sk_ll_usec =0,
  280.  sk_drops ={
  281.    counter =0
  282.  },
  283.  sk_rcvbuf =87380,
  284.  sk_filter =0x0,
  285.  {
  286.    sk_wq =0xffff88006c990900,
  287.    sk_wq_raw =0xffff88006c990900
  288.  },
  289.  sk_policy ={0x0,0x0},
  290.  sk_rx_dst =0x0,
  291.  sk_dst_cache =0x0,
  292.  sk_wmem_alloc ={
  293.    counter =1
  294.  },
  295.  sk_omem_alloc ={
  296.    counter =0
  297.  },
  298.  sk_sndbuf =16384,
  299.  sk_write_queue ={
  300.    next =0xffff880106ad88b0,
  301.    prev =0xffff880106ad88b0,
  302.    qlen =0,
  303.    lock ={
  304.      {
  305.        rlock ={
  306.          raw_lock ={
  307.            val ={
  308.              counter =0
  309.            }
  310.          }
  311.        }
  312.      }
  313.    }
  314.  },
  315.  sk_shutdown =0,
  316.  sk_no_check_tx =0,
  317.  sk_no_check_rx =0,
  318.  sk_userlocks =8,
  319.  sk_protocol =6,
  320.  sk_type =1,
  321.  sk_wmem_queued =0,
  322.  sk_allocation =37748928,
  323.  sk_pacing_rate =4294967295,
  324.  sk_max_pacing_rate =4294967295,
  325.  sk_route_caps =0,
  326.  sk_route_nocaps =0,
  327.  sk_gso_type =0,
  328.  sk_gso_max_size =0,
  329.  sk_gso_max_segs =0,
  330.  sk_rcvlowat =1,
  331.  sk_lingertime =0,
  332.  sk_error_queue ={
  333.    next =0xffff880106ad8908,
  334.    prev =0xffff880106ad8908,
  335.    qlen =0,
  336.    lock ={
  337.      {
  338.        rlock ={
  339.          raw_lock ={
  340.            val ={
  341.              counter =0
  342.            }
  343.          }
  344.        }
  345.      }
  346.    }
  347.  },
  348.  sk_prot_creator =0xffffffff81efa160<tcp_prot>,
  349.  sk_callback_lock ={
  350.    raw_lock ={
  351.      cnts ={
  352.        counter =0
  353.      },
  354.      wait_lock ={
  355.        val ={
  356.          counter =0
  357.        }
  358.      }
  359.    }
  360.  },
  361.  sk_err =0,
  362.  sk_err_soft =0,
  363.  sk_ack_backlog =0,
  364.  sk_max_ack_backlog =1,
  365.  sk_priority =0,
  366.  sk_cgrp_prioidx =1,
  367.  sk_peer_pid =0x0,
  368.  sk_peer_cred =0x0,
  369.  sk_rcvtimeo =9223372036854775807,
  370.  sk_sndtimeo =9223372036854775807,
  371.  sk_timer ={
  372.    entry ={
  373.      next =0x0,
  374.      pprev =0x0
  375.    },
  376.    expires =0,
  377.    function=0xffffffff8177d710<tcp_keepalive_timer>,
  378.    data =18446612136721221504,
  379.    flags =2,
  380.    slack =-1,
  381.    start_pid =-1,
  382.    start_site =0x0,
  383.    start_comm ="\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
  384.  },
  385.  sk_stamp ={
  386.    tv64 =-1000000000
  387.  },
  388.  sk_tsflags =0,
  389.  sk_tskey =0,
  390.  sk_socket =0xffff88009a505b80,
  391.  sk_user_data =0x0,
  392.  sk_frag ={
  393.    page =0x0,
  394.    offset =0,
  395.    size =0
  396.  },
  397.  sk_send_head =0x0,
  398.  sk_peek_off =-1,
  399.  sk_write_pending =0,
  400.  sk_security =0xffff88006caaf340,
  401.  sk_mark =0,
  402.  sk_classid =0,
  403.  sk_cgrp =0x0,
  404.  sk_state_change =0xffffffff81701ee0<sock_def_wakeup>,
  405.  sk_data_ready =0xffffffff81702930<sock_def_readable>,
  406.  sk_write_space =0xffffffff8170f670<sk_stream_write_space>,
  407.  sk_error_report =0xffffffff81702840<sock_def_error_report>,
  408.  sk_backlog_rcv =0xffffffff81781da0<tcp_v4_do_rcv>,
  409.  sk_destruct =0xffffffff817998f0<inet_sock_destruct>
  410. }
  411. crash> struct inet_connection_sock ffff880106ad8780
  412. struct inet_connection_sock {
  413.  icsk_inet ={
  414.    sk ={
  415.      __sk_common ={
  416.        {
  417.          skc_addrpair =0,
  418.          {
  419.            skc_daddr =0,
  420.            skc_rcv_saddr =0
  421.          }
  422.        },
  423.        {
  424.          skc_hash =0,
  425.          skc_u16hashes ={0,0}
  426.        },
  427.        {
  428.          skc_portpair =2993553408,
  429.          {
  430.            skc_dport =0,
  431.            skc_num =45678
  432.          }
  433.        },
  434.        skc_family =2,
  435.        skc_state =10'\n',
  436.        skc_reuse =1'\001',
  437.        skc_reuseport =0'\000',
  438.        skc_ipv6only =0'\000',
  439.        skc_net_refcnt =1'\001',
  440.        debug =0'\000',
  441.        skc_bound_dev_if =0,
  442.        {
  443.          skc_bind_node ={
  444.            next =0x0,
  445.            pprev =0xffff88006c9909e8
  446.          },
  447.          skc_portaddr_node ={
  448.            next =0x0,
  449.            pprev =0xffff88006c9909e8
  450.          }
  451.        },
  452.        skc_prot =0xffffffff81efa160<tcp_prot>,
  453.        skc_net ={
  454.          net =0xffffffff81ef3e00<init_net>
  455.        },
  456.        skc_v6_daddr ={
  457.          in6_u ={
  458.            u6_addr8 ="\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
  459.            u6_addr16 ={0,0,0,0,0,0,0,0},
  460.            u6_addr32 ={0,0,0,0}
  461.          }
  462.        },
  463.        skc_v6_rcv_saddr ={
  464.          in6_u ={
  465.            u6_addr8 ="\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
  466.            u6_addr16 ={0,0,0,0,0,0,0,0},
  467.            u6_addr32 ={0,0,0,0}
  468.          }
  469.        },
  470.        skc_cookie ={
  471.          counter =0
  472.        },
  473.        {
  474.          skc_flags =768,
  475.          skc_listener =0x300,
  476.          skc_tw_dr =0x300
  477.        },
  478.        skc_dontcopy_begin =0xffff880106ad87e8,
  479.        {
  480.          skc_node ={
  481.            next =0x4000000d,
  482.            pprev =0xffffffff821f61a8<tcp_hashinfo+168>
  483.          },
  484.          skc_nulls_node ={
  485.            next =0x4000000d,
  486.            pprev =0xffffffff821f61a8<tcp_hashinfo+168>
  487.          }
  488.        },
  489.        skc_tx_queue_mapping =-1,
  490.        {
  491.          skc_incoming_cpu =-1,
  492.          skc_rcv_wnd =4294967295,
  493.          skc_tw_rcv_nxt =4294967295
  494.        },
  495.        skc_refcnt ={
  496.          counter =1
  497.        },
  498.        skc_dontcopy_end =0xffff880106ad8804,
  499.        {
  500.          skc_rxhash =0,
  501.          skc_window_clamp =0,
  502.          skc_tw_snd_nxt =0
  503.        }
  504.      },
  505.      sk_lock ={
  506.        slock ={
  507.          {
  508.            rlock ={
  509.              raw_lock ={
  510.                val ={
  511.                  counter =0
  512.                }
  513.              }
  514.            }
  515.          }
  516.        },
  517.        owned =0,
  518.        wq ={
  519.          lock ={
  520.            {
  521.              rlock ={
  522.                raw_lock ={
  523.                  val ={
  524.                    counter =0
  525.                  }
  526.                }
  527.              }
  528.            }
  529.          },
  530.          task_list ={
  531.            next =0xffff880106ad8818,
  532.            prev =0xffff880106ad8818
  533.          }
  534.        }
  535.      },
  536.      sk_receive_queue ={
  537.        next =0xffff880106ad8828,
  538.        prev =0xffff880106ad8828,
  539.        qlen =0,
  540.        lock ={
  541.          {
  542.            rlock ={
  543.              raw_lock ={
  544.                val ={
  545.                  counter =0
  546.                }
  547.              }
  548.            }
  549.          }
  550.        }
  551.      },
  552.      sk_backlog ={
  553.        rmem_alloc ={
  554.          counter =0
  555.        },
  556.        len =0,
  557.        head =0x0,
  558.        tail =0x0
  559.      },
  560.      sk_forward_alloc =0,
  561.      sk_txhash =0,
  562.      sk_napi_id =0,
  563.      sk_ll_usec =0,
  564.      sk_drops ={
  565.        counter =0
  566.      },
  567.      sk_rcvbuf =87380,
  568.      sk_filter =0x0,
  569.      {
  570.        sk_wq =0xffff88006c990900,
  571.        sk_wq_raw =0xffff88006c990900
  572.      },
  573.      sk_policy ={0x0,0x0},
  574.      sk_rx_dst =0x0,
  575.      sk_dst_cache =0x0,
  576.      sk_wmem_alloc ={
  577.        counter =1
  578.      },
  579.      sk_omem_alloc ={
  580.        counter =0
  581.      },
  582.      sk_sndbuf =16384,
  583.      sk_write_queue ={
  584.        next =0xffff880106ad88b0,
  585.        prev =0xffff880106ad88b0,
  586.        qlen =0,
  587.        lock ={
  588.          {
  589.            rlock ={
  590.              raw_lock ={
  591.                val ={
  592.                  counter =0
  593.                }
  594.              }
  595.            }
  596.          }
  597.        }
  598.      },
  599.      sk_shutdown =0,
  600.      sk_no_check_tx =0,
  601.      sk_no_check_rx =0,
  602.      sk_userlocks =8,
  603.      sk_protocol =6,
  604.      sk_type =1,
  605.      sk_wmem_queued =0,
  606.      sk_allocation =37748928,
  607.      sk_pacing_rate =4294967295,
  608.      sk_max_pacing_rate =4294967295,
  609.      sk_route_caps =0,
  610.      sk_route_nocaps =0,
  611.      sk_gso_type =0,
  612.      sk_gso_max_size =0,
  613.      sk_gso_max_segs =0,
  614.      sk_rcvlowat =1,
  615.      sk_lingertime =0,
  616.      sk_error_queue ={
  617.        next =0xffff880106ad8908,
  618.        prev =0xffff880106ad8908,
  619.        qlen =0,
  620.        lock ={
  621.          {
  622.            rlock ={
  623.              raw_lock ={
  624.                val ={
  625.                  counter =0
  626.                }
  627.              }
  628.            }
  629.          }
  630.        }
  631.      },
  632.      sk_prot_creator =0xffffffff81efa160<tcp_prot>,
  633.      sk_callback_lock ={
  634.        raw_lock ={
  635.          cnts ={
  636.            counter =0
  637.          },
  638.          wait_lock ={
  639.            val ={
  640.              counter =0
  641.            }
  642.          }
  643.        }
  644.      },
  645.      sk_err =0,
  646.      sk_err_soft =0,
  647.      sk_ack_backlog =0,
  648.      sk_max_ack_backlog =1,
  649.      sk_priority =0,
  650.      sk_cgrp_prioidx =1,
  651.      sk_peer_pid =0x0,
  652.      sk_peer_cred =0x0,
  653.      sk_rcvtimeo =9223372036854775807,
  654.      sk_sndtimeo =9223372036854775807,
  655.      sk_timer ={
  656.        entry ={
  657.          next =0x0,
  658.          pprev =0x0
  659.        },
  660.        expires =0,
  661.        function=0xffffffff8177d710<tcp_keepalive_timer>,
  662.        data =18446612136721221504,
  663.        flags =2,
  664.        slack =-1,
  665.        start_pid =-1,
  666.        start_site =0x0,
  667.        start_comm ="\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
  668.      },
  669.      sk_stamp ={
  670.        tv64 =-1000000000
  671.      },
  672.      sk_tsflags =0,
  673.      sk_tskey =0,
  674.      sk_socket =0xffff88009a505b80,
  675.      sk_user_data =0x0,
  676.      sk_frag ={
  677.        page =0x0,
  678.        offset =0,
  679.        size =0
  680.      },
  681.      sk_send_head =0x0,
  682.      sk_peek_off =-1,
  683.      sk_write_pending =0,
  684.      sk_security =0xffff88006caaf340,
  685.      sk_mark =0,
  686.      sk_classid =0,
  687.      sk_cgrp =0x0,
  688.      sk_state_change =0xffffffff81701ee0<sock_def_wakeup>,
  689.      sk_data_ready =0xffffffff81702930<sock_def_readable>,
  690.      sk_write_space =0xffffffff8170f670<sk_stream_write_space>,
  691.      sk_error_report =0xffffffff81702840<sock_def_error_report>,
  692.      sk_backlog_rcv =0xffffffff81781da0<tcp_v4_do_rcv>,
  693.      sk_destruct =0xffffffff817998f0<inet_sock_destruct>
  694.    },
  695.    pinet6 =0x0,
  696.    inet_saddr =0,
  697.    uc_ttl =-1,
  698.    cmsg_flags =0,
  699.    inet_sport =28338,
  700.    inet_id =0,
  701.    inet_opt =0x0,
  702.    rx_dst_ifindex =0,
  703.    tos =0'\000',
  704.    min_ttl =0'\000',
  705.    mc_ttl =1'\001',
  706.    pmtudisc =1'\001',
  707.    recverr =0'\000',
  708.    is_icsk =1'\001',
  709.    freebind =0'\000',
  710.    hdrincl =0'\000',
  711.    mc_loop =1'\001',
  712.    transparent =0'\000',
  713.    mc_all =1'\001',
  714.    nodefrag =0'\000',
  715.    bind_address_no_port =0'\000',
  716.    rcv_tos =0'\000',
  717.    convert_csum =0'\000',
  718.    uc_index =0,
  719.    mc_index =0,
  720.    mc_addr =0,
  721.    mc_list =0x0,
  722.    cork ={
  723.      base ={
  724.        flags =0,
  725.        addr =0,
  726.        opt =0x0,
  727.        fragsize =0,
  728.        length =0,
  729.        dst =0x0,
  730.        tx_flags =0'\000',
  731.        ttl =0'\000',
  732.        tos =0,
  733.        priority =0'\000'
  734.      },
  735.      fl ={
  736.        u ={
  737.          __fl_common ={
  738.            flowic_oif =0,
  739.            flowic_iif =0,
  740.            flowic_mark =0,
  741.            flowic_tos =0'\000',
  742.            flowic_scope =0'\000',
  743.            flowic_proto =0'\000',
  744.            flowic_flags =0'\000',
  745.            flowic_secid =0,
  746.            flowic_tun_key ={
  747.              tun_id =0
  748.            }
  749.          },
  750.          ip4 ={
  751.            __fl_common ={
  752.              flowic_oif =0,
  753.              flowic_iif =0,
  754.              flowic_mark =0,
  755.              flowic_tos =0'\000',
  756.              flowic_scope =0'\000',
  757.              flowic_proto =0'\000',
  758.              flowic_flags =0'\000',
  759.              flowic_secid =0,
  760.              flowic_tun_key ={
  761.                tun_id =0
  762.              }
  763.            },
  764.            saddr =0,
  765.            daddr =0,
  766.            uli ={
  767.              ports ={
  768.                dport =0,
  769.                sport =0
  770.              },
  771.              icmpt ={
  772.                type =0'\000',
  773.                code =0'\000'
  774.              },
  775.              dnports ={
  776.                dport =0,
  777.                sport =0
  778.              },
  779.              spi =0,
  780.              gre_key =0,
  781.              mht ={
  782.                type =0'\000'
  783.              }
  784.            }
  785.          },
  786.          ip6 ={
  787.            __fl_common ={
  788.              flowic_oif =0,
  789.              flowic_iif =0,
  790.              flowic_mark =0,
  791.              flowic_tos =0'\000',
  792.              flowic_scope =0'\000',
  793.              flowic_proto =0'\000',
  794.              flowic_flags =0'\000',
  795.              flowic_secid =0,
  796.              flowic_tun_key ={
  797.                tun_id =0
  798.              }
  799.            },
  800.            daddr ={
  801.              in6_u ={
  802.                u6_addr8 ="\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
  803.                u6_addr16 ={0,0,0,0,0,0,0,0},
  804.                u6_addr32 ={0,0,0,0}
  805.              }
  806.            },
  807.            saddr ={
  808.              in6_u ={
  809.                u6_addr8 ="\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
  810.                u6_addr16 ={0,0,0,0,0,0,0,0},
  811.                u6_addr32 ={0,0,0,0}
  812.              }
  813.            },
  814.            flowlabel =0,
  815.            uli ={
  816.              ports ={
  817.                dport =0,
  818.                sport =0
  819.              },
  820.              icmpt ={
  821.                type =0'\000',
  822.                code =0'\000'
  823.              },
  824.              dnports ={
  825.                dport =0,
  826.                sport =0
  827.              },
  828.              spi =0,
  829.              gre_key =0,
  830.              mht ={
  831.                type =0'\000'
  832.              }
  833.            }
  834.          },
  835.          dn ={
  836.            __fl_common ={
  837.              flowic_oif =0,
  838.              flowic_iif =0,
  839.              flowic_mark =0,
  840.              flowic_tos =0'\000',
  841.              flowic_scope =0'\000',
  842.              flowic_proto =0'\000',
  843.              flowic_flags =0'\000',
  844.              flowic_secid =0,
  845.              flowic_tun_key ={
  846.                tun_id =0
  847.              }
  848.            },
  849.            daddr =0,
  850.            saddr =0,
  851.            uli ={
  852.              ports ={
  853.                dport =0,
  854.                sport =0
  855.              },
  856.              icmpt ={
  857.                type =0'\000',
  858.                code =0'\000'
  859.              },
  860.              dnports ={
  861.                dport =0,
  862.                sport =0
  863.              },
  864.              spi =0,
  865.              gre_key =0,
  866.              mht ={
  867.                type =0'\000'
  868.              }
  869.            }
  870.          }
  871.        }
  872.      }
  873.    }
  874.  },
  875.  icsk_accept_queue ={
  876.    rskq_lock ={
  877.      {
  878.        rlock ={
  879.          raw_lock ={
  880.            val ={
  881.              counter =0
  882.            }
  883.          }
  884.        }
  885.      }
  886.    },
  887.    rskq_defer_accept =0'\000',
  888.    synflood_warned =0,
  889.    qlen ={
  890.      counter =0
  891.    },
  892.    young ={
  893.      counter =0
  894.    },
  895.    rskq_accept_head =0x0,
  896.    rskq_accept_tail =0x0,
  897.    fastopenq ={
  898.      rskq_rst_head =0x0,
  899.      rskq_rst_tail =0x0,
  900.      lock ={
  901.        {
  902.          rlock ={
  903.            raw_lock ={
  904.              val ={
  905.                counter =0
  906.              }
  907.            }
  908.          }
  909.        }
  910.      },
  911.      qlen =0,
  912.      max_qlen =0
  913.    }
  914.  },
  915.  icsk_bind_hash =0xffff88006c9909c0,
  916.  icsk_timeout =0,
  917.  icsk_retransmit_timer ={
  918.    entry ={
  919.      next =0x0,
  920.      pprev =0x0
  921.    },
  922.    expires =0,
  923.    function=0xffffffff8177e850<tcp_write_timer>,
  924.    data =18446612136721221504,
  925.    flags =2,
  926.    slack =-1,
  927.    start_pid =-1,
  928.    start_site =0x0,
  929.    start_comm ="\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
  930.  },
  931.  icsk_delack_timer ={
  932.    entry ={
  933.      next =0x0,
  934.      pprev =0x0
  935.    },
  936.    expires =0,
  937.    function=0xffffffff8177dd10<tcp_delack_timer>,
  938.    data =18446612136721221504,
  939.    flags =2,
  940.    slack =-1,
  941.    start_pid =-1,
  942.    start_site =0x0,
  943.    start_comm ="\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
  944.  },
  945.  icsk_rto =250,
  946.  icsk_pmtu_cookie =0,
  947.  icsk_ca_ops =0xffffffff81f3e2e0<cubictcp>,
  948.  icsk_af_ops =0xffffffff81ac1fc0<ipv4_specific>,
  949.  icsk_sync_mss =0xffffffff81778240<tcp_sync_mss>,
  950.  icsk_ca_state =0'\000',
  951.  icsk_ca_setsockopt =0'\000',
  952.  icsk_ca_dst_locked =0'\000',
  953.  icsk_retransmits =0'\000',
  954.  icsk_pending =0'\000',
  955.  icsk_backoff =0'\000',
  956.  icsk_syn_retries =0'\000',
  957.  icsk_probes_out =0'\000',
  958.  icsk_ext_hdr_len =0,
  959.  icsk_ack ={
  960.    pending =0'\000',
  961.    quick =0'\000',
  962.    pingpong =0'\000',
  963.    blocked =0'\000',
  964.    ato =0,
  965.    timeout =0,
  966.    lrcvtime =0,
  967.    last_seg_size =0,
  968.    rcv_mss =0
  969.  },
  970.  icsk_mtup ={
  971.    enabled =0,
  972.    search_high =0,
  973.    search_low =0,
  974.    probe_size =0,
  975.    probe_timestamp =0
  976.  },
  977.  icsk_user_timeout =0,
  978.  icsk_ca_priv ={0,0,0,0,0,0,0,0}
  979. }
  980. crash>
  981. crash>
  982. crash>
  983. crash>
  984. crash>

 

使用Crash工具查看一个TCP listen sock内存布局实例的更多相关文章

  1. 利用jmap和MAT等工具查看JVM运行时堆内存

    jmap JDK自带了一些工具可以帮助我们查看JVM运行的堆内存情况,常用的是jmap命令 jmap -heap <pid> 打印堆的使用情况 那么,从这个输出中我们也可以大致看出堆的结构 ...

  2. windows下使用adb工具查看android程序cpu和内存消耗情况

    在实际的开发当中,尤其软件运行在一个硬件设备比较差的环境下,对软件占用资源大的问题是开发者们必须要解决的问题,系统比较卡.觉得应该看看程序的cpu和内存消耗 一直以来都在windows下编程,已经习惯 ...

  3. 一个Java对象的内存布局

    1.对象的创建过程 class loading class linking(verification,preparation,resolution) class initializing 申请对象内存 ...

  4. 查看struct或class的内存布局

    适用于VC编译器(Visual Studio) 附加选项: /d1 reportSingleClassLayout[foo] 例如CItem(注意后面没有空格) /d1 reportSingleCla ...

  5. wireshark抓包工具简介以及tcp三次握手的一些含义

    wireshark是非常流行的网络封包分析软件,功能十分强大.可以截取各种网络封包,显示网络封包的详细信息.使用wireshark的人必须了解网络协议,否则就看不懂wireshark了.为了安全考虑, ...

  6. 查看JVM运行时堆内存

    利用jmap和MAT等工具查看JVM运行时堆内存 https://www.cnblogs.com/cjsblog/p/9561375.html jmap JDK自带了一些工具可以帮助我们查看JVM运行 ...

  7. 一个suse11 sp1的crash工具版本问题

    这几年排查的各种类型的crash也比较多了,各种类型的也算见过,但是排查这个crash,走了不该走的弯路,事后显得很low,为了防止自己犯类似错误,也同时提醒后人,记录之. 内核是suse11,sp1 ...

  8. 使用Crash工具分析 Linux dump文件【转】

    转自:https://blog.csdn.net/bytxl/article/details/45025183 前言 Linux 内核(以下简称内核)是一个不与特定进程相关的功能集合,内核的代码很难轻 ...

  9. 使用 Crash 工具分析 Linux dump 文件

    转自:http://blog.csdn.net/commsea/article/details/11804897 简介: Linux 内核由于其复杂性,使得对内核出现的各种异常的追踪变得异常困难.本文 ...

随机推荐

  1. Ajax第一天——入门与基本概念

    什么是Ajax Ajax被认为是(Asynchronous JavaScript and XML的缩写).异步的js和xml 异步和同步:同步->类似打电话,接完一个再接下一个:异步:-> ...

  2. 使用uliweb自动创建表单

    1.在apps/blog目录下创建form.py文件 #coding:utf-8 from uliweb.form import* class blogform(Form): user = Strin ...

  3. Luogu5110 块速递推

    题面 题解 线性常系数齐次递推sb板子题 $a_n=233a_{n-1}+666a_{n-2}$的特征方程为 $$ x^2=233x+666 \\ x^2-233x+666=0 \\ x_1=\fra ...

  4. 【RedHat Linux】 链路聚合

    [链路聚合] RHEL 7运行模式:teamd 守护进程, teamdctlroundrobin 轮询activebackup 热备份, 其中一个位为backuploadbalance 负载均衡lac ...

  5. CodeForces 915D Almost Acyclic Graph

    Description You are given a directed graph consisting of \(n\) vertices and \(m\) edges (each edge i ...

  6. java对象是如何创建的

    虚拟机遇到一条new指令时,首先将去检查这个指令的参数是否能在常量池中定位到一个类的符号引用,并且检查这个符合引用代表的类是否已被加载.解析和初始化过.如果没有,那必须先执行相应的类加载过程. 在类加 ...

  7. Python 安装与专属 IDE_Pycharm 安装配置、永久激活,赠汉化版!

    这个为什么说是一次学生时代的经历呢,我的出发点并没有是为了吊胃口.确实,这个Python小应用,只能在学生时代用得着吧,尤其是高中和大学,如果你没有想到也没关系,看完我下面说的就会明白了. 对红蜘蛛软 ...

  8. PersistentAliasAttribute & CalculatedAttribute & CalculatedPersistentAliasAttribute

    一,PersistentAliasAttribute-[XPO提供] Indicates that a property is not persistent and its value is calc ...

  9. HTTP 请求/响应报文结构

    请求报文和响应报文都是由以下4部分组成: 1.请求行/响应行 2.请求头/响应头 3.空行 4.消息主体(请求体/响应体) 请求报文结构 请求行 格式为:Method Request-URI HTTP ...

  10. mysql面试常见题目2

    Sutdent表的定义 字段名 字段描述 数据类型 主键 外键 非空 唯一 自增 Id 学号 INT(10) 是 否 是 是 是 sName 姓名 VARCHAR(20) 否 否 是 否 否 Sex ...