{"id":20822006,"url":"https://github.com/mikehorn-git/systrace","last_synced_at":"2025-06-26T09:06:37.791Z","repository":{"id":250776768,"uuid":"759538598","full_name":"MikeHorn-git/systrace","owner":"MikeHorn-git","description":"Basic strace","archived":false,"fork":false,"pushed_at":"2025-01-17T16:30:32.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-10T01:45:29.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MikeHorn-git.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-18T21:21:42.000Z","updated_at":"2025-01-17T16:30:34.000Z","dependencies_parsed_at":"2024-11-17T22:13:46.720Z","dependency_job_id":"4afb18cf-ebd2-44fe-9a6b-eca293095d12","html_url":"https://github.com/MikeHorn-git/systrace","commit_stats":null,"previous_names":["mikehorn-git/systrace"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MikeHorn-git/systrace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeHorn-git%2Fsystrace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeHorn-git%2Fsystrace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeHorn-git%2Fsystrace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeHorn-git%2Fsystrace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MikeHorn-git","download_url":"https://codeload.github.com/MikeHorn-git/systrace/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MikeHorn-git%2Fsystrace/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262035181,"owners_count":23248357,"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-11-17T22:13:42.201Z","updated_at":"2025-06-26T09:06:37.531Z","avatar_url":"https://github.com/MikeHorn-git.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nTrace system calls of a given pid with ptrace(2) and waitpid(1).\n\n# Architecture\n\n```mermaid\ngraph TD\n    Start([Start Program]) --\u003e CheckArgs{Check if\u003cbr\u003earguments are valid}\n    CheckArgs -- Invalid --\u003e ExitInvalidArgs([Exit with usage message])\n    CheckArgs -- Valid --\u003e ParsePID[Parse PID from arguments]\n\n    ParsePID --\u003e SetupSignalHandler[Setup SIGINT signal handler]\n    SetupSignalHandler --\u003e AttachProcess[Attach to the process using ptrace]\n    AttachProcess -- Failed --\u003e ExitAttachError([Exit with error])\n\n    AttachProcess -- Success --\u003e WaitInitialStop[Wait for the process to stop]\n    WaitInitialStop -- Failed --\u003e ExitWaitError([Exit with error])\n    WaitInitialStop -- Success --\u003e MonitorSyscalls[Start monitoring syscalls]\n\n    subgraph SyscallMonitoring[Syscall Monitoring Loop]\n        MonitorSyscalls --\u003e EnterSyscall[Request process to enter next syscall]\n        EnterSyscall -- Failed --\u003e ExitSyscallError([Exit with error])\n\n        EnterSyscall -- Success --\u003e WaitSyscallStop[Wait for syscall event]\n        WaitSyscallStop -- Failed --\u003e ExitWaitError\n\n        WaitSyscallStop -- ProcessExited --\u003e Break[Break the loop]\n        WaitSyscallStop -- SyscallStop --\u003e GetSyscallInfo[Get syscall info with ptrace]\n\n        GetSyscallInfo -- Failed --\u003e HandleSyscallError[Log error and exit if necessary]\n        GetSyscallInfo -- Success --\u003e PrintSyscallInfo[Print syscall name and arguments]\n\n        PrintSyscallInfo --\u003e ContinueSyscall[Request process to continue]\n        ContinueSyscall -- Failed --\u003e ExitContinueError([Exit with error])\n        \n        ContinueSyscall --\u003e WaitSyscallStop2[Wait for syscall result]\n        WaitSyscallStop2 -- Failed --\u003e ExitWaitError\n        WaitSyscallStop2 -- Success --\u003e GetSyscallResult[Get syscall result with ptrace]\n        GetSyscallResult -- Failed --\u003e LogSyscallError[Log error and continue]\n\n        GetSyscallResult -- Success --\u003e PrintSyscallResult[Print syscall result]\n        PrintSyscallResult --\u003e EnterSyscall\n    end\n\n    MonitorSyscalls -- ProcessExited --\u003e DetachProcess[Detach process using ptrace]\n    DetachProcess -- Failed --\u003e ExitDetachError([Exit with error])\n    DetachProcess -- Success --\u003e ExitSuccess([Exit Successfully])\n\n    HandleSignal([Handle SIGINT]) --\u003e DetachSignalProcess[Detach process using ptrace]\n    DetachSignalProcess --\u003e ExitOnSignal([Exit on signal])\n```\n\n# Build\n\n```bash\nUsage: make \u003ctarget\u003e\nTargets:\n  all      Build the release version of systrace\n  debug    Build the debug version of systrace_debug\n  format   Format source files using clang-format\n  clean    Remove generated binaries\n  fast     Clean, format, and build the release version\n```\n\n# Usage\n\n```bash\nUsage: ./systrace \u003cpid\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikehorn-git%2Fsystrace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikehorn-git%2Fsystrace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikehorn-git%2Fsystrace/lists"}