{"id":13568609,"url":"https://gitlab.com/simulant/dcprof","last_synced_at":"2025-04-04T04:31:30.795Z","repository":{"id":61969212,"uuid":"16349926","full_name":"simulant/dcprof","owner":"simulant","description":"A sampling profiler for the Dreamcast","archived":false,"fork":false,"pushed_at":null,"size":null,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":null,"default_branch":"master","last_synced_at":"2024-11-05T00:36:04.478Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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":null,"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":"2020-01-16T09:20:48.022Z","updated_at":"2023-04-28T06:18:36.053Z","dependencies_parsed_at":"2022-10-24T11:45:21.926Z","dependency_job_id":null,"html_url":"https://gitlab.com/simulant/dcprof","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/simulant%2Fdcprof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/simulant%2Fdcprof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/simulant%2Fdcprof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/simulant%2Fdcprof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners/simulant","download_url":"https://gitlab.com/simulant/dcprof/-/archive/master/dcprof-master.zip","host":{"name":"gitlab.com","url":"https://gitlab.com","kind":"gitlab","repositories_count":4518517,"owners_count":6909,"icon_url":"https://github.com/gitlab.png","version":null,"created_at":"2022-05-30T11:31:42.605Z","updated_at":"2024-07-18T11:24:13.055Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners"}},"keywords":[],"created_at":"2024-08-01T14:00:29.115Z","updated_at":"2025-04-04T04:31:25.780Z","avatar_url":null,"language":null,"readme":"# dcprof\n\ndcprof is a gprof compatible sampling profiler for the Sega Dreamcast + KallistiOS.\n\n## Usage\n\nFirst include profiler.h and profiler.c in your project.\n\nIn your application, at the start of main usually, you put the following code:\n\n```\n    profiler_init(\"/pc/gmon.out\");\n    profiler_start();\n```\n\nThen, at the end of your program (possibly using `std::set_terminate` or `atexit`) you do this:\n\n```\n    profiler_stop();\n    profiler_clean_up();\n```\n\n`profiler_init` starts a background thread for taking samples, but it doesn't actually do anything until you call \n`profiler_start` (this is so you can choose where to start/stop your profiling).\n\nThe file path passed in is where the profiling data will be written to. You will only get a file generated\nif you are running your application from within the `dcload` tool which mounts a writable `/pc` directory.\n\nIf the directory isn't writable, you should get CSV output written to the terminal but you'll likely\nneed to post-process that to something useful.\n\n## How it Works\n\nOnce profiling has begun, the background thread will regularly gather the PC and PR registers stored by\nthe other threads.\n\nThe way thread scheduling works is that when other threads are blocked their current program counter is stored\nin a context. If the profiler thread is doing work then all the other threads aren't and so the stored program\ncounters will be up-to-date.\n\nThe profiling thread gathers PC/PR pairs and how often that pairing appears.\n\n## Limitations\n\n - Currently only the main thread is recorded, although with more testing that will change.\n - The sample rate is always going to be approximate because it's dependent on thread scheduling, it would\n be better to use a time interuppt but that might break threading and it gets complicated quickly.\n \n## License\n\ndcprof is released under the MIT license.\n","funding_links":[],"categories":["Testing and Debugging"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Fsimulant%2Fdcprof","html_url":"https://awesome.ecosyste.ms/projects/gitlab.com%2Fsimulant%2Fdcprof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2Fsimulant%2Fdcprof/lists"}