This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repo has moved to RDKCentral
- Loading branch information
Stephen Foulds
authored
Aug 22, 2023
1 parent
9dd5d79
commit ef4d107
Showing
1 changed file
with
2 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,2 @@ | ||
# MemCapture | ||
|
||
Memory capture and analysis tool for RDK | ||
|
||
## Build | ||
|
||
```shell | ||
$ mkdir build && cd ./build | ||
$ cmake -DCMAKE_BUILD_TYPE=Release .. | ||
$ make -j$(nproc) | ||
``` | ||
|
||
## Run | ||
|
||
``` | ||
Usage: MemCapture <option(s)> | ||
Utility to capture memory statistics | ||
-h, --help Print this help and exit | ||
-o, --output-dir Directory to save results in | ||
-j, --json Save data as JSON in addition to HTML report | ||
-d, --duration Amount of time (in seconds) to capture data for. Default 30 seconds | ||
-p, --platform Platform we're running on. Supported options = ['AMLOGIC', 'REALTEK', 'BROADCOM']. Defaults to Amlogic | ||
-g, --groups Path to JSON file containing the group mappings (optional) | ||
``` | ||
|
||
Example: | ||
|
||
```shell | ||
$ ./MemCapture --platform AMLOGIC --duration 30 --groups ./groups.json --output-dir /tmp/memcapture_results/ | ||
``` | ||
|
||
Averages are calculated over the specified duration. | ||
|
||
### Process Grouping | ||
|
||
To ease analysis, MemCapture supports grouping processes into categories. This is done by providing MemCapture with a | ||
JSON file containing the groups and regexes defining which process(es) should belong to that group. | ||
|
||
For example if the provided JSON file contained the below: | ||
|
||
```json | ||
{ | ||
"processes": [ | ||
{ | ||
"group": "Logging", | ||
"processes": [ | ||
"syslog-ng", | ||
"systemd-journald" | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
The `syslog-ng` and `systemd-journald` processes would belong to the `Logging` group and show up in the process list | ||
with that group name. | ||
|
||
An example file (`groups.example.json`) is provided in the repo. | ||
|
||
### Results | ||
|
||
By default, MemCapture will produce a file called `report.html` in the selected output directory. If no directory is provided, it | ||
will create a `MemCaptureReport` subdirectory in the current working directory to save the files. | ||
|
||
This report can be opened in any web browser and contains a summary view of all the metrics collected. | ||
|
||
If the `-j` argument is provided to MemCapture, then an additional `results.json` file will be created. This contains the | ||
raw data from MemCapture and is designed for importing into a backend system for analysis/reporting. | ||
|
||
### Notes | ||
|
||
Tool currently supports three platforms - `AMLOGIC` (default), `REALTEK` and `BROADCOM`. Not all stats are available on | ||
all platforms | ||
## This repository has moved | ||
Future development will take place in RDKCentral: https://github.com/rdkcentral/MemCapture |