Name | straceprof JSON |
Version |
0.0.6
JSON |
| download |
home_page | None |
Summary | Generate a profile graph from strace log |
upload_time | 2025-01-27 22:04:42 |
maintainer | Akira Kawata |
docs_url | None |
author | Akira Kawata |
requires_python | >=3.10 |
license | MIT License |
keywords |
profiling
strace
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# straceprof
`straceprof` is a profiler designed for multi-process programs. `straceprof`
can take profile of any process when you can run it under [strace](https://strace.io/). It is
particularly well-suited for profiling build processes such as those initiated
by `make`, `cmake`, shell scripts, or `docker build`.
## Quick start
Run the following commands.
```bash
$ sudo apt-get install strace
$ pip install straceprof
$ strace \
--trace=execve,execveat,exit,exit_group \
--follow-forks \
--string-limit=1000 \
-ttt \
--output=straceprof.log \
<command to profile>
$ straceprof \
--log=straceprof.log \
--output=straceprof.png
```
You will get a nice image!

## Motivation
Software compilation often involves numerous processes, including compilers,
assemblers, linkers, and file copying operations. These processes are typically
coordinated using tools like `make`.
A common challenge in software development is the significant amount of time
required to build software. For instance, building a programming language
processor might take as long as 20 minutes. To expedite this process, it is
essential to profile the build to pinpoint performance bottlenecks.
However, profiling build processes can be complex due to the wide range of
build systems available. While some build systems incorporate built-in
profiling capabilities, others do not. Furthermore, developers frequently
combine multiple build systems using shell scripts or Dockerfile to construct a
single software product.
To address these challenges, an effective profiler should be versatile and
user-friendly. It must be capable of analyzing entire build processes,
regardless of the underlying build system. Additionally, it should be suitable
for various environments, including CI systems like GitHub Actions and
containerized environments, where running privileged profilers such as `perf`
may be restricted.
In conclusion, we require a profiler that can be seamlessly integrated into
diverse build processes without demanding elevated privileges.
## Installation
### On the computer you run the build process
For Ubuntu,
```
$ sudo apt-get install strace
```
I'm sure you can install `strace` on any other distributions easily.
### On the computer you want to generate the profile image
```bash
$ pip install straceprof
```
## Usage
First, you need to generate a strace log file. You can generate a strace log
file using the following command:
```
strace \
--trace=execve,execveat,exit,exit_group \
--follow-forks \
--string-limit=1000 \
-ttt \
--output=<path to strace log file> \
<command to profile>
```
### Note
Do not change the options for `strace` command other than `--output` and
`<command to profile>`. `straceprof` assumes you run `strace` with these
options.
Then, you can generate a profile graph using the following command:
```
straceprof \
--log=<path to strace log file> \
--output=<path to output image file>
```
Other options are:
```
-h, --help show this help message and exit
--log LOG strace log file
--output OUTPUT_IMAGE
output plot file
--minimum-duration-sec MINIMUM_DURATION_SEC
The minimum duration of a process to be plotted. Shorter processes are omitted.
--title TITLE Title of the plot. When you don't specify this, the path to the log file is used.
--width WIDTH Width of the figure in pixels
--height HEIGHT Height of the figure in pixels
```
Raw data
{
"_id": null,
"home_page": null,
"name": "straceprof",
"maintainer": "Akira Kawata",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "profiling, strace",
"author": "Akira Kawata",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/fd/b0/d2d455234681d3c200f45de825398522d0bebedc814cc505c71424f87469/straceprof-0.0.6.tar.gz",
"platform": null,
"description": "# straceprof\n\n`straceprof` is a profiler designed for multi-process programs. `straceprof`\ncan take profile of any process when you can run it under [strace](https://strace.io/). It is\nparticularly well-suited for profiling build processes such as those initiated\nby `make`, `cmake`, shell scripts, or `docker build`.\n\n## Quick start\n\nRun the following commands.\n```bash\n$ sudo apt-get install strace\n$ pip install straceprof\n$ strace \\\n --trace=execve,execveat,exit,exit_group \\\n --follow-forks \\\n --string-limit=1000 \\\n -ttt \\\n --output=straceprof.log \\\n <command to profile>\n$ straceprof \\\n --log=straceprof.log \\\n --output=straceprof.png\n```\n\nYou will get a nice image!\n\n\n\n## Motivation\n\nSoftware compilation often involves numerous processes, including compilers,\nassemblers, linkers, and file copying operations. These processes are typically\ncoordinated using tools like `make`.\n\nA common challenge in software development is the significant amount of time\nrequired to build software. For instance, building a programming language\nprocessor might take as long as 20 minutes. To expedite this process, it is\nessential to profile the build to pinpoint performance bottlenecks.\n\nHowever, profiling build processes can be complex due to the wide range of\nbuild systems available. While some build systems incorporate built-in\nprofiling capabilities, others do not. Furthermore, developers frequently\ncombine multiple build systems using shell scripts or Dockerfile to construct a\nsingle software product.\n\nTo address these challenges, an effective profiler should be versatile and\nuser-friendly. It must be capable of analyzing entire build processes,\nregardless of the underlying build system. Additionally, it should be suitable\nfor various environments, including CI systems like GitHub Actions and\ncontainerized environments, where running privileged profilers such as `perf`\nmay be restricted.\n\nIn conclusion, we require a profiler that can be seamlessly integrated into\ndiverse build processes without demanding elevated privileges.\n\n## Installation\n\n### On the computer you run the build process\nFor Ubuntu,\n```\n$ sudo apt-get install strace\n```\n\nI'm sure you can install `strace` on any other distributions easily.\n\n### On the computer you want to generate the profile image\n\n```bash\n$ pip install straceprof\n```\n\n## Usage\n\nFirst, you need to generate a strace log file. You can generate a strace log\nfile using the following command:\n\n```\nstrace \\\n --trace=execve,execveat,exit,exit_group \\\n --follow-forks \\\n --string-limit=1000 \\\n -ttt \\\n --output=<path to strace log file> \\\n <command to profile>\n```\n\n### Note\nDo not change the options for `strace` command other than `--output` and\n`<command to profile>`. `straceprof` assumes you run `strace` with these\noptions.\n\nThen, you can generate a profile graph using the following command:\n\n```\nstraceprof \\\n --log=<path to strace log file> \\\n --output=<path to output image file>\n```\n\nOther options are:\n```\n -h, --help show this help message and exit\n --log LOG strace log file\n --output OUTPUT_IMAGE\n output plot file\n --minimum-duration-sec MINIMUM_DURATION_SEC\n The minimum duration of a process to be plotted. Shorter processes are omitted.\n --title TITLE Title of the plot. When you don't specify this, the path to the log file is used.\n --width WIDTH Width of the figure in pixels\n --height HEIGHT Height of the figure in pixels\n```\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Generate a profile graph from strace log",
"version": "0.0.6",
"project_urls": {
"Issues": "https://github.com/akawashiro/straceprof/issues",
"Repository": "https://github.com/akawashiro/straceprof"
},
"split_keywords": [
"profiling",
" strace"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "6e9ffaf6be3d22746f5795ef758ffc22667076dd73af77dffe434f1ac31d6d9a",
"md5": "396be1635113ef1783029c59c54992e7",
"sha256": "e5a01bfe8096cacc23da5e90320dd97f36ab986388ccd8536f99bfe82835e0ca"
},
"downloads": -1,
"filename": "straceprof-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "396be1635113ef1783029c59c54992e7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 7438,
"upload_time": "2025-01-27T22:04:38",
"upload_time_iso_8601": "2025-01-27T22:04:38.056145Z",
"url": "https://files.pythonhosted.org/packages/6e/9f/faf6be3d22746f5795ef758ffc22667076dd73af77dffe434f1ac31d6d9a/straceprof-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fdb0d2d455234681d3c200f45de825398522d0bebedc814cc505c71424f87469",
"md5": "e0fb7b8ca47912cae1680edce2768c3e",
"sha256": "69116f2bb243e5c0659f51684cf0d2b952cdeb65be7cf0536c1dcacf7fe3121b"
},
"downloads": -1,
"filename": "straceprof-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "e0fb7b8ca47912cae1680edce2768c3e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 666810,
"upload_time": "2025-01-27T22:04:42",
"upload_time_iso_8601": "2025-01-27T22:04:42.288128Z",
"url": "https://files.pythonhosted.org/packages/fd/b0/d2d455234681d3c200f45de825398522d0bebedc814cc505c71424f87469/straceprof-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-27 22:04:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "akawashiro",
"github_project": "straceprof",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "straceprof"
}