SHARE
TWEET

Untitled

a guest Oct 16th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. https://getfedora.org/en/workstation/download/
  2. sudo systemct enable --now sshd
  3. # Need kernel to match kernel-devel
  4. sudo dnf update kernel
  5. # sudo reboot
  6.  
  7. # https://elixir.bootlin.com/linux/latest/source
  8. # https://github.com/torvalds/linux/
  9. # https://blog.stgolabs.net/search/label/linux
  10. # BOOT UP
  11. # https://manybutfinite.com/post/cpu-rings-privilege-and-protection/
  12. # https://manybutfinite.com/post/kernel-boot-process/
  13. # https://manybutfinite.com/post/how-computers-boot-up/
  14.  
  15. # Program memory
  16. # https://manybutfinite.com/post/system-calls/
  17. # https://manybutfinite.com/post/how-the-kernel-manages-your-memory/
  18. # https://manybutfinite.com/post/anatomy-of-a-program-in-memory/
  19.  
  20. # Syscalls
  21. # https://alex.dzyoba.com/blog/os-interrupts/
  22. # https://manybutfinite.com/post/what-does-an-idle-cpu-do/
  23. # https://manybutfinite.com/post/when-does-your-os-run/
  24.  
  25. # Stack
  26. # https://manybutfinite.com/post/journey-to-the-stack/
  27. # https://alex.dzyoba.com/blog/redzone/
  28.  
  29. # All tools
  30. # syscall vs kernel function
  31. # http://brendangregg.com/Perf/linux_perf_tools_full.png
  32. # https://alex.dzyoba.com/blog/kernel-profiling/
  33. # https://alex.dzyoba.com/blog/systemtap/
  34. # https://medium.com/netflix-techblog/linux-performance-analysis-in-60-000-milliseconds-accc10403c55
  35.  
  36. # Strace
  37. ## How strace works
  38. sudo dnf install strace
  39. sudo strace  ping 8.8.8.8 -c 1
  40.  
  41. # Trace-cmd
  42. ## https://jvns.ca/blog/2017/03/19/getting-started-with-ftrace/
  43. ## https://alex.dzyoba.com/blog/ftrace/
  44. ## https://raw.githubusercontent.com/torvalds/linux/v4.4/Documentation/trace/ftrace.txt
  45. ## https://raw.githubusercontent.com/torvalds/linux/v4.4/Documentation/trace/ftrace-design.txt
  46. ## tell about ftrace
  47. ## Flamescope? https://www.youtube.com/watch?v=03EC8uA30Pw
  48. ### 5 key issues and how netflix cloud is architected to solve them
  49. #### 1. autoscaling (spinnaker)
  50. #### 2. bad push (rollback)
  51. #### 3. instance failure (hystrix timeouts)
  52. #### 4. region failure (zuul 2 reroute traffic)
  53. #### 5. overlooked issue (chaos engineering)
  54. ## why do root scope analysis?
  55. ### high latency
  56. ### growth
  57. ### upgrades
  58. ## methodologies http://www.brendangregg.com/methodology.html
  59. ## red (RATE ERRORS DURATION) USE (utilization saturation errors)
  60. ## Anti methods
  61. ### bad instance anti method(just delete)
  62. ## checklist methodology
  63. ## zipkin
  64. ## http://brendangregg.com/linuxperf.html
  65. ## @43:26 from perf to bpf
  66. ## @45:48 ftrace/perf/ebpf
  67. ## books http://www.brendangregg.com/books.html
  68. http://kernelshark.org/Documentation.html
  69. sudo dnf install trace-cmd kernelshark
  70. sudo trace-cmd record  -l "*ip_*" -l "*icmp*" -p function_graph ping 8.8.8.8 -c 1
  71. kernelshark
  72.  
  73.  
  74. # Bcc/ebpf
  75. ## why not just pcap/tcpdump https://sdcast.ksdaemon.ru/2017/07/sdcast-58/ Павел Одинцов
  76. ## xdp
  77. ## https://www.youtube.com/watch?v=ZdVpKx6Wmc8 1 min
  78. ## https://www.youtube.com/watch?v=GsMs3n8CB6g 15 min
  79. ## https://www.youtube.com/watch?v=bj3qdEDbCD4 45 min Velocity 2017: Performance Analysis Superpowers with Linux eBPF @14:08 fast new way
  80. ## https://www.youtube.com/watch?v=4SiWL5tULnQ More on ebpf
  81. ## https://en.wikipedia.org/wiki/IPv4
  82. sudo dnf install bcc
  83. sudo /usr/share/bcc/tools/trace -Ilinux/skbuff.h \
  84.     'ip_send_skb(struct net *netx, struct sk_buff *skb) "ip dst: %d %d %d %d", *(skb->data+16), *(skb->data+17), *(skb->data+18), *(skb->data+19)'
  85. # sudo /usr/share/bcc/tools/execsnoop
  86. # ls and echo difference - type hash which commands
  87.  
  88. # Get pids
  89. ## sudo /usr/share/bcc/tools/tcplife
  90. ## curl localhost:8080
  91.  
  92. # Part I
  93. https://www.youtube.com/watch?v=FJW8nGV4jxY
  94. # Part II
  95. https://www.youtube.com/watch?v=zrr2nUln9Kk
  96. # Slides
  97. https://www.slideshare.net/brendangregg/velocity-2015-linux-perf-tools
  98. # Perf labs
  99. https://github.com/brendangregg/perf-labs/tree/master/src
  100.  
  101. # Perf
  102. ## https://perf.wiki.kernel.org/index.php/Tutorial
  103. sudo dnf install git
  104. sudo dnf install perf
  105. sudo dnf install perl-open.noarch
  106. git clone https://github.com/brendangregg/FlameGraph  # or download it from github
  107. cd FlameGraph
  108. sudo perf record -F 9999 -a -g -- git clone https://github.com/brendangregg/FlameGraph
  109. sudo perf script | ./stackcollapse-perf.pl > out.perf-folded
  110. ./flamegraph.pl out.perf-folded > perf-kernel.svg
  111. python3 -m http.server
  112. sudo rm -rf FlameGraph/ out.perf-folded perf-kernel.svg perf.data
  113.  
  114. # Рассказать о стеках
  115. sudo perf top
  116.  
  117. #sudo perf record -g -a -e skb:kfree_skb
  118. #sudo perf script
  119.  
  120. # https://github.com/lukego/blog/issues/13
  121. # https://github.com/pavel-odintsov/drop_watch
  122.  
  123.  
  124. # ARP
  125. sudo trace-cmd record  -l "*arp*" -l "icmp_rcv" -p function_graph python3 -m http.server
  126. sudo ip -s -s neigh flush all
  127.  
  128. # Packet Fragmentation/Defragmentation
  129. sudo trace-cmd record   -l "ip_fragment*" -p function_graph python3 -m http.server
  130. ping 192.168.122.1 -s 2000 -c 5
  131.  
  132. # Forwarding & Local Delivery
  133.  
  134.  
  135. # ICMP
  136. ICMP Header
  137. Применение ICMP
  138. Приём и передача ICMP сообщений
  139.  
  140. # L4
  141. Available L4 Protocols
  142. L4 Protocol Registration
  143. L3 to L4 Delivery: ip_local_deliver_finish
  144.  
  145.  
  146. # Use kfree_skb to detect failures
  147. vm_ip=192.168.122.184
  148. curl $vm_ip
  149. sudo /usr/share/bcc/tools/trace -Ilinux/skbuff.h 'kfree_skb(struct sk_buff *skb) (*(skb->data+23)==80) "ip dst: %d %d %d %d %d", *(skb->data+16), *(skb->data+17), *(skb->data+18), *(skb->data+18), *(skb->data+23)'
  150.  
  151.  
  152. # https://sdcast.ksdaemon.ru/2019/01/sdcast-97/ Александр Тоболь
  153.  
  154.  
  155. # https://www.youtube.com/watch?v=L5msC6pswQs Debugging Linux Issues with eBPF
  156.  
  157. sudo trace-cmd record  -l "*ip_fragment*" -p function_graph python3 -m http.server
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top