2 Star 2 Fork 0

BiscuitOS / BiscuitOS_Memory

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
RunBiscuitOS_mm.sh 1.27 KB
Copy Edit Web IDE Raw Blame History
BuddyZhang1 authored 2020-05-03 17:19 . version 0.11
#!/bin/ash
# Running mm_bs Function
#
# (C) 2020.03.03 BuddyZhang1 <buddy.zhang@aliyun.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
OPT=$1
ARGS=$2
init_filter()
{
echo "*_bs" > /sys/kernel/debug/tracing/set_ftrace_filter
cat /sys/kernel/debug/tracing/set_ftrace_filter
echo function > /sys/kernel/debug/tracing/current_tracer
echo 1 > /sys/kernel/debug/tracing/tracing_on
echo "Staring tracing .... :)"
}
clear_filter()
{
echo > /sys/kernel/debug/tracing/set_ftrace_filter
}
trace_on()
{
echo 1 > /sys/kernel/debug/tracing/tracing_on
}
trace_off()
{
echo 0 > /sys/kernel/debug/tracing/tracing_on
}
add_filter()
{
echo $ARGS > /sys/kernel/debug/tracing/set_ftrace_filter
}
sub_filter()
{
echo $ARGS > /sys/kernel/debug/tracing/set_ftrace_notrace
}
show_trace()
{
cat /sys/kernel/debug/tracing/trace
}
mount_fs()
{
insmod /lib/modules/$(uname -r)/extra/mm_bs-0.0.1.ko
}
umount_fs()
{
echo "Hello"
}
case $OPT in
"init")
init_filter
;;
"on")
trace_on
;;
"off")
trace_off
;;
"clear")
trace_off
trace_on
;;
"add")
add_filter
;;
"sub")
sub_filter
;;
"show")
show_trace
;;
"mount")
mount_fs
;;
esac

Comment ( 0 )

Sign in for post a comment

1
https://gitee.com/BiscuitOS_team/BiscuitOS_Memory.git
git@gitee.com:BiscuitOS_team/BiscuitOS_Memory.git
BiscuitOS_team
BiscuitOS_Memory
BiscuitOS_Memory
Gitee

Search