Lines Matching +full:sub +full:- +full:modules

2 # SPDX-License-Identifier: GPL-2.0-only
3 # perf-with-kcore: use perf with a copy of kcore
7 set -e
11 …echo "Usage: perf-with-kcore <perf sub-command> <perf.data directory> [<sub-command options> [ --
12 echo " <perf sub-command> can be record, script, report or inject" >&2
13 echo " or: perf-with-kcore fix_buildid_cache_permissions" >&2
19 if [ -n "$PERF" ] ; then
23 if [ -z "$PERF" ] ; then
27 if [ ! -x "$PERF" ] ; then
39 if [ $EUID -eq 0 ] ; then
45 rm -f perf.data.junk
46 ("$PERF" record -o perf.data.junk "${PERF_OPTIONS[@]}" -- sleep 60) >/dev/null 2>/dev/null &
52 KCORE=$(($SUDO "$PERF" buildid-cache -v -f -k /proc/kcore >/dev/null) 2>&1)
54 "kcore added to build-id cache directory "*)
55 KCORE_DIR=${KCORE#"kcore added to build-id cache directory "}
71 $SUDO cp -a "$KCORE_DIR" "$(pwd)/$PERF_DATA_DIR"
72 $SUDO rm -f "$KCORE_DIR/kcore"
73 $SUDO rm -f "$KCORE_DIR/kallsyms"
74 $SUDO rm -f "$KCORE_DIR/modules"
83 $SUDO chown $UID "$KCORE_DIR/modules"
88 $SUDO chgrp $GROUPS "$KCORE_DIR/modules"
90 ln -s "$KCORE_DIR_BASENAME" "$PERF_DATA_DIR/kcore_dir"
95 if [ $EUID -ne 0 ] ; then
100 if [ -z "$SUDO_USER" ] ; then
109 …find "$USER_HOME/.debug" -xdev -type d ! -user "$SUDO_USER" -ls -exec chown "$SUDO_USE…
110 …find "$USER_HOME/.debug" -xdev -type f -links 1 ! -user "$SUDO_USER" -ls -exec chown "$SUDO_USE…
111 …find "$USER_HOME/.debug" -xdev -type l ! -user "$SUDO_USER" -ls -exec chown -h "$SUDO_USE…
113 if [ -n "$SUDO_GID" ] ; then
114 …find "$USER_HOME/.debug" -xdev -type d ! -group "$SUDO_GID" -ls -exec chgrp "$SUDO_GID…
115 …find "$USER_HOME/.debug" -xdev -type f -links 1 ! -group "$SUDO_GID" -ls -exec chgrp "$SUDO_GID…
116 …find "$USER_HOME/.debug" -xdev -type l ! -group "$SUDO_GID" -ls -exec chgrp -h "$SUDO_GID…
124 if [ $EUID -eq 0 ] ; then
128 PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type d ! -user "$USER" -print -quit)
129 PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type f -links 1 ! -user "$USER" -print -quit)
130 PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type l ! -user "$USER" -print -quit)
132 PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type d ! -group "$GROUPS" -print -quit)
133 PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type f -links 1 ! -group "$GROUPS" -print -quit)
134 PERMISSIONS_OK+=$(find "$HOME/.debug" -xdev -type l ! -group "$GROUPS" -print -quit)
136 if [ -n "$PERMISSIONS_OK" ] ; then
145 if [ $EUID -ne 0 ] ; then
147 if [ "$(cat /proc/sys/kernel/kptr_restrict)" -ne 0 ] ; then
151 …if echo "${PERF_OPTIONS[@]}" | grep -q ' -a \|^-a \| -a$\|^-a$\| --all-cpus \|^--all-cpus \| --all
152 …echo "*** WARNING *** system-wide tracing without root access will not be able to read all necessa…
155 if echo "${PERF_OPTIONS[@]}" | grep -q 'intel_pt\|intel_bts\| -I\|^-I' ; then
156 if [ "$(cat /proc/sys/kernel/perf_event_paranoid)" -gt -1 ] ; then
160 …if echo "${PERF_OPTIONS[@]}" | grep -q ' --per-thread \|^--per-thread \| --per-thread$\|^--per-thr…
162 elif echo "${PERF_OPTIONS[@]}" | grep -q ' -t \|^-t \| -t$\|^-t$' ; then
164 elif [ ! -r /sys/kernel/debug -o ! -x /sys/kernel/debug ] ; then
170 if [ -z "$1" ] ; then
175 if [ -e "$PERF_DATA_DIR" ] ; then
184 echo "$PERF record -o $PERF_DATA_DIR/perf.data ${PERF_OPTIONS[@]} -- $@"
185 "$PERF" record -o "$PERF_DATA_DIR/perf.data" "${PERF_OPTIONS[@]}" -- "$@" || true
200 …echo "$PERF $PERF_SUB_COMMAND -i $PERF_DATA_DIR/perf.data --kallsyms=$PERF_DATA_DIR/kcore_dir/kall…
201 …"$PERF" $PERF_SUB_COMMAND -i "$PERF_DATA_DIR/perf.data" "--kallsyms=$PERF_DATA_DIR/kcore_dir/kalls…
214 if [ -z "$PERF_SUB_COMMAND" ] ; then
218 if [ -z "$PERF_DATA_DIR" ] ; then
224 while [ "$1" != "--" ] ; do
228 if [ "$1" != "--" ] ; then