{"id":17474266,"url":"https://github.com/dlespiau/obs","last_synced_at":"2025-08-16T07:20:22.623Z","repository":{"id":57640883,"uuid":"102872315","full_name":"dlespiau/obs","owner":"dlespiau","description":"Linux Observability Primitives ","archived":false,"fork":false,"pushed_at":"2019-03-21T12:14:24.000Z","size":28,"stargazers_count":5,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T10:38:30.658Z","etag":null,"topics":["debugging","linux","tracepoints","tracing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dlespiau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-08T14:49:54.000Z","updated_at":"2022-04-19T04:04:12.000Z","dependencies_parsed_at":"2022-09-07T08:01:28.366Z","dependency_job_id":null,"html_url":"https://github.com/dlespiau/obs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlespiau%2Fobs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlespiau%2Fobs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlespiau%2Fobs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlespiau%2Fobs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlespiau","download_url":"https://codeload.github.com/dlespiau/obs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250222088,"owners_count":21394815,"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":["debugging","linux","tracepoints","tracing"],"created_at":"2024-10-18T18:09:00.287Z","updated_at":"2025-04-22T10:39:19.261Z","avatar_url":"https://github.com/dlespiau.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linux Observability Primitives\n\nVery grand title for a humble start. This repository contains my experiments\nwith low level Linux observability, in Go.\n\nIf you are interested in the domain, you should probably check out [bcc](\nhttps://github.com/iovisor/bcc) and [gobpf]( https://github.com/iovisor/gobpf).\nThey support [eBPF](http://www.brendangregg.com/ebpf.html). I may integrate\neBPF support at some point, either through gobpf of directly, but that's a\nwhole different story.\n\n## Tracepoints\n\nTracepoints are static probes placed at critical points in the Linux kernel.\nThere are some tracepoints for many interesting events:\n\n- Scheduler: when does a process starts \u0026 exits, context switches.\n- I/O: follow block requests.\n- Filesystem: intimate details about filesystem operations (ext4, btrfs, ... are instrumented).\n- KVM: watch what KVM does, eg. VM exits.\n- Drivers: eg. on can follow Intel GPU execution requests and display events (i915 driver).\n- Syscall entry/exit.\n- Many other events and Various drivers.\n\nTo see the full list of tracepoints:\n\n```shell\n$ sudo perf list tracepoint\n[...]\n  sched:sched_kthread_stop                           [Tracepoint event]\n  sched:sched_kthread_stop_ret                       [Tracepoint event]\n  sched:sched_migrate_task                           [Tracepoint event]\n  sched:sched_move_numa                              [Tracepoint event]\n  sched:sched_process_exec                           [Tracepoint event]\n  sched:sched_process_exit                           [Tracepoint event]\n  sched:sched_process_fork                           [Tracepoint event]\n  sched:sched_process_free                           [Tracepoint event]\n  sched:sched_process_hang                           [Tracepoint event]\n  sched:sched_process_wait                           [Tracepoint event]\n[...]\n```\n\n### Example\n\n```go\n// Listen for the sched_process_exec, triggered when a process does an exec(),\n// and display the process pid and the path of binary being exec'ed. Error\n// handling is omitted.\nobserver := obs.NewObserver()\nobserver.AddTracepoint(\"sched:sched_process_exec\")\nobserver.Open()\n\nfor {\n  event, _ := observer.ReadEvent()\n  tp := event.(*obs.TracepointEvent)\n  fmt.Printf(\"exec\\t%d\\t%s\\n\", tp.GetInt(\"pid\"), tp.GetString(\"filename\"))\n}\n```\n\nThe output below is the result of running `docker run busybox sleep 3600` and\nshows the (surprisingly big) list programs that end up being executed up to\n`runc` and the `sleep` process in the container.\n\n```\nexec\t7364\t/usr/bin/docker\nexec\t7370\t/sbin/auplink\nexec\t7371\t/sbin/auplink\nexec\t7378\t/lib/udev/ifupdown-hotplug\nexec\t7380\t/bin/grep\nexec\t7381\t/sbin/ifquery\nexec\t7379\t/sbin/ifquery\nexec\t7382\t/lib/udev/ifupdown-hotplug\nexec\t7383\t/lib/systemd/systemd-sysctl\nexec\t7385\t/bin/grep\nexec\t7386\t/sbin/ifquery\nexec\t7384\t/sbin/ifquery\nexec\t7387\t/lib/systemd/systemd-sysctl\nexec\t7389\t/usr/bin/docker-containerd-shim\nexec\t7397\t/usr/bin/docker-runc\nexec\t7404\t/proc/self/exe\nexec\t7413\t/usr/bin/dockerd\nexec\t7426\t/proc/self/exe\nexec\t7433\t/lib/udev/ifupdown-hotplug\nexec\t7434\t/usr/bin/docker-runc\nexec\t7407\t/bin/sleep\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlespiau%2Fobs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlespiau%2Fobs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlespiau%2Fobs/lists"}