You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.5 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # GPTtrace 🤖
  2. Generate eBPF programs and tracing with ChatGPT and natural language
  3. ## Key Features 💡
  4. - Interact and Tracing your Linux with natural language, it can tell how to write eBPF programs in `BCC`, `libbpf` styles.
  5. ![result](doc/result.png)
  6. - Generate eBPF programs with natural language
  7. ## Usage
  8. ```console
  9. $ python main.py
  10. usage: GPTtrace [-h] [-e | -v | -r TEXT] [-u UUID] [-t ACCESS_TOKEN]
  11. Use ChatGPT to write eBPF programs (bpftrace, etc.)
  12. optional arguments:
  13. -h, --help show this help message and exit
  14. -e, --explain Let ChatGPT explain what's eBPF
  15. -v, --verbose Print the receive
  16. -r TEXT, --run TEXT Generate commands using your input with ChatGPT, and run it
  17. -u UUID, --uuid UUID Conversion UUID to use, or passed through environment variable `GPTTRACE_CONV_UUID`
  18. -t ACCESS_TOKEN, --access-token ACCESS_TOKEN
  19. ChatGPT access token, see `https://chat.openai.com/api/auth/session` or passed through
  20. `GPTTRACE_ACCESS_TOKEN`
  21. ```
  22. In order to login with ChatGPT:
  23. - get the `Conversion ID` from ChatGPT, and then set it to the environment variable `GPTTRACE_CONV_UUID` or use the `-u` option. The `Conversion ID` is the last part of the URL of the conversation, for example, the `Conversion ID` of `https://chat.openai.com/conv/1a2b3c4d-0000-0000-0000-1k2l3m4n5o6p` is `1a2b3c4d-0000-0000-0000-1k2l3m4n5o6p`(example, not usable).
  24. - get the `access token` from ChatGPT, and then set it to the environment variable `GPTTRACE_ACCESS_TOKEN` or use the `-t` option. see `https://chat.openai.com/api/auth/session` for the access token.
  25. ```console
  26. ## Installation 🔧
  27. ```sh
  28. ./install.sh
  29. ```
  30. ## Examples
  31. - Files opened by process
  32. - Syscall count by program
  33. - Read bytes by process:
  34. - Read size distribution by process:
  35. - Show per-second syscall rates:
  36. - Trace disk size by process
  37. - Count page faults by process
  38. - Count LLC cache misses by process name and PID (uses PMCs):
  39. - Profile user-level stacks at 99 Hertz, for PID 189:
  40. - Files opened, for processes in the root cgroup-v2
  41. ## 🔗 Links
  42. - detail documents and tutorials about how we train ChatGPT to write eBPF programs: https://github.com/eunomia-bpf/bpf-developer-tutorial (基于 CO-RE (一次编写,到处运行) libbpf 的 eBPF 开发者教程:通过 20 个小工具一步步学习 eBPF(尝试教会 ChatGPT 编写 eBPF 程序)
  43. - bpftrace: https://github.com/iovisor/bpftrace
  44. - ChatGPT: https://chat.openai.com/

Generate eBPF programs and tracing with ChatGPT and natural language