mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-19 10:21:55 +01:00
Merge pull request #16 from derkling/add_ftrace_function_profiling
Add ftrace function profiling
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