mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-19 10:21:55 +01:00
ftrace: add support to report function profiling data
Functions profiling data are reported in a set of files, one for each CPU. This patch adds the required support to collect these data into a single JSON formatted file. Data are collected using a shutils routing on the target side and formatted in JSON on the host side. Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
@@ -43,6 +43,18 @@ cpufreq_trace_all_frequencies() {
|
||||
done
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# FTrace Utility Functions
|
||||
################################################################################
|
||||
|
||||
ftrace_get_function_stats() {
|
||||
for CPU in $(ls /sys/kernel/debug/tracing/trace_stat | sed 's/function//'); do
|
||||
REPLACE_STRING="s/ Function/\n Function (CPU$CPU)/"
|
||||
cat /sys/kernel/debug/tracing/trace_stat/function$CPU \
|
||||
| sed "$REPLACE_STRING"
|
||||
done
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Main Function Dispatcher
|
||||
################################################################################
|
||||
@@ -63,6 +75,9 @@ cpufreq_get_all_governors)
|
||||
cpufreq_trace_all_frequencies)
|
||||
cpufreq_trace_all_frequencies $*
|
||||
;;
|
||||
ftrace_get_function_stats)
|
||||
ftrace_get_function_stats
|
||||
;;
|
||||
*)
|
||||
echo "Command [$CMD] not supported"
|
||||
exit -1
|
||||
|
Reference in New Issue
Block a user