{"id":19054363,"url":"https://github.com/datadog/ddprof","last_synced_at":"2025-08-21T06:31:29.044Z","repository":{"id":37741830,"uuid":"449307615","full_name":"DataDog/ddprof","owner":"DataDog","description":"The Datadog Native Profiler for Linux","archived":false,"fork":false,"pushed_at":"2024-12-10T17:05:24.000Z","size":53274,"stargazers_count":50,"open_issues_count":24,"forks_count":4,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-12-11T12:25:40.410Z","etag":null,"topics":["c","cpp","diagnostics","native","performance","profiling","rust"],"latest_commit_sha":null,"homepage":"","language":"C++","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/DataDog.png","metadata":{"files":{"readme":"Readme.md","changelog":"changelog","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-18T14:02:54.000Z","updated_at":"2024-12-04T01:08:44.000Z","dependencies_parsed_at":"2023-11-27T10:33:30.555Z","dependency_job_id":"54333898-ba73-4358-b69b-2d8fa8084f67","html_url":"https://github.com/DataDog/ddprof","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fddprof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fddprof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fddprof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataDog%2Fddprof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataDog","download_url":"https://codeload.github.com/DataDog/ddprof/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230494921,"owners_count":18235046,"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":["c","cpp","diagnostics","native","performance","profiling","rust"],"created_at":"2024-11-08T23:38:01.546Z","updated_at":"2024-12-19T20:08:46.244Z","avatar_url":"https://github.com/DataDog.png","language":"C++","readme":"# ddprof\n\nThe Datadog Native Profiler for Linux.\n\n## Overview\n\n`ddprof` is a command-line utility to gather profiling data. After install you will continuously see where your application is spending CPU and memory allocations.\nThe data will be available in the `/profiling` section of the [Datadog UI](https://app.datadoghq.com/).\n\n## Quick Start\n\nOur official documentation is available [here](https://docs.datadoghq.com/profiler/enabling/ddprof/?tab=environmentvariables).\nOur pre-built binaries are compatible with both musl and glibc. You should not need to recompile `ddprof` from source. \n\n### From binary [Recommended]\n\nAn installation guide is available [here](https://docs.datadoghq.com/profiler/enabling/ddprof/?tab=environmentvariables).\nCheck out our Release page for our [latest](https://github.com/DataDog/ddprof/releases/latest) release. Download the release and extract `ddprof`.\nInstrumenting your application should be as simple as adding `ddprof` in front of your usual command line.\n\nTo install the profiler, check out our [installation-helpers](#Installation-helpers) bellow.\n\nThe following command will run `ddprof` with the default settings (CPU and allocations)\n\n```bash\nddprof -S service-name-for-my-program ./my_program arg1 arg2\n```\n\nProfiling data shows up in the `/profiling` section of your Datadog UI. Specifying a service name will help you select your profiling data. \nRefer to [commands](docs/Commands.md) for a more advanced usage of `ddprof`.\n\n### From source\n\nCheckout our build section [here](./docs/Build.md).\n\n## Prerequisites\n\n### Perf event paranoid\n\nThe target machine must have `perf_event_paranoid` set to 2 or lower.\n\n```bash\n# needs to be less than or equal to 2\ncat /proc/sys/kernel/perf_event_paranoid\n```\n\nHere is an example adding a startup configuration to your system. This requires a system restart.\n\n```bash\nsudo sh -c 'echo kernel.perf_event_paranoid=2 \u003e /etc/sysctl.d/perf_event_paranoid_2.conf'\n```\n\nAlternatively you can use `CAP_SYS_ADMIN` or `sudo` as a one off test mechanism, more in the [Troubleshooting](./docs/Troubleshooting.md) section. \nDon't hesitate to [reach-out](#Reaching-out) if you are not able to use our profiler!\n\n### Agent installation\n\nIt is recommended to have an agent setup on the system you are profiling.\nBy default the profiler will target `localhost:8126` (the default trace agent endpoint). The `DD_TRACE_AGENT_URL` environment variable can be used to override this setting.\n\n## Installation helpers\n\n### Ubuntu / Debian\n\nInstall curl.\n\n```bash\nsudo apt-get update \u0026\u0026 \\\nsudo DEBIAN_FRONTEND=noninteractive apt-get install -y curl\n```\n\nDownload the latest ddprof version, installing it to /usr/local/bin.\n\n```bash\n# ARCH should hold amd64 or arm64 \nARCH=$(dpkg --print-architecture) \u0026\u0026 \\\nurl_release=\"https://github.com/DataDog/ddprof/releases/latest/download/ddprof-${ARCH}\" \u0026\u0026 \\\ncurl -L -o ddprof ${url_release} \u0026\u0026 \\\nchmod 755 ddprof \u0026\u0026 \\\nsudo mv ddprof /usr/local/bin \u0026\u0026 \\\nddprof --version\n```\n\n## Examples\n\n### Memory leaks\n\nIf your application runs with the default allocator (or a dynamically linked jemalloc), we will instrument your allocations. Launch this command and checkout the live heap profiles in the UI. You can use the compare tool to understand allocations which are growing over time.\n\n```bash\nddprof -S my-service-name --preset cpu_live_heap -l warn --worker-period 15000 ./my-application\n```\n:warning: The `--worker-period` flag is used to avoid the resets of the heap profile. The default value is 4 hours. This changes to 15000 minutes (10+ days).\n\n### Everything running on a host\n\nYou can instrument all running applications with the following command. You can use a fake service name to find your profiles.\n\n```bash\nsudo ddprof -S host-123 -g -l warn\n```\n\n## Key Features\n\n### Simplicity\n\n`ddprof` is a wrapper, so using it should be as simple as injecting the binary into your container and wrapping your entrypoint.\n`ddprof` will use environment variables if they are available, overriding them with commandline parameters if given.\n\n### Safety\n\n- Minimal interference to execution of instrumented processes\n- `ddprof`'s Memory usage is sandboxed\n\n### Allocation profiling\n\n- By working in user space, `ddprof` can instrument allocations with low overhead\n\n## Docs\n\nArchitectural showpieces and such will always be available in the `docs/` folder.\n\n- [Build](./docs/Build.md)\n- [Design](./docs/Design.md)\n- [Automatically updated list of commads](./docs/Commands.md)\n- [Troubleshooting](./docs/Troubleshooting.md)\n\n## Reaching-out\n\nAny contribution is welcome. Please check out our guidelines [here](CONTRIBUTING.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fddprof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatadog%2Fddprof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatadog%2Fddprof/lists"}