Lines Matching +full:ftrace +full:- +full:size
2 # SPDX-License-Identifier: GPL-2.0-only
5 echo "Ftrace boottime trace test tool"
6 echo "Usage: $0 [--apply|--init] [--debug] BOOTCONFIG-FILE"
7 echo " --apply: Test actual apply to tracefs (need sudo)"
8 echo " --init: Initialize ftrace before applying (imply --apply)"
12 [ $# -eq 0 ] && usage
20 "--debug")
22 "--apply")
24 "--init")
28 [ ! -f $1 ] && usage
35 if [ `id -u` -ne 0 ]; then
49 set -x
52 TRACEFS=`grep -m 1 -w tracefs /proc/mounts | cut -f 2 -d " "`
53 if [ -z "$TRACEFS" ]; then
54 if ! grep -wq debugfs /proc/mounts; then
58 TRACEFS=`grep -m 1 -w debugfs /proc/mounts | cut -f 2 -d " "`/tracing
59 if [ ! -d $TRACEFS ]; then
60 echo "Error: ftrace is not enabled on this kernel." 1>&2
66 . `dirname $0`/ftrace.sh
73 set -e
93 echo -n "$1 "
94 xbc_get_val $2 | while read field; do echo -n "$field; "; done
100 echo -n ":$2"
102 echo -n "$__sep$field"; __sep=","
109 echo -n ".$2"
111 echo -n "$__sep$field"; __sep=","
113 echo -n ")"
117 echo -n ":${2}("`xbc_get_val ${1}.${3}`")"
123 echo -n ".snapshot()"
128 for __hdr in `xbc_subkeys ${1}.${2} 1 ".[0-9]"`; do
137 echo -n ":${2}="`xbc_get_val ${1}.var.${2} | tr -d [:space:]`
141 echo -n "hist"
145 if xbc_has_key "${1}.size"; then
146 echo -n ":size="`xbc_get_val ${1}.size`
149 echo -n ":name="`xbc_get_val ${1}.name`
155 echo -n ":pause"
157 echo -n ":continue"
159 echo -n ":clear"
166 echo -n " if "`xbc_get_val ${1}.filter`
170 setup_one_histogram() { # prefix trigger-file
174 setup_histograms() { # prefix trigger-file
175 for __hist in `xbc_subkeys ${1} 1 ".[0-9]"`; do
217 setup_events() { # prefix("ftrace" or "ftrace.instance.INSTANCE") [instance]
233 size2kb() { # size[KB|MB]
246 instance="ftrace.instance.${1}"
249 instance="ftrace"
258 set_array_of ${instance}.ftrace.filters \
260 set_array_of ${instance}.ftrace.notrace \
268 size=`xbc_get_val ${instance}.buffer_size 1`
269 size=`eval size2kb $size`
270 run_cmd "echo $size >> ${instancedir}/buffer_size_kb"
277 # ftrace global configs (kernel.*)
288 # Per-instance/per-event configs
289 if ! xbc_has_branch "ftrace" ; then
295 if xbc_has_branch "ftrace.instance"; then
296 for i in `xbc_subkeys "ftrace.instance" 1`; do
297 run_cmd "mkdir -p $TRACEFS/instances/$i"