{"id":13466266,"url":"https://github.com/iovisor/ply","last_synced_at":"2025-03-25T21:31:45.657Z","repository":{"id":42039068,"uuid":"52912583","full_name":"iovisor/ply","owner":"iovisor","description":"Dynamic Tracing in Linux","archived":false,"fork":true,"pushed_at":"2025-02-15T15:05:39.000Z","size":1441,"stargazers_count":989,"open_issues_count":10,"forks_count":94,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-02-15T15:35:00.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"wkz/ply","license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iovisor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-01T21:49:00.000Z","updated_at":"2025-02-15T15:05:43.000Z","dependencies_parsed_at":"2023-01-30T03:00:27.480Z","dependency_job_id":null,"html_url":"https://github.com/iovisor/ply","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iovisor%2Fply","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iovisor%2Fply/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iovisor%2Fply/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iovisor%2Fply/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iovisor","download_url":"https://codeload.github.com/iovisor/ply/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245547816,"owners_count":20633446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T15:00:41.779Z","updated_at":"2025-03-25T21:31:45.642Z","avatar_url":"https://github.com/iovisor.png","language":"C","funding_links":[],"categories":["C","\u003ca id=\"89e277bca2740d737c1aeac3192f374c\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"203d00ef3396d68f5277c90279f4ebf3\"\u003e\u003c/a\u003e新添加"],"readme":"ply\n===\n\nDocumentation and language reference is available at\n[wkz.github.io/ply][3].\n\nA light-weight dynamic tracer for Linux that leverages the kernel's\nBPF VM in concert with kprobes and tracepoints to attach probes to\narbitrary points in the kernel. Most tracers that generate BPF\nbytecode are based on the LLVM based BCC toolchain. ply on the other\nhand has no required external dependencies except for `libc`. In\naddition to `x86_64`, ply also runs on `aarch64`, `arm`, `loongarch`,\n`mips`, `riscv64`, `riscv32`, and `powerpc`. Adding support for more\nISAs is easy.\n\n`ply` follows the [Little Language][1] approach of yore, compiling ply\nscripts into Linux [BPF][2] programs that are attached to kprobes and\ntracepoints in the kernel. The scripts have a C-like syntax, heavily\ninspired by `dtrace(1)` and, by extension, `awk(1)`.\n\nThe primary goals of `ply` are:\n\n   * Expose most of the BPF tracing feature-set in such a way that new\n     scripts can be whipped up very quickly to test different\n     hypotheses.\n\n   * Keep dependencies to a minimum. Right now Flex and Bison are\n     required at build-time, leaving `libc` as the only runtime\n     dependency. Thus, `ply` is well suited for embedded targets.\n\nIf you need more fine-grained control over the kernel/userspace\ninteraction in your tracing, checkout the [bcc][4] project which\ncompiles C programs to BPF using LLVM in combination with a python\nuserspace recipient to give you the full six degrees of freedom.\n\n\nExamples\n--------\n\nHere are some one-liner examples to show the kinds of questions that\n`ply` can help answer.\n\n**What is the distribution of the returned sizes from `read(2)`s to the VFS?**\n```\nply 'kretprobe:vfs_read { @[\"size\"] = quantize(retval); }'\n```\n\n**Which processes are receiving errors when reading from the VFS?**\n```\nply 'kretprobe:vfs_read if (retval \u003c 0) { @[pid, comm, retval] = count(); }'\n```\n\n**Which files are being opened, by who?**\n```\nply 'kprobe:do_sys_open { printf(\"%v(%v): %s\\n\", comm, uid, str(arg1)); }'\n```\n\n**When sending packets, where are we coming from?**\n```\nply 'kprobe:dev_queue_xmit { @[stack] = count(); }'\n```\n\n**From which hosts and ports are we receiving TCP resets?**\n```\nply 'tracepoint:tcp/tcp_receive_reset {\n\tprintf(\"saddr:%v port:%v-\u003e%v\\n\",\n\t\tdata-\u003esaddr, data-\u003esport, data-\u003edport);\n}'\n```\n\n\nBuild and Installation\n----------------------\n\n`ply` uses GNU's autotools as its build system. When building from\na Git clone, use the following steps:\n\n```\n./autogen.sh   # to generate the configure script\n./configure\nmake\nmake install   # you probably need to be root for this\n```\n\nContributing\n------------\n\nContributions are welcome! To help you on your way, the [test/](test/)\ndirectory contains ready-made infrastructure to:\n\n- Test cross-compilation on all supported architectures.\n- Run a simple test suite on a range of machines using QEMU system\n  emulation.\n- Run interactive sessions on QEMU machines.\n\nA GitHub Action is setup to run these jobs. Please make sure to test\nyour changes locally before opening a PR to avoid unnecessary review\ncycles.\n\nMaintainers\n-----------\n\n`ply` is developed and maintained by [Tobias Waldekranz][5]. Please\ndirect all bug reports and pull requests towards the official\n[Github][6] repo.\n\n[1]: http://c2.com/cgi/wiki?LittleLanguage\n[2]: https://www.kernel.org/doc/Documentation/networking/filter.txt\n[3]: https://wkz.github.io/ply\n[4]: https://github.com/iovisor/bcc\n[5]: mailto://tobias@waldekranz.com\n[6]: https://github.com/iovisor/ply\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiovisor%2Fply","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiovisor%2Fply","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiovisor%2Fply/lists"}