| #!/bin/bash |
| # SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| # |
| # Copyright (c) 2019 Amlogic, Inc. All rights reserved. |
| # |
| |
| # the script is used to count the init time of each module. |
| # |
| # usage: |
| # ./get_init_time.sh file |
| # |
| # the "file" contains information about "initcall". |
| # |
| # the final result is saved in the init_time_result.txt file. |
| # |
| |
| path=`pwd` |
| cat $1 | grep "initcall " | sed "s/\(.*\)after \(.*\)/\2 \1/g" | sort -nr > $path/sort_init |
| |
| cat $path/sort_init | sed "s/\(.*\)usecs.* initcall\(.*\)+0x.*/\1 \2/g" > $path/init_time_result.txt |
| |
| rm $path/sort_init |