diff options
| author | Anup Sharma <[email protected]> | 2023-05-19 13:11:24 +0530 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2023-05-22 15:47:48 -0300 |
| commit | 68d12418261090b4f5b8d1b2067d15062e858e01 (patch) | |
| tree | 4ec3e177bb03fc334b0aa6b62e7e439b62eec772 /tools/perf/scripts/python/bin/task-analyzer-record | |
| parent | 7cdda6998ee55140e64894e25048df7157344fc9 (diff) | |
perf test: Add test validating JSON generated by 'perf data convert --to-json'
This commit adds support for testing the JSON output generated by the
'perf data' command's conversion to JSON functionality.
The test script now includes a step to ensure that the resulting JSON
file contains valid data.
Changes:
V1 -> V2:
Added a check for the existence of the result output file.
Replaced the usage of jq with json.load for validating the JSON format.
Checks using ShellCheck and checkpatch, addressing and resolving warnings.
Removed the unnecessary root permission check.
Modified the 'perf record' command to avoid requiring root permissions.
Committer testing:
$ perf test to-json
115: 'perf data convert --to-json' command test : Ok
$ perf test -v to-json
Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc
115: 'perf data convert --to-json' command test :
--- start ---
test child forked, pid 1746867
Testing Perf Data Convertion Command to JSON
Perf Data Converter Command to JSON [SUCCESS]
Validating Perf Data Converted JSON file
The file contains valid JSON format [SUCCESS]
test child finished with 0
---- end ----
'perf data convert --to-json' command test: Ok
$
Signed-off-by: Anup Sharma <[email protected]>
Acked-by: Ian Rogers <[email protected]>
Link: https://lore.kernel.org/r/ZGcoJBAGlknjsA/n@yoga
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Anup Sharma <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: [email protected]
Cc: [email protected]
[ Fixup indentation to use consistently tabs, not a mixture of spaces and tabs, have 'if ... ; then' on the same line ]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/task-analyzer-record')
0 files changed, 0 insertions, 0 deletions