tools/rtla: Consolidate common command line options
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | tools/rtla: Add common_parse_options()tools/ tools/ tools/ +3 more | +47 | 0 replies | |
| 2/8 | tools/rtla: Consolidate -c/--cpus option parsingtools/ tools/ tools/ +2 more | +11 | 0 replies | |
| 3/8 | tools/rtla: Consolidate -C/--cgroup option parsingtools/ tools/ tools/ +2 more | +10 | 0 replies | |
| 4/8 | tools/rtla: Consolidate -D/--debug option parsingtools/ tools/ tools/ +2 more | +9 | 0 replies | |
| 5/8 | tools/rtla: Consolidate -d/--duration option parsingtools/ tools/ tools/ +2 more | +11 | 0 replies | |
| 6/8 | tools/rtla: Consolidate -e/--event option parsingtools/ tools/ tools/ +2 more | +16 | 0 replies | |
| 7/8 | tools/rtla: Consolidate -P/--priority option parsingtools/ tools/ tools/ +2 more | +11 | 0 replies | |
| 8/8 | tools/rtla: Consolidate -H/--house-keeping option parsingtools/ tools/ tools/ +2 more | +11 | 0 replies |
Reviews trailers per patch
None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Crystal Wood |
|---|---|
| Series | R-b |
| 1/8 | |
| 2/8 | |
| 3/8 | |
| 4/8 | |
| 5/8 | |
| 6/8 | |
| 7/8 | |
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v1 0/8] tools/rtla: Consolidate common command line options
Argument parsing functions are the longest functions of the project:
lizard --warnings_only --sort nloc -L100 | head -n 4./src/timerlat_hist.c:766: warning: timerlat_hist_parse_args has 247 NLOC, 76 CCN, 1579 token, 1 PARAM, 287 length, 0 ND ./src/timerlat_top.c:538: warning: timerlat_top_parse_args has 217 NLOC, 64 CCN, 1338 token, 2 PARAM, 262 length, 0 ND ./src/osnoise_hist.c:469: warning: osnoise_hist_parse_args has 195 NLOC, 56 CCN, 1225 token, 1 PARAM, 216 length, 0 ND ./src/osnoise_top.c:322: warning: osnoise_top_parse_args has 169 NLOC, 46 CCN, 1019 token, 2 PARAM, 191 length, 0 ND
Moreover, they contain a lot of duplicate code and growing.
Refactor these functions to reduce code duplication.
Benefits:
- Single implementation for common options
- Easier maintenance and consistent behavior
Costa Shulyupin (8):
tools/rtla: Add common_parse_options() tools/rtla: Consolidate -c/--cpus option parsing tools/rtla: Consolidate -C/--cgroup option parsing tools/rtla: Consolidate -D/--debug option parsing tools/rtla: Consolidate -d/--duration option parsing tools/rtla: Consolidate -e/--event option parsing tools/rtla: Consolidate -P/--priority option parsing tools/rtla: Consolidate -H/--house-keeping option parsing
tools/tracing/rtla/src/common.c | 78 ++++++++++++++++++++++++++ tools/tracing/rtla/src/common.h | 1 + tools/tracing/rtla/src/osnoise_hist.c | 53 ++--------------- tools/tracing/rtla/src/osnoise_top.c | 53 ++--------------- tools/tracing/rtla/src/timerlat_hist.c | 53 ++--------------- tools/tracing/rtla/src/timerlat_top.c | 52 ++--------------- 6 files changed, 95 insertions(+), 195 deletions(-)
Signature · 1 line
2.51.1