Created
September 26, 2022 15:27
-
-
Save kbingham/34664071fcbcf237fce7f2a55f84e7a8 to your computer and use it in GitHub Desktop.
lcdebug - helper to debug libcamera
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SPDX-License-Identifier: GPL-2.0-or-later | |
# Support debugging libcamera commands and applications. | |
# We default to enabling the most debug | |
# (that's why we're being used right) | |
FILTER="*" | |
LEVEL="0" | |
STRACE="" | |
while [[ $# -gt 0 ]] | |
do | |
case $1 in | |
-x) | |
set -x; | |
shift; | |
;; | |
-s|--strace) | |
STRACE="strace -e ioctl -f --" | |
shift; | |
;; | |
-f|--filter) | |
FILTER="$2"; | |
shift; shift; | |
;; | |
-l|--level) | |
LEVEL="$2"; | |
shift; shift; | |
;; | |
-h|--help) | |
echo "The following filters are available:" | |
git grep "^LOG_DEFINE_CATEGORY" | \ | |
awk -F '[()]' '{print $2}' | \ | |
sort | |
exit | |
;; | |
*|--) # unknown option, The rest belongs to the command | |
break; | |
;; | |
esac | |
done | |
LIBCAMERA_LOG_LEVELS=$FILTER:$LEVEL $STRACE "${@}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment